SERVER:Unknown Command
#1

Hello guys, I have a problem with my SA-MP Server Gamemode..
When i type any incorrect command it doesn't give me the default samp 'SERVER:Unknown Command' message.
and it doesn't do anything.
So, I need your help guys.
Thanks
-Biggy
Reply
#2

What command processor do you use?
Reply
#3

Here's a screenshot of my includes folder..

Reply
#4

Do you want a custom Message to be sent to the Player?
Reply
#5

I just want the server to send a message to the player when he/she enters a wrong/incorrect command.
Reply
#6

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "This command doesn't exist.");
    return 1;
}
Like that?
Reply
#7

Alright, where to add this?
Reply
#8

Quote:
Originally Posted by AMouldyLemon
Посмотреть сообщение
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "This command doesn't exist.");
    return 1;
}
Like that?
Where is the return format in your code?I don't see it.
Reply
#9

Quote:
Originally Posted by AMouldyLemon
Посмотреть сообщение
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "This command doesn't exist.");
    return 1;
}
Like that?
Its wrong.


If you are using zcmd, you will use this:

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        new str[256];
        format(str, sizeof(str), "Command %s doesn't exists please /yourcommand for all commands", cmdtext);
        SendClientMessage(playerid, -1, str);
    }
    return 1;
}
Reply
#10

same, everything is cool when i compile it
but when i test this in-game it doesn't respond.(when i type an incorrect command it doesn't give me the text)

this's the all the warnings i get

Код:
warning 203: symbol is never used: "gArmySpawns"
warning 203: symbol is never used: "gMedicalSpawns"
warning 203: symbol is never used: "gPoliceSpawns"
warning 203: symbol is never used: "lastanimid"
warning 203: symbol is never used: "thisanimid"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)