gTeam[playerid] - undefined symbol?
#1

Hello,

I am quite new at scripting and strings are new for me. I am wondering why it says [playerid] is an undefined symbol, when i'm using the same if line at other parts of the script, and it works just fine.

pawn Код:
new gTeam[MAX_PLAYERS]; //At top of the script

forward SendGroveMessage(color, string[]);
public SendGroveMessage(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gTeam[playerid] == TEAM_GROVE) // LINE 468
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}
pawn Код:
C:\Users\admin\TDM-server\gamemodes\ZTDM.pwn(468) : error 017: undefined symbol "playerid"
I don't want anyone to script it for me, but I would like to understand what's wrong

Thanks in advance!
Reply
#2

change if(gTeam[playerid] == TEAM_GROVE) to if(gTeam[i] == TEAM_GROVE)

You're using a loop with "i"
Reply
#3

Yeah I just figured out, but thanks anyway! I should probably have browsed the forum better before posting. Repped anyway though!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)