Scripting/Squirrel/Functions/Game/SetTime

From VC-MP Wiki

Jump to: navigation, search

This function changes the server time.

Syntax

bool SetTime( int hour, int min )

Arguments

  • hour - Hours
  • min - Minutes

Example

This command will set the time to 0:00 when someone types '/c midnight'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "midnight" )
     {
          SetTime( 0, 0 );
     }
}

Notes

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

Related Functions

Personal tools
squirrel scripting