onPlayerIslandChange

From Liberty Unleashed Wiki
Revision as of 17:14, 8 November 2010 by Juppi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called when a player moves from an island to another.

Syntax

  1. function onPlayerIslandChange( Player player, int old_island, int new_island )

Arguments

  • player - The pointer of the player
  • old_island - The island they left
  • new_island - The island they just entered

Returns

This event does not handle return values.

Example

This will tell the player which island they just entered.

  1.  
  2.  
  3. function GetIslandName( i )
  4. {
  5. switch ( i )
  6. {
  7. case 1:
  8. return "Portland";
  9. case 2:
  10. return "Staunton Island";
  11. case 3:
  12. return "Shoreside Vale";
  13. }
  14. return "Unknown";
  15. }
  16.  
  17. function onPlayerIslandChange( player, old, new )
  18. {
  19. MessagePlayer( "Your have entered " + GetIslandName( new ), player );
  20. return 1;
  21. }
  22.  

Notes

The function MessagePlayer was used in this example. More info about it can be found in the corresponding page.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox