Player.VirtualWorld

From Liberty Unleashed Wiki
Revision as of 09:01, 11 August 2013 by Mido pop (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 function sets/returns the players Virtual World.

Syntax

  1. int player.VirtualWorld
  1. player.VirtualWorld = int value

Arguments

  • value - An ID of the virtual world that the player is in.
You Can Make The value = False To Log Out The virtual world Like This >
  1. player.VirtualWorld = false;

Example 1. Returning

This will tell the player what virtual world they are in when they type '/vworld'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "vworld" )
  5. {
  6. MessagePlayer( "Your current virtual world is - " + pPlayer.VirtualWorld, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

Example 2. Setting

This will set the player's virtual world to world 1 when they type '/vworld2'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "vworld2" )
  5. {
  6. pPlayer.VirtualWorld = 1;
  7. }
  8. return 1;
  9. }
  10.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox