AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help: Creating Timestamps in AMXX (https://forums.alliedmods.net/showthread.php?t=46204)

Bad_Bud 10-21-2006 10:48

Help: Creating Timestamps in AMXX
 
I would like to store a timestamp to a variable so I can compare it to another timestamp. I want to be using this as a sort of poor man's timer. Is this possible? If so, how do I create timestamps?

Zenith77 10-21-2006 11:22

Re: Help: Creating Timestamps in AMXX
 
Hmm, not sure if this is a valid answer but you can use HL's gametime.

Code:
new Float:gametime = get_gametime(); if (gametime > myDelay) {      // Code... }

Also what are you timing for?

MaximusBrood 10-21-2006 17:20

Re: Help: Creating Timestamps in AMXX
 
To get the current timestamp just use get_systime().

At least, if your definition of a ' current timestamp' is:
Amount of seconds elapsed since 00:00:00 on January 1, 1970

Zenith77 10-21-2006 19:36

Re: Help: Creating Timestamps in AMXX
 
Oh wow, I was way off target.

Bad_Bud 10-21-2006 20:56

Re: Help: Creating Timestamps in AMXX
 
It works, thanks. Glad I didn't have to use something like set_task for something so simple. :)


All times are GMT -4. The time now is 04:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.