Squirrel/Server/Functions/Players/RemoveFromVehicle

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
{{Squirrel/Title|RemoveFromVehicle}}
+
{{Squirrel/Title|Player.RemoveFromVehicle}}
 +
This function removes player from a vehicle.
  
 
== Arguments ==
 
== Arguments ==
Line 6: Line 7:
  
 
== Example ==
 
== Example ==
 +
 +
This command will force yourself out of the vehicle.
 +
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( player, cmd, text )
 
function onPlayerCommand( player, cmd, text )
     else if (cmd == "out" )
+
{
 +
     if ( cmd == "out" )
 
     {
 
     {
         local plr = player;
+
         player.RemoveFromVehicle();
 
+
     }
        plr.RemoveFromVehicle( );
+
   
     }  
+
    return 1;
 +
}
 
</code>
 
</code>
  
This command will force yourself out of the vehicle.
+
=== Notes ===
 
+
== Notes ==
+
  
 
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page.
 
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page.
 +
 +
== Related Functions ==
 +
 +
{{Squirrel/Server/Functions/Players}}

Latest revision as of 23:37, 19 October 2010

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

This function removes player from a vehicle.

[edit] Arguments

  • player - The player to be forced out of the vehicle.

[edit] Example

This command will force yourself out of the vehicle.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "out" )
  5. {
  6. player.RemoveFromVehicle();
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox