SA-MP Forums Archive
OnVehicleDeath Problem.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnVehicleDeath Problem.. (/showthread.php?tid=221585)



OnVehicleDeath Problem.. - MrIncredible - 05.02.2011

ok.. so, i give a player a vehicle, and i code itl ike this

Code:
onplayerspawn 

car[playerid] =  CreateVehicle(444, -25.4514,462.4341,31.8625,19.7708, 6, 54, -1);
PutPlayerInVehicle(playerid,car[playerid],0);
this works fine, but now i want to know when the vehicle dies.. so i do this

Code:
 onvehicledeath
for (new i = 0; i != MAX_PLAYERS; i++)
{
if (car[i] == vehicleid)
{ 
SendClientMessageToAll(TRES,"A vehicle has died");
car[i]=-1;
}
}
but it seems to work only when your vehicle goins in the water, not when it actualy blows up.. you know its health goes lover than 250, and it blows up.. so what is the problem?


Re: OnVehicleDeath Problem.. - MrIncredible - 05.02.2011

anyone want to help?


Re: OnVehicleDeath Problem.. - MrIncredible - 05.02.2011

hellllllllllllllp


Re: OnVehicleDeath Problem.. - marinov - 05.02.2011

stop bumping, read the rules, only bump post 48hrs old


Re: OnVehicleDeath Problem.. - MrIncredible - 07.02.2011

Help, anyone?


Re: OnVehicleDeath Problem.. - MrIncredible - 08.02.2011

helpp, pls help mee.


Re: OnVehicleDeath Problem.. - Unknown123 - 08.02.2011

Quote:
Originally Posted by marinov
View Post
stop bumping, read the rules, only bump post 48hrs old
Read what he said.


Anyway:
Change
pawn Code:
for (new i = 0; i != MAX_PLAYERS; i++)
TO
pawn Code:
for (new i = 0; i != MAX_VEHICLES; i++)