/ashout random colors
#1

I made this

pawn Код:
if(strcmp(cmd, "/ashout", true) == 0 || strcmp(cmd, "/as", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                    return 1;
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: (/as)hout [local chat]");
                    return 1;
                }
                new y,m,d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s (/as chat): %s",d,m,y,h,mi,s, sendername, result);
                ChatLog(string);
                format(string, sizeof(string), "Admin %s Shouts: %s!!", sendername, result);
                ProxDetector(30.0, playerid, ServerColors[random(sizeof(ServerColors))]);
                printf("%s", string);
            }
        }
        return 1;
    }
Код:
gf3b.pwn(32499) : warning 202: number of arguments does not match definition
I want /as to be in random colors, ServerColors contains 21 colors, what's wrong?
Reply
#2

Where is line 32499?
Reply
#3

You didn't finish filling in the function, it was even missing the formatted string to send out.
Give this a try:
pawn Код:
ProxDetector(30.0, playerid, string, ServerColors[random(sizeof(ServerColors))], ServerColors[random(sizeof(ServerColors))], ServerColors[random(sizeof(ServerColors))], ServerColors[random(sizeof(ServerColors))], ServerColors[random(sizeof(ServerColors))]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)