DestroyVehicle

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:51, 1 October 2013
W (Talk | contribs)

← Previous diff
Revision as of 17:29, 4 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|Destroys a vehicle which was previously created.}} {{Description|Destroys a vehicle which was previously created.}}
Line 34: Line 33:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +[[fr:DestroyVehicle]]
[[it:DestroyVehicle]] [[it:DestroyVehicle]]
[[ru:DestroyVehicle]] [[ru:DestroyVehicle]]

Revision as of 17:29, 4 February 2014



Description:

Destroys a vehicle which was previously created.


Parameters:
(vehicleid)
vehicleidThe vehicleid of the vehicle which shall be destroyed.


Return Values:

  • 0: Vehicle does not exist.
  • 1: Vehicle was successfully destroyed.


public OnPlayerCommandText(playerid, cmdtext[])
{
     //First the script gets the vehicle id of the current car and then destroys it when typing /destroyveh
     if(strcmp(cmdtext, "/destroyveh", true) == 0)
     {
          new currentveh;
          currentveh = GetPlayerVehicleID(playerid);
          DestroyVehicle(currentveh);
          return 1;
     }
 
     return 0;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages