Vehicle.VirtualWorld

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

This function sets or return the VirtualWorld of a vehicle.

Syntax

  1. Vehicle.VirtualWorld = int;

Example

This example sets the vehicle with ID 0 VirtualWorld or gets if szParams is not used

  1.  
  2. function onPlayerCommand ( pPlayer, szCommand, szParams ) {
  3.  
  4. switch ( szCommand ) {
  5.  
  6. case "w": {
  7.  
  8. local World = FindVehicle ( 0 ).VirtualWorld;
  9. if ( szParams ) {
  10. World = szParams.tointeger ( );
  11. FindVehicle ( 0 ).VirtualWorld = World;
  12. return;
  13. }
  14.  
  15. MessagePlayer ( "Current VirtualWorld of vehicle ID 0: " + World, pPlayer );
  16. return;
  17. }
  18. }
  19. }
  20.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox