announce command
#1

Ok i've the announce command,but i've a strange error:

Код:
error 021: symbol already defined: "cmd"
Code:

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;
    }
If i remove the cmd,i got "Undefenied symbol"..wtf...
Reply


Messages In This Thread
announce command - by Face9000 - 21.12.2010, 14:27
Re: announce command - by blackwave - 21.12.2010, 14:30
Re: announce command - by Face9000 - 21.12.2010, 14:31
Re: announce command - by blackwave - 21.12.2010, 14:35
Re: announce command - by Face9000 - 21.12.2010, 14:36
Re: announce command - by iggy1 - 21.12.2010, 14:38
Re: announce command - by Face9000 - 21.12.2010, 14:38
Re: announce command - by blackwave - 21.12.2010, 14:39
Re: announce command - by Face9000 - 21.12.2010, 14:40
Re: announce command - by iggy1 - 21.12.2010, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)