Squirrel/Server/Functions/Utils/GetTickCount

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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 ...)
 

Revision as of 04:31, 13 November 2009

This function returns the uptime of the host in milliseconds.

Syntax

  1. int TickCounter()

Arguments

  • none

Example

This example tells the player how long the host pc has been on when they type '/hoston'

  1.  
  2. function OnPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "hoston" )
  5. {
  6. MessagePlayer( "The host pc has been online for " + floor( TickCounter() / 60000 ) + " minutes.", player );
  7. }
  8. }
  9.  

Notes

The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Template:Squirrel/Functions/Misc

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox