Help How to make Unknow Command ?
#1

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 ?
Reply
#2

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

warning : unrecheable code
Reply
#4

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

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 !
Reply
#6

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

Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)