New callbacks:
pawn Код:
public OnPlayerShoot(playerid, weaponid)
public OnExplosionCreated(playerid, Float:x, Float:y, Float:z, Float:radius)
The first one could be called once per every single shot fired. It should be called not only when the player shoots on foot, but also when he punches, when he uses a melee weapon, when he performs drive by (either as driver or as passenger) and when he shoots from any armed vehicle (like Rustler, Hydra, Hunter, Seasparrow, RC Baron, Rhino or Predator). In the case of Hunter, which has both minigun and rockets, the parameter 'weaponid' should tell which weapon is fired.
And the second callback would be called every time there's an explosion caused by the regular gameplay (i.e, not a scripted one), like for example a player throwing a grenade, firing Rhino's cannon, or simply a vehicle exploding after getting set on fire. If no player caused the explosion, playerid would be INVALID_PLAYER_ID. Examples of posible uses of this callback are checking if there's an empty vehicle in the radius of the explosion and in that case reduce its vehicle health to simulate damage, or setting all players in the same team with SetPlayerTeam and in case of a player being in the radius of an explosion reduce his armour/health.