Squirrel/Server/Functions/Vehicles/Remove

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
Line 14: Line 14:
 
function onPlayerCommand( player, cmd, text )
 
function onPlayerCommand( player, cmd, text )
 
{
 
{
if ( cmd == "vehpos" )
+
if ( cmd == "remvehicle" )
 
{
 
{
 
if ( text )
 
if ( text )

Revision as of 14:52, 8 March 2010

This function removes the given vehicle.

Syntax

  1. bool Vehicle.Remove()

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "remvehicle" )
  5. {
  6. if ( text )
  7. {
  8. local veh = FindVehicle( text.tointeger() );
  9. if ( veh )
  10. {
  11. veh.Remove();
  12. MessagePlayer( "Removed vehicle ID: " + text, player );
  13. }
  14. }
  15. }
  16. }
  17.  

This command will remove the given vehicle ID.

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox