Making cars never respawn
#2

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;
}
Reply


Messages In This Thread
Making cars never respawn - by lramos15 - 04.06.2013, 23:35
Re: Making cars never respawn - by [KHK]Khalid - 04.06.2013, 23:44
Re: Making cars never respawn - by lramos15 - 05.06.2013, 23:57

Forum Jump:


Users browsing this thread: 2 Guest(s)