Scripting/Squirrel/Functions/Game/SetHour
From VC-MP Wiki
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
- GetHour
- SetHour
- GetMinute
- SetMinute
- SetTime
- GetTimeRate
- SetTimeRate
- GetWeather
- SetWeather
- GetWeatherRate
- SetWeatherRate
- GetWeatherLock
- SetWeatherLock
- SetAmmuWeapon
- IsAmmuWeaponEnabled
- SetAmmuWeaponEnabled
- CreateMarker
- CreateMarkerForPlayer
- GetWeaponSync
- SetWeaponSync
- GetGravity
- SetGravity
- GetGamespeed
- SetGamespeed
- GetWaterLevel
- SetWaterLevel
