PDA

View Full Version : Help How to make Unknow Command ?


michaellong676
06/01/2016, 04:58 AM
hello my friends have set up a dedicated server and I do not know how to show no command line
http://www.upsieutoc.com/images/2016/01/06/sa-mp-000c2dc6.png
and enter chat
http://www.upsieutoc.com/images/2016/01/06/sa-mp-001c88f8.png

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

SickAttack
06/01/2016, 05:19 AM
http://forum.sa-mp.com/showthread.php?t=523806

michaellong676
06/01/2016, 05:36 AM
warning : unrecheable code

SickAttack
06/01/2016, 05:41 AM
Which command processor are you using? The link that I gave you is for ZCMD.

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

Amunra
06/01/2016, 05:58 AM
Wrong
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
{
SendClientMessage(playerid,0xAA3333AA,"SERVER UNKNOWN COMMAND,Or try to ask admin");
}
return 1;
}
Edited True
public OnPlayerCommandPerformed(playerid, cmdtext[], 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 !

AbyssMorgan
06/01/2016, 06:13 AM
public OnPlayerCommandPerformed(playerid, cmdtext[], success){

if(!success){
SendClientMessage(playerid,0xAA3333AA,"SERVER UNKNOWN COMMAND,Or try to ask admin");
return 1;
}

}

SickAttack
06/01/2016, 06:42 AM
Both of your guys' code do the exact same thing.

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