/ashout random colors - 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: /ashout random colors (
/showthread.php?tid=389877)
/ashout random colors -
Shannkz - 03.11.2012
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?
Re: /ashout random colors -
nmader - 03.11.2012
Where is line 32499?
Re: /ashout random colors -
s0nic - 04.11.2012
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))]);