25.02.2010, 12:17
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:
AND THE TIMER:
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!
/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;
}
pawn Код:
public injectantidote()
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
Infected[i] = 0;
Antidote[i] -= 1;
TogglePlayerControllable(i,true);
}
return 1;
}
Thanks for all help I receive!