SA-MP Forums Archive
SERVER:Unknown Command - 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)
+--- Thread: SERVER:Unknown Command (/showthread.php?tid=527935)



SERVER:Unknown Command - Biggy54 - 25.07.2014

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


Re: SERVER:Unknown Command - Stinged - 25.07.2014

What command processor do you use?


Re: SERVER:Unknown Command - Biggy54 - 25.07.2014

Here's a screenshot of my includes folder..




Re: SERVER:Unknown Command - AMouldyLemon - 25.07.2014

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


Re: SERVER:Unknown Command - Biggy54 - 25.07.2014

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


Re: SERVER:Unknown Command - AMouldyLemon - 25.07.2014

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


Re: SERVER:Unknown Command - Biggy54 - 25.07.2014

Alright, where to add this?


Re: SERVER:Unknown Command - Sojo12 - 25.07.2014

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.


Re: SERVER:Unknown Command - KayJ - 25.07.2014

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



Re: SERVER:Unknown Command - Biggy54 - 25.07.2014

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"