Squirrel/Server/Functions/Game/SetTime

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

Revision as of 14:41, 20 October 2008

Changes the server world time. This affects all players.

Syntax

  1. 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'.

  1.  
  2. function OnPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "settime" )
  5. {
  6. local aTime = split( text, " " );
  7. local szHour = aTime[0], szMin = aTime[1];
  8. SetTime( szHour.tointeger(), szMin.tointeger() );
  9. }
  10. }
  11.  

Notes

The call OnPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Template:Squirrel/Functions/Game

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox