26.04.2012, 12:49
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float:health;
if(newkeys == KEY_AIM) // This was the error here.
{
if(gTeam[playerid] == TEAM_ZOMBIES)
{
new victimid = GetClosestPlayer(playerid);
GetPlayerHealth(victimid, health);
if(gTeam[victimid] == TEAM_HUMANS)
{
if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
{
SetPlayerHealth(victimid, health - 6.0);
GameTextForPlayer(victimid, "~p~Biten", 1000, 3);
PlayerPlaySound(playerid, 1136, 0, 0, 0);
PlayerPlaySound(victimid, 1136, 0, 0, 0);
}
}
}
}
return 1;
}