SA-MP Forums Archive
Need help to fix this [+Rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help to fix this [+Rep] (/showthread.php?tid=581076)



Need help to fix this [+Rep] - FailerZ - 10.07.2015

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


Re: Need help to fix this [+Rep] - notime - 10.07.2015

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.