DestroyVehicle

From SA-MP Wiki

Jump to: navigation, search

DestroyVehicle


Destroys a vehicle which was previously created.


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


This function does not return a specific value.


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 might be useful as well, as they're related to this function in one way or another.

Personal tools