Problem with my antidote timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with my antidote timer (
/showthread.php?tid=130114)
Problem with my antidote timer -
Julian2574 - 25.02.2010
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!
Re: Problem with my antidote timer -
Rac3r - 25.02.2010
SetTimerEx("injectantidote",6000,0,"i",playerid);
forward injectantidote(playerid);
public injectantidote(playerid)
{
Infected[playerid] = 0;
Antidote[playerid] -= 1;
TogglePlayerControllable(playerid,true);
return 1;
}
Re: Problem with my antidote timer -
Julian2574 - 25.02.2010
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
Re: Problem with my antidote timer -
Julian2574 - 25.02.2010
BUMP
Re: Problem with my antidote timer -
Julian2574 - 26.02.2010
BUMP still no answer.