04.06.2013, 23:44
https://sampwiki.blast.hk/wiki/OnVehicleSpawn
pawn Код:
// 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;
}