03.11.2012, 22:24
I made this
I want /as to be in random colors, ServerColors contains 21 colors, what's wrong?
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