warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
DestroyVehicle
Description
Destroy a vehicle. It will disappear instantly.
Name | Description |
---|---|
vehicleid | The ID of the vehicle to destroy. |
Returns
true - The function executed successfully.
false - The function failed to execute. The vehicle does not exist.
Examples
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/destroyveh", true) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicleid);
}
return 1;
}
return 0;
}
Related Functions
- CreateVehicle: Create a vehicle.
- RemovePlayerFromVehicle: Throw a player out of their vehicle.
- SetVehicleToRespawn: Respawn a vehicle.