[Help]Undefined symbol "i"
#1

Title says it all, Please can someone help me fix this..I'll be very appreciative, Thank you.


Code
pawn Код:
CMD:sendmessagetcops(playerid, params[])
{
    for(new i=0; i <= MAX_PLAYERS; i++);
    {
        if(IsPlayerConnected(i))
        {
            if(pTeam[i] == TEAM_LSPD)
            {
                SendClientMessage(i, COLOR_BLUE, "A Message was sent to all online officers online");
            }
        }
    }
}
ERRORS
Код:
C:\Users\Parent\Desktop\Server\gamemodes\newtdm.pwn(246) : warning 215: expression has no effect
C:\Users\Parent\Desktop\Server\gamemodes\newtdm.pwn(266) : error 036: empty statement
C:\Users\Parent\Desktop\Server\gamemodes\newtdm.pwn(268) : error 017: undefined symbol "i"
C:\Users\Parent\Desktop\Server\gamemodes\newtdm.pwn(270) : error 017: undefined symbol "i"
C:\Users\Parent\Desktop\Server\gamemodes\newtdm.pwn(272) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
for(new i=0; i <= MAX_PLAYERS; i++);// <- ; isnt used in conditions!
Reply
#3

pawn Код:
for(new i=0; i <= MAX_PLAYERS; i++);
You dont need the ';' at the end of the for(). Otherwise you tell the compiler to close it, and after that youre opening it again
Reply
#4

try this
Код:
CMD:sendmessagetcops(playerid, params[])
{
        if(IsPlayerConnected(playerid))
        {
            if(pTeam[playerid] == TEAM_LSPD)
            {
                SendClientMessage(playerid, COLOR_BLUE, "A Message was sent to all online officers online");
            }
        }
    }
}
Reply
#5

random123 - fail
pawn Код:
CMD:sendmessagetcops(playerid, params[])
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(pTeam[i] == TEAM_LSPD)
            {
                SendClientMessage(i, COLOR_BLUE, "A Message was sent to all online officers online");
            }
        }
    }
}
Reply
#6

Woaah yeah he fail, The message would go to self.
Reply
#7

Edit: NVM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)