14.01.2011, 23:08
i have a timer bug guys pls hlp me to fix it
BUG : 1 some players spawn infected!!
2 whene a zombie atack you !! the infection never stop even if you take the anti pls hlp
thanks for that
Код:
new infect_timer[MAX_PLAYERS];
if((newkeys & KEY_FIRE) && (team[playerid] == 6))
{
new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
infect_timer[playerid] = SetTimerEx("infectedtimer", 5000, true, "d", target);
SetPlayerDrunkLevel (target, 10000);
ApplyAnimation(target,"ped","KO_shot_face",1.1,0,1,1,0,0);
GameTextForPlayer(target,"~r~ Tyrant Hit you !!",3000,1);
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
if(pickupid == anti)
{
new Float:health;
GetPlayerHealth(playerid,health);
KillTimer(infect_timer[playerid]);
if (health < 100)
{
SetPlayerTeam(playerid, 2);
SetPlayerDrunkLevel (playerid, 0);
SetPlayerHealth(playerid, 100.0);
GameTextForPlayer(playerid, "~w~you inject the antidote", 3000, 4);
}
return 1;
}
forward infectedtimer(playerid);
public infectedtimer(playerid)
{
new Float:hp;
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid, hp-5);
if(IsPlayerInRangeOfPoint(playerd, 2, 358.2446,206.3789,1008.3828))
{
KillTimer(infect_timer[playerid]);
}
return 1;
}
2 whene a zombie atack you !! the infection never stop even if you take the anti pls hlp
thanks for that


)