05.02.2010, 04:14
There are many creative ways you could do this.
If the hydra driver does manage to avoid the auto killer detection.
Here is one possibility, it may not be the most efficient, its just an example
https://sampwiki.blast.hk/wiki/Useful_Functions for GetClosestPlayer
If the hydra driver does manage to avoid the auto killer detection.
Here is one possibility, it may not be the most efficient, its just an example
https://sampwiki.blast.hk/wiki/Useful_Functions for GetClosestPlayer
pawn Код:
new PlayerLastVehicle[MAX_PLAYERS];
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetVehicleModel(vehicleid) == 520)
{
new Float:vhealth;
GetVehicleHealth(vehicleid, vhealth);
if(vhealth > 250)
{
PlayerLastVehicle[playerid] = vehicleid;
SetTimerEx("ClearPlayerVehicle", 2000, 0, "d", playerid);
}
}
}
forward ClearPlayerVehicle(playerid);
public ClearPlayerVehicle(playerid)
{
PlayerLastVehicle[playerid]=0;
}
public OnPlayerDeath(playerid, killerid, reason)
{
//check if no killer registered and the closest player just exited a hydra
if(killerid == INVALID_PLAYER_ID )
{
new closestP = GetClosestPlayer(playerid);
if(PlayerLastVehicle[closestP]==520)
{
killerid = closestP;
reason = 0;/*I dont know what hydra normally comes up as */
}
}
}