error 021: symbol already defined: "SetTimer"
#1

I am getting this error: C:\Users\Thomas\Desktop\gates.pwn(10) : error 021: symbol already defined: "SetTimer"
when trying to compile my automatic gate.

Code:
PHP код:
new mygate;
SetTimer("CheckGate"1000true);
forward CheckGate();
public 
CheckGate()
{
    new 
mygate_status;
    for(new 
i;i<MAX_PLAYERS;i++)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(
IsPlayerInRangeOfPoint(i,10.0,1119.30004883,-1161.19995117,24.29999924))mygate_status=1;
    }
    if(
mygate_status)MoveObject(mygate1139.30004883,-1161.19995117,24.29999924,2);
    else 
MoveObject(mygate1119.30004883,-1161.19995117,24.299999242);
}
#endif 
Reply
#2

where is ur settimer function located (callback?)
Reply
#3

You need to use SetTimer in a callback, not a random place in the script. I assume from the code you want a repeating timer. You should start the timer in OnGameModeInit.
Reply


Forum Jump:


Users browsing this thread: