04.06.2013, 23:35
I have create vehicle but I want it so when the vehicle blows up it doesnt respawn how can I do that?
// create a per-vehicle global variable to tell whether you want a vehicle to be respawned or not
new NoRespawn[MAX_VEHICLES];
// now when creating a vehicle which you don't want it to be respawned
new id;
id = CreateVehicle(...);
NoRespawn[id] = 1; // setting it to 1 which means: Do not respawn!
public OnVehicleSpawn(vehicleid) // called when a vehicle spawns
{
if(NoRespawn[vehicleid] == 1) // if the value of NoRespawn variable of 'vehicleid' is equal to 1
{
DestroyVehicle(vehicleid); // destroy it
}
return 1;
}