Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-04-2010, 03:21 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
You're going to need to use a timeout, or something similar. Since seconds are your smallest unit, make the 'jail time' count in seconds; e.g., 1 hour in jail would be 3600 seconds. Store that somewhere, like a clientr. variable.

Then, format those seconds into the hh:mm:ss format. There are functions in the Code Gallery for that, I think. But it's pretty easy math:
hours = jailTimeinSeconds / 3600
minutes = (jailTimeinSeconds % 3600) / 60
seconds = (jailTimeinSeconds % 3600) % 60
After that, you're going to need to do some special formatting to put zeros in front of single-digit numbers. (As simple as checking if the number < 10.)

Then just display that however you want.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.