Getting 1 Errore Whent compiling pawno
#1

PHP код:
C:\Documents and Settings\Scample\Desktop\New Folder (8)\gamemodes\Private.pwn(22962) : error 001expected token";"but found "for" 
the Pawn Code
pawn Код:
CMD:tplist(playerid, params[])
{
    #pragma unused params
    new
        count = 0,
        h,
        m,
        tmp[128],
        string[800];
    new player1 = strval(tmp)
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if( PlayerInfo[playerid][Trusted]>= 1)
            {
                format(string, 500, "%s[ID:%i]| Score: %d | Hours: %d |Mins: %d", PlayerName2(i),i,GetPlayerScore(player1),h,m);
                //We are appending the string, so put %s before any new data is added,
                //and that parameter actually refers to the string itself.
                count++;
            }
        }
    }
    if (count == 0) ShowPlayerDialog(playerid, 806, DIALOG_STYLE_MSGBOX, "{FF0000}=™Online Trusted Player™=", "No Trusted player Currently Online", "Ok", "");
    else ShowPlayerDialog(playerid, 806, DIALOG_STYLE_MSGBOX, "{FF0000}=™Online Trusted Player™=", string, "Ok", "");
    return 1;
}
Can anyone help i try alot of thing
Reply
#2

On which line?
Reply
#3

for(new i = 0; i < MAX_PLAYERS; i++)
Reply
#4

If You cant can you do a command just same same mine

Reply
#5

pawn Код:
new player1 = strval(tmp);
You forget ;
Reply
#6

try this

Код:
for(new i = 0, i < MAX_PLAYERS; i++)
u typed ';' instead of ','
Reply
#7

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
try this

Код:
for(new i = 0, i < MAX_PLAYERS; i++)
u typed ';' instead of ','
No he looped it correct. You're doing that wrong. You are telling the compiler that there are more variables after i = 0. Using a colon is used for variable initialization.
Reply
#8

IZN can you fix my command for my ?
Reply
#9

Quote:
Originally Posted by donhu789
Посмотреть сообщение
IZN can you fix my command for my ?
Did you read my above reply?
Reply
#10

Код:
 for(new i = 0; i < MAX_PLAYERS; i++)
That should work
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)