12.05.2010, 10:22
Hey everyone I've got a problam... When my vehicle is on its death it explodes everyone and set everyones health...
heres my code..
Would this work?
are my loops fucked
please help..
heres my code..
Код:
public OnVehicleDeath(vehicleid, killerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float:x, Float:y, Float:z;
SetPlayerHealth(i, 0.0);
DestroyVehicle(vehicleid);
GetPlayerPos(i,x, y, z);
CreateExplosion(x, y , z, 0, 10);
}
return 1;
}
Код:
public OnVehicleDeath(vehicleid, killerid)
{
new Float:x, Float:y, Float:z;
SetPlayerHealth(killerid, 0.0);
DestroyVehicle(vehicleid);
GetPlayerPos(killerid,x, y, z);
CreateExplosion(x, y , z, 0, 10);
return 1;
}
please help..

You could try with the 'killerid' to blow up or go with a playerToPoint() check to see if your player is near the car. Getting the playerid itself, however, is not possible since OnVehicleDeath() does not have a parameter 'playerid'.