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; }
infect_timer[target] = SetTimerEx("infectedtimer", 5000, true, "d", target);
new infect_timer[MAX_PLAYERS]; public OnPlayerDisconnect(playerid, reason) { S_OnPlayerDisconnect(playerid); KillTimer(infect_timer[playerid]); } if ((newkeys & KEY_FIRE) && (team[playerid] == 6)) { new Float: hp, Float: a; new target = GetClosestPlayer(playerid); if (GetDistanceBetweenPlayers(playerid, target) <= 1) { KillTimer(infect_timer[playerid]); // this one 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) { 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.382) { KillTimer(infect_timer[playerid]); } return 1; } |
if (PlayerHasPills(playerid)) return 1;
healthy[playerid] = 1;