SA-MP Forums Archive
IRC stuff, Could someone tell me why this isnt working please? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IRC stuff, Could someone tell me why this isnt working please? (/showthread.php?tid=66518)



IRC stuff, Could someone tell me why this isnt working please? - Outbreak - 22.02.2009

I've got two errors when compiling this, im now sure why...

Could someone tell me what the problem is?

pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    if(pm == true)
    {
        new ircLevel[4];
        new userslist[128];
        new pmstr[128];
        ircGetUserList(RandomBot(), ECHOCHAN, userslist, sizeof(userslist));
        new spaces = CountSpaces(userslist);
        new users[spaces][30]; // LINE WITH ERRORS (1163)
        ircGetUserLevel(RandomBot(), ECHOCHAN, userslist, ircLevel);
        if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1)) return true;
    format(pmstr,128,"5PM from %s (ID:%d) to %s (ID:%d):12 %s",PlayerName(playerid),playerid,PlayerName(recieverid),recieverid,text);
        explain(pmstr);
    }
    return true;
}
Код:
(1163) : error 008: must be a constant expression; assumed zero
(1163) : error 036: empty statement



Re: IRC stuff, Could someone tell me why this isnt working please? - Lazarus - 22.02.2009

pawn Код:
new users[30][spaces]; // LINE WITH ERRORS (1163)



Re: IRC stuff, Could someone tell me why this isnt working please? - Outbreak - 22.02.2009

That gave me two different errors and a warning.

Код:
(1163) : error 008: must be a constant expression; assumed zero
(1163) : error 009: invalid array size (negative, zero or out of bounds)
(1163) : warning 204: symbol is assigned a value that is never used: "users"