Scripting/Squirrel/Functions/Game/SetHour

From VC-MP Wiki

Jump to: navigation, search

This function changes the hours of the server time.

Syntax

bool SetHour( int hour )

Arguments

  • hour - Hours to set

Example

This example will advance the server time by one hour if someone types '/c timejump'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "timejump" )
     {
          local hour = GetHour() + 1;
          
          SetHour( hour > 23 : hour - 24 ? hour );
     }
}

Notes

The function GetHour and call onPlayerCommand were also used in the example. More info about them in the corresponding pages.

Related Functions

Personal tools
squirrel scripting