SA-MP Forums Archive
Help How to make Unknow 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: Help How to make Unknow Command ? (/showthread.php?tid=597877)



Help How to make Unknow Command ? - michaellong676 - 06.01.2016

hello my friends have set up a dedicated server and I do not know how to show no command line

and enter chat


People can help me show code to show an unknown command ?


Re: Help How to make Unknow Command ? - SickAttack - 06.01.2016

https://sampforum.blast.hk/showthread.php?tid=523806


Re: Help How to make Unknow Command ? - michaellong676 - 06.01.2016

warning : unrecheable code


Re: Help How to make Unknow Command ? - SickAttack - 06.01.2016

Which command processor are you using? The link that I gave you is for ZCMD.

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        SendClientMessage(playerid, COLOR_RED, "Hey, you entered a wrong command!");
    }
    return 1;
}



Re: Help How to make Unknow Command ? - Amunra - 06.01.2016

Wrong
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(
success == 0)
    {
        
SendClientMessage(playerid,0xAA3333AA,"SERVER UNKNOWN COMMAND,Or try to ask admin");
    }
    return 
1;

Edited True
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(
success == 0)
    {
        
SendClientMessage(playerid,0xAA3333AA,"SERVER UNKNOWN COMMAND,Or try to ask admin");
        return 
1;// I Think I Forget to add return 1; Try here
    
}
    return 
1;

Simple !


Re: Help How to make Unknow Command ? - AbyssMorgan - 06.01.2016

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success){
    if(!
success){
        
SendClientMessage(playerid,0xAA3333AA,"SERVER UNKNOWN COMMAND,Or try to ask admin");
        return 
1;
    }
    




Re: Help How to make Unknow Command ? - SickAttack - 06.01.2016

Both of your guys' code do the exact same thing.

pawn Код:
// ** INCLUDES

#include <a_samp>
#include <zcmd>

// ** MAIN

main()
{
    print("Loaded \"custom_unknown_cmd_msg_zcmd.amx\".");
}

// ** CALLBACKS

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        SendClientMessage(playerid, -1, "Hey, you have entered an invalid command!");
    }
    return 1;
}

// ** COMMANDS

CMD:test(playerid, params[])
{
    SendClientMessage(playerid, -1, "You have used /test.");
    return 1;
}