23.07.2012, 12:35
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_FIRE))
{
new Float:vec[3];
GetPlayerPos(playerid, vec[0], vec[1], vec[2]);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 3.0, vec[0], vec[1], vec[2]))
{
SetPlayerHealth(i,GetPlayerHealth(i)-3);
}
}
return 1;
}
return 1;
}