13.05.2012, 19:40
CreateVehicle return the vehicleid. Thus, in the examples above, you save the vehicleid to a variable (car1,car2 etc).
To delete a vehicle, simply use DestroyVehicle (under OnVehicleDeath for example):
To delete a vehicle, simply use DestroyVehicle (under OnVehicleDeath for example):
pawn Code:
#include <a_samp>
new car;
public OnGameModeInit()
{
car = CreateVehicle(411,.......);
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
if(vehicleid == car) // if the vehicle that blew up is "car"
{
DestroyVehicle(vehicleid); //delete the vehicle (so it won't respawn)
}
return 1;
}