SetIslands

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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.

Syntax

  1. bool SetIslands( int iIslands )

Arguments

  • iIslands - The value for possible islands (check above)

Example

This will change the open islands when someone types '/setislands <value>'.

  1.  
  2. function onPlayerCommand( player, command, text )
  3. {
  4. if ( command == "setislands" )
  5. {
  6. if ( text.tointeger() < 4 && text.tointeger() >= 0 ) SetIslands( text.tointeger() )
  7. else MessagePlayer( "Error - Allowed islands must be between 0 and 3", player );
  8. }
  9.  
  10. return 1;
  11. }
  12.  
  13.  

Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox