SA-MP Forums Archive
Static vehicles not affected by OnVehicleSpawn? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Static vehicles not affected by OnVehicleSpawn? (/showthread.php?tid=309642)



Static vehicles not affected by OnVehicleSpawn? - Scarred - 08.01.2012

I've got a bit of code on OnVehicleSpawn that is not working on vehicles I spawn using AddStaticVehicle, every other vehicle spawned (/spawnvehicle, CreateVehicle, ect) is working correctly and calls the callback, but AddStaticVehicle refuses to. Has anyone else noticed this?

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
    return 1;
}



Re: Static vehicles not affected by OnVehicleSpawn? - PowerPC603 - 08.01.2012

Why are you turning off the engine and lights when a vehicle respawns?
Respawning a vehicle does that by default.
Even a blown up vehicle is restored to it's original state as it was when it was created.


Re: Static vehicles not affected by OnVehicleSpawn? - Scarred - 08.01.2012

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
Why are you turning off the engine and lights when a vehicle respawns?
Respawning a vehicle does that by default.
Even a blown up vehicle is restored to it's original state as it was when it was created.
In my experience, that's not the case.


Re: Static vehicles not affected by OnVehicleSpawn? - Vince - 08.01.2012

OnVehicleSpawn is actually a misleading name. It should be called OnVehicleRespawn, as it is not called with the initial spawn.