error 021: symbol already defined: "SetTimerEx" - 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)
+--- Thread: error 021: symbol already defined: "SetTimerEx" (
/showthread.php?tid=505002)
error 021: symbol already defined: "SetTimerEx" -
Slicebook - 06.04.2014
Code:
D:\Mбtй kйpei\RPG\26febrmof\icerpg.pwn(2125) : error 021: symbol already defined: "SetTimerEx"
D:\Mбtй kйpei\RPG\26febrmof\icerpg.pwn(2129) : error 010: invalid function or declaration
Code:
forward GyogyszerTimer(playerid);
forward PihenoTimer(playerid);
new Piheno[MAX_PLAYERS] = 0;
new GyogyszerVar[MAX_PLAYERS] = 0;
Code:
else if( dialogid == DIALOG_TASKA4 )
{
if( !response )
{
return 1;
}
if( listitem == 0)
{
if(PlayerInfo[playerid][pOrvossag] < 1) return Msg(playerid,"Nincs nбlad orvossбg!");
}
else
{
if(Piheno[playerid] == 1) return SendClientMessage(playerid, -1, "(( Mбr vettйl be gyуgyszert! ))");
else
{
if(GyogyszerVar[playerid] == 1) SendClientMessage(playerid, -1, "Mбr bбnyбszol, kйrlek vбrj!");
else
{
SetTimerEx("GyogyszerTimer", 0, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
}
}
}
}
Code:
public GyogyszerTimer(playerid)
{
Gyogyszer(playerid,"gyуgyszert",0,40.0);
PlayerInfo[playerid][pOrvossag] --;
}
SetTimerEx("PihenoTimer", 60000, false, "i", playerid); <<<<<ERROR
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
Piheno[playerid] = 1;
return 1; <<<<ERROR
}
public PihenoTimer(playerid)
{
Piheno[playerid] = 60000;
SendClientMessage(playerid, -1, "(( Mostmбr vehetsz be egy gyуgyszert. ))");
return 1;
}
Re: error 021: symbol already defined: "SetTimerEx" -
Konstantinos - 06.04.2014
In GyogyszerTimer callback, remove the closed bracket "}" above SetTimerEx. You cannot initialize with the way you did in arrays.
That would be:
pawn Code:
new Piheno[MAX_PLAYERS] = {0, ...};
new GyogyszerVar[MAX_PLAYERS] = {0, ...};
but that's pointless because they're already 0. So don't forget them to reset them in OnPlayerConnect callback:
pawn Code:
new Piheno[playerid] = 0;
new GyogyszerVar[playerid] = 0;
Re: error 021: symbol already defined: "SetTimerEx" -
Slicebook - 06.04.2014
okey works ,thanks