Scripting/Squirrel/Functions/SetTime: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function will set the game minute. == Syntax == <pre>SetTime( hour, minute )</pre> == Arguments == * ''int'' '''hour'''' - The hour of the game (from 00 to 23) * ''in...") |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
== Arguments == | == Arguments == | ||
* ''int'' '''hour | * ''int'' '''hour''' - The hour of the game (from 00 to 23) | ||
* ''int'' '''minute''' - The minute of the game (from 00 to 59) | * ''int'' '''minute''' - The minute of the game (from 00 to 59) | ||
== Example == | == Example == | ||
{{ | <source lang=squirrel> | ||
function onPlayerCommand( player, cmd, text ) | |||
{ | |||
if ( cmd == "settime" ) | |||
{ | |||
If ( !text ) MessagePlayer( "Format: /settime <hr> <min>"", player ); | |||
else | |||
{ | |||
local a = split(text, " ") | |||
if ( !IsNum( a[0] ) MessagePlayer( "Format: /settime <hr> <min>"", player ); | |||
else if ( !IsNum( a[1] ) MessagePlayer( "Format: /settime <hr> <min>"", player ); | |||
else SetTime( a[0], a[1] ); | |||
} | |||
} | |||
} | |||
</source> | |||
=== Notes === | === Notes === | ||
== Related Functions == | == Related Functions == | ||
{{Scripting/Squirrel/Functions/Server_Settings}} | {{Scripting/Squirrel/Functions/Server_Settings}} | ||
[[Category:Scripting/Squirrel/Functions/Server_Settings _Functions]] |
Latest revision as of 21:50, 30 January 2017
This function will set the game minute.
Syntax
SetTime( hour, minute )
Arguments
- int hour - The hour of the game (from 00 to 23)
- int minute - The minute of the game (from 00 to 59)
Example
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "settime" )
{
If ( !text ) MessagePlayer( "Format: /settime <hr> <min>"", player );
else
{
local a = split(text, " ")
if ( !IsNum( a[0] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
else if ( !IsNum( a[1] ) MessagePlayer( "Format: /settime <hr> <min>"", player );
else SetTime( a[0], a[1] );
}
}
}
Notes
Related Functions
- GetDeathmatchScoreboard
- GetDeathMessages
- GetDrivebyEnabled
- GetDriveOnWater
- GetFallEnabled
- GetFastSwitch
- GetFlyingCars
- GetFrameLimiter
- GetFriendlyFire
- GetGameModeName
- GetGamespeed
- GetGravity
- GetHour
- GetJoinMessages
- GetJumpSwitch
- GetKillDelay
- GetMaxHeight
- GetMaxPlayers
- GetMinute
- GetObjectCount
- GetPerfectHandling
- GetPickupCount
- GetPlayers
- GetServerName
- GetPassword
- GetShootInAir
- GetShowNametags
- GetShowOnlyTeamMarkers
- GetShowOnRadar
- GetSkinID
- GetStuntBike
- GetSyncFrameLimiter
- GetTaxiBoostJump
- GetTickCount
- GetTimeRate
- GetVehicleCount
- GetVehiclesForcedRespawnHeight
- GetWallglitch
- GetWaterLevel
- GetWeaponSync
- GetWeather
- ReloadScripts
- SetDeathmatchScoreboard
- SetDeathMessages
- SetDrivebyEnabled
- SetDriveOnWater
- SetFallEnabled
- SetFastSwitch
- SetFlyingCars
- SetFrameLimiter
- SetFriendlyFire
- SetGameModeName
- SetGamespeed
- SetGravity
- SetHour
- SetJoinMessages
- SetJumpSwitch
- SetKillDelay
- SetMaxHeight
- SetMaxPlayers
- SetMinute
- SetPerfectHandling
- SetServerName
- SetPassword
- SetShootInAir
- SetShowNametags
- SetShowOnlyTeamMarkers
- SetShowOnRadar
- SetStuntBike
- SetSyncFrameLimiter
- SetTaxiBoostJump
- SetTimeRate
- SetTime
- SetVehiclesForcedRespawnHeight
- SetWallglitch
- SetWaterLevel
- SetWeaponSync
- ShutdownServer