SA-MP Forums Archive
UNKNOWN CMD ?? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: UNKNOWN CMD ?? (/showthread.php?tid=252827)



UNKNOWN CMD ?? - Venice - 03.05.2011

its say unknown command

pawn Код:
if(strcmp(cmd,"/irc",true)==0){
        {
            if(ircenable==1){
                new tmp[256];
                new message[MAX_STRING];
                tmp = strrest(cmdtext,idx);
                if(!strlen(tmp)){
                    SendClientUsage(playerid, cmd, "[message]");
                    return 1;
                }
                format(message,sizeof(message),"[(ToIRC) %s[%d]: %s]",PlayerName(playerid),playerid,tmp);
                SendClientMessage(playerid,COLOR_ADMIN_SPYREPORT,message);
                for(new i=0;i<MAX_PLAYERS;i++){
                        if(adminlevel[i] > 1) SendClientMessage(i, COLOR_ADMIN_SPYREPORT, message);
                }
                format(message, sizeof(message), "05(ToIRC) %s[%d]: %s]", PlayerName(playerid), playerid, tmp);
                IRC_GroupSay(IRC_Group,EchoChan,message);
                //ircecho("irctalk %d %s %s",playerid,PlayerName(playerid),tmp);
                return 1;
            }
        }
    }



Re: UNKNOWN CMD ?? - SpiderWalk - 03.05.2011

Wait i will try it on my server


Re: UNKNOWN CMD ?? - Calgon - 03.05.2011

The problem is probably:

Quote:

tmp = strrest(cmdtext,idx);

Try use strtok instead.

EDIT: Should've noticed return 1 was in the braces, try indent your code properly in the future.


Re: UNKNOWN CMD ?? - Venice - 03.05.2011

still same


Re: UNKNOWN CMD ?? - [SFA]SpiRRiT - 03.05.2011

The problem is, you must do a "return 1;" at the end of the cmd..


Re: UNKNOWN CMD ?? - [SFA]SpiRRiT - 03.05.2011

Quote:
Originally Posted by venice
Посмотреть сообщение
its say unknown command
This must work:

pawn Код:
#include a_samp

#define MAX_STRING 250      //the, '250' can be set to another value if you want to

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/irc",true)==0)
    {
        if(ircenable==1)
        {
            new tmp[256];
            new message[MAX_STRING];
            tmp = strrest(cmdtext,idx);

            if(!strlen(tmp))
            {
                SendClientUsage(playerid, cmd, "[message]");
                return 1;
            }
            format(message,sizeof(message),"[(ToIRC) %s[%d]: %s]",PlayerName(playerid),playerid,tmp);
            SendClientMessage(playerid,COLOR_ADMIN_SPYREPORT,message);

            for(new i=0;i<MAX_PLAYERS;i++)
            {
                if(adminlevel[i] > 1)
                {
                    SendClientMessage(i, COLOR_ADMIN_SPYREPORT, message);
                }
                return 1;
            }
            format(message, sizeof(message), "05(ToIRC) %s[%d]: %s]", PlayerName(playerid), playerid, tmp);
            IRC_GroupSay(IRC_Group,EchoChan,message);
            //ircecho("irctalk %d %s %s",playerid,PlayerName(playerid),tmp);
            return 1;
        }
        return 1;
    }
    return 1;
}



Re: UNKNOWN CMD ?? - [SFA]SpiRRiT - 03.05.2011

Post on my page, if the error still remains I would be glad to help you!


Re: UNKNOWN CMD ?? - Venice - 03.05.2011

still Same lol


Re: UNKNOWN CMD ?? - xir - 03.05.2011

Do you have zcmd commands?


Re: UNKNOWN CMD ?? - Venice - 03.05.2011

no im not have