Squirrel/Server/Functions/Game/SetTime
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ Changes the server world time. This affects all players. == Syntax == <code>bool SetTime( int hour, int min )</code> == Arguments == * '''hour''' - The number of hours you wa...) |
m (Squirrel/Functions/Game/SetTime moved to Squirrel/Server/Functions/Game/SetTime: Server-side scripting only) |
Revision as of 20:07, 26 November 2009
Changes the server world time. This affects all players.
Syntax
bool SetTime( int hour, int min )
Arguments
- hour - The number of hours you want to change the server time to
- min - The number of minutes you want to change the server time to
Example
This command will change the server time to 12:00 when somebody types '/settime 12 00'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "settime" ) { local aTime = split( text, " " ); local szHour = aTime[0], szMin = aTime[1]; SetTime( szHour.tointeger(), szMin.tointeger() ); } }
Notes
The call OnPlayerCommand was used in in this example. More info about this in the corresponding page.