Bite key
#2

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;
}
Reply


Messages In This Thread
Bite key - by Deaglez - 23.07.2012, 12:23
Re: Bite key - by Matz - 23.07.2012, 12:35
Re: Bite key - by LaGrande - 23.07.2012, 12:42
Re: Bite key - by Rudy_ - 23.07.2012, 12:44
Re: Bite key - by Deaglez - 23.07.2012, 13:20

Forum Jump:


Users browsing this thread: 1 Guest(s)