13.05.2016, 14:44
If the "reason" of the player's death is 51 (Explosion) then you can check if the player is in range of the last explosion within 5 seconds from the time the explosion was created. If the type of the explosion creates fire, you may need to increase the interval.
Bare in mind that it cannot be 100 percent accurate but from nothing.
pawn Код:
enum e_Explosion
{
Float: e_X,
Float: e_Y,
Float: e_Z,
Float: e_radius,
e_timestamp
};
new Explosion[e_Explosion];
pawn Код:
stock HF_CreateExplosion(Float: X, Float: Y, Float: Z, type, Float: radius)
{
Explosion[e_X] = X;
Explosion[e_Y] = Y;
Explosion[e_Z] = Z;
Explosion[e_radius] = radius;
Explosion[e_timestamp] = gettime();
return CreateExplosion(X, Y, Z, type, radius);
}
#if defined _ALS_CreateExplosion
#undef CreateExplosion
#else
#define _ALS_CreateExplosion
#endif
#define CreateExplosion HF_CreateExplosion
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if (reason == 51 && gettime() - Explosion[e_timestamp] < 5 && IsPlayerInRangeOfPoint(playerid, Explosion[e_radius], Explosion[e_X], Explosion[e_Y], Explosion[e_Z]))
{
// code..
}
return 1;
}