UNKNOWN CMD ??
#1

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;
            }
        }
    }
Reply
#2

Wait i will try it on my server
Reply
#3

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.
Reply
#4

still same
Reply
#5

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

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;
}
Reply
#7

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

still Same lol
Reply
#9

Do you have zcmd commands?
Reply
#10

no im not have
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)