Need help to fix this [+Rep]
#1

pawn Код:
CMD:afklist(playerid)
{
    new str[64];
    if(PlayerInfo[playerid][Admin] < 1) return 0;
    SCM(playerid, -1, ""COL_DORANGE"|__________________ [AFK Players] _________________|");
    foreach(Player, i)
    {
        if(PlayerInfo[i][AFK] == true)
        {
    `       format(str, sizeof(str), " "COL_ORANGE"[%d]%s\n", i, GetName(i)); //Error line
            SCM(playerid, -1, str); //Warning line
        }
    }
    if(!strlen(str)) SCM(playerid, -1, " "COL_ORANGE" No one is afk");
    SCM(playerid, -1, ""COL_DORANGE"|___________________________________________________|");
    return 1;
}
pawn Код:
MyServer [0.3.7]\gamemodes\####.pwn(1948) : error 029: invalid expression, assumed zero
MyServer [0.3.7]\gamemodes\####.pwn(1949) : warning 217: loose indentation
--> SCM defined as SendClientMessage
--> i have this -- new bool:PlayerInfo[MAX_PLAYERS][AFK];
--> COL_ORANGE & COL_DORANGE defined colors
Reply
#2

This: " "COL_ORANGE"[%d]%s\n" is a string in a string. so bassically its expecting this:
" ", col_organge, "[%d]%s\n", blabla

But obviously thats not the right format.
I say, remove the color thus make it: "[%d]%s\n" and send the colourorange in the SCM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)