%s unkown command
#1

Hello friends,my request code player use command and command not mode should "%s not command" thank you.
Reply
#2

are you using OnPlayerCommandText?
Reply
#3

Yeah.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/ban", cmdtext, true))
    {
        if(IsPlayerAdmin(playerid))
        {
            new id;
            if(sscanf(cmdtext, "r", id)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /ban <playerid/partofname>");
            if(IsPlayerAdmin(id)) return SendClientMessage(playerid, 0xCC0000AA, "You can't ban admins!");
           
            new str[128], name[MAX_PLAYER_NAME], bname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            GetPlayerName(id, bname, sizeof(bname));
            format(str,sizeof(str), "%s[%d] has banned %s[%d]", name, playerid, bname, id);
            SendClientMessageToAll(0xCC0000AA, str);
            BanEx(id, str);
           
        }
        return 1;
    }
    return SendClientMessage(playerid, 0xCC0000AA, "Invalid Command."); //this should work
}
Reply
#5

Not my request example player use /aasadasdasd and not command message: "/aasadasdasd" not command okey ?
Reply
#6

Quote:
Originally Posted by rido1998
Посмотреть сообщение
Not my request search my request use command name example player use /aasadasdasd and not command message: "/aasadasdasd" not command okey ?
what
Reply
#7

oh i know what he mean when he use a command he want to announce to everyone
Reply
#8

Not topic post.
Reply
#9

He means that if you type an invalid command (such as /hi, and there's no such command) it says "/hi is not a valid command".
Reply
#10

pawn Код:
new str[128];
format(str,sizeof(str), "%s is not a valid command!", cmdtext);
return SendClientMessage(playerid, 0xCC0000AA, str);
What about this?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)