Bite key
#3

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_FIRE)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            new Float:x, Float:y, Float:z,name[24],str[128];
            GetPlayerPos(i, x, y, z);
            GetPlayerName(playerid,name,24);
            if(IsPlayerInRangeOfPoint(playerid,5,x,y,z))
            {
                format(str,sizeof(str),"Zombie %s has bitten you",name);
                SendClientMessage(i,-1,str);
                SetPlayerHealth(i,-50);

            }
            return 1;
        }
    }
    return 1;
}
just an example, u can modify it,
when the fire key is pressed and any player is near zombie then he will loose -50 health
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: 2 Guest(s)