24.06.2012, 13:28
Hello,
I wanna make a timer for zombies, that if they just used ALT to bite someone they have to wait 30 secs.
Anyone can help me with that timer?
I wanna make a timer for zombies, that if they just used ALT to bite someone they have to wait 30 secs.
pawn Код:
new NearestPlayer = GetClosestPlayer(playerid);
if(newkeys & KEY_WALK)
{
if(Player[playerid][Zombie] == 1)
{
if(GetDistanceBetweenPlayers(NearestPlayer, playerid) < 4)
{
if(Player[NearestPlayer][Infected] == 0)
{
Player[NearestPlayer][Infected] = 1;
}
else if(Player[NearestPlayer][Infected] == 1)
{
Player[NearestPlayer][Zombie] = 1;
Player[NearestPlayer][Human] = 0;
Player[NearestPlayer][Infected] = 0;
}
}
else
{
GameTextForPlayer(playerid, "~w~There is no one nearby!", 3500, 3);
}
}
}