Problem with my antidote timer
#1

I got a problem with my antidote timer the problem is when you do /antidote it runs the "timer" but problem is people around you will loose the infection to and get the message "You ain't infected any more"

/ANTIDOTE COMMAND:
pawn Код:
if (strcmp(cmd, "/antidote", true) == 0)
    {
      if(Antidote[playerid] >= 1)
            {
       if(gTeam[playerid] == TEAM_ZOMBIE)
      {
      SendClientMessage(playerid,COLOR_WHITE,"Your a ZOMBIE! You cannot use a antidote!");
        }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s takes out a package and looks for a syringe.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            format(string, sizeof(string), "* %s takes out the syringe with antidote and injects it into his arm.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SetTimerEx("injectantidote",6000,0,"i",playerid);
            TogglePlayerControllable(playerid,0);
            GameTextForPlayer(playerid, "~b~Injecting antidote", 6000, 3);
      }
      else
      {
      SendClientMessage(playerid,COLOR_RED,"Your antidote syringes is empty! Go search after antidotes!");
        }
      return 1;
     }
AND THE TIMER:
pawn Код:
public injectantidote()
{
   for(new i = 0; i <= MAX_PLAYERS; i++)
  {
            Infected[i] = 0;
            Antidote[i] -= 1;
            TogglePlayerControllable(i,true);
            }
            return 1;
            }
What I want is that the player who does /antidote will only get the message AND the infection away .. Thanks for all help I tried to do Injectionantidote(playerid) and re code the timer to playerid but when I did the /antidote nothing happend .. no unfreeze or infection away..
Thanks for all help I receive!
Reply
#2

SetTimerEx("injectantidote",6000,0,"i",playerid);

forward injectantidote(playerid);
public injectantidote(playerid)
{
Infected[playerid] = 0;
Antidote[playerid] -= 1;
TogglePlayerControllable(playerid,true);
return 1;
}
Reply
#3

Quote:
Originally Posted by Rac3r
SetTimerEx("injectantidote",6000,0,"i",playerid);

forward injectantidote(playerid);
public injectantidote(playerid)
{
Infected[playerid] = 0;
Antidote[playerid] -= 1;
TogglePlayerControllable(playerid,true);
return 1;
}
I did that to but it didn't do anything you were still frozen and infected
Reply
#4

BUMP
Reply
#5

BUMP still no answer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)