21.12.2010, 14:27
Ok i've the announce command,but i've a strange error:
Code:
If i remove the cmd,i got "Undefenied symbol"..wtf...
Код:
error 021: symbol already defined: "cmd"
pawn Код:
new sendername[24];
new cmd[35];
new idx;
new tmp[35];
if(strcmp(cmd, "/ann", true) == 0)
{
if(PlayerInfo[playerid][AdminLevel] > 2)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new result[128];
result = bigstrtok(cmdtext, idx);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /ann [message] [time in seconds(if non entered, 5 seconds will be the time by default)]");
return 1;
}
new timexx;
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) timexx = 5;
else timexx = strval(tmp);
new string[128];
format(string, sizeof(string), "~w~%s", result);
new str[128];
format(str,sizeof str,"0,13INGAME announce from %s : %s",(sendername), result);
IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
GameTextForAll(string, timexx*1000, 4);
printf("%s", string);
}
else SendClientMessage(playerid, COLOR_RED, "You cannot use this command!");
return 1;
}