Squirrel/Server/Functions/Players/VirtualWorld

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Arguments)
(Arguments)
 
Line 10: Line 10:
  
 
* '''value''' - An ID of the virtual world that the player is in.
 
* '''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 >
+
You Can Make The value = False To Log Out The virtual world Like This > <code>player.VirtualWorld = false;</code>
  
 
== Example 1. Returning ==
 
== Example 1. Returning ==

Latest revision as of 09:01, 11 August 2013

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns the players Virtual World.

[edit] Syntax

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

[edit] 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;

[edit] 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.  

[edit] 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.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox