Squirrel/Server/Functions/Utils/GetTickCount
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function returns the uptime of the host in milliseconds. == Syntax == <code>int TickCounter()</code> == Arguments == * '''none''' == Example == This example tells the ...) |
m (Squirrel/Functions/Misc/TickCounter moved to Squirrel/ServerFunctions/Misc/GetTickCount: Function renamed) |
Revision as of 04:31, 13 November 2009
This function returns the uptime of the host in milliseconds.
Syntax
int TickCounter()
Arguments
- none
Example
This example tells the player how long the host pc has been on when they type '/hoston'
function OnPlayerCommand( player, cmd, text ) { if ( cmd == "hoston" ) { MessagePlayer( "The host pc has been online for " + floor( TickCounter() / 60000 ) + " minutes.", player ); } }
Notes
The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.