OnVehicleDeath - Doesn't call the first time - 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: OnVehicleDeath - Doesn't call the first time (
/showthread.php?tid=576142)
OnVehicleDeath - Doesn't call the first time -
Aerotactics - 01.06.2015
For some reason I've found that OnVehicleDeath isn't being called the first time a vehicle dies in my server. Every other time after that it does call. Keep in mind the means of death is water.
Here's the code, although idk if it is relevant.
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new playerveh = GetPlayerVehicleID(i);
if(vehicleid == playerveh)
{
SetPlayerHealth(i, -1.0);
break;
}
}
DestroyVehicle(vehicleid);
return 1;
}