Squirrel/Server/Functions/Game/SetIslands
From Liberty Unleashed Wiki
(Difference between revisions)
m (→Example: Fixed the code) |
|||
Line 23: | Line 23: | ||
if ( command == "setislands" ) | if ( command == "setislands" ) | ||
{ | { | ||
− | if | + | if ( text.tointeger() < 4 && text.tointeger() >= 0 ) SetIslands( text.tointeger() ) |
else MessagePlayer( "Error - Allowed islands must be between 0 and 3", player ); | else MessagePlayer( "Error - Allowed islands must be between 0 and 3", player ); | ||
} | } |
Latest revision as of 22:19, 28 July 2015
This function sets the allowed islands when the server is in Liberty Unleashed mode. Possible values are:
- 0 - All islands closed.
- 1 - Portland and Staunton open, Shoreside closed.
- 2 - Portland closed, Staunton and Shoreside open.
- 3 - Portland open, Staunton and Shoreside open.
[edit] Syntax
bool SetIslands( int iIslands )
[edit] Arguments
- iIslands - The value for possible islands (check above)
[edit] Example
This will change the open islands when someone types '/setislands <value>'.
function onPlayerCommand( player, command, text ) { if ( command == "setislands" ) { if ( text.tointeger() < 4 && text.tointeger() >= 0 ) SetIslands( text.tointeger() ) else MessagePlayer( "Error - Allowed islands must be between 0 and 3", player ); } return 1; }
[edit] Notes
The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
[edit] Related Functions
- CloseGarage
- CloseSSVBridge
- EnableTrains
- GetBoundariesLower
- GetBoundariesUpper
- GetFriendlyFire
- GetGamespeed
- GetGravity
- GetHour
- GetIslands
- GetMinute
- GetSSVBridgeLock
- GetSSVBridgeUpdateTime
- GetSurfaceTraction
- GetTimeLock
- GetWeather
- GetWeatherLock
- IsSSVBridgeUp
- OpenGarage
- OpenSSVBridge
- SetBoundaries
- SetFriendlyFire
- SetGamespeed
- SetGravity
- SetIslands
- SetSSVBridgeLock
- SetSSVBridgeUpdateTime
- SetSurfaceTraction
- SetTime
- SetTimeLock
- SetWeather
- SetWeatherLock