SA-MP Forums Archive
Help Wrong 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 Wrong Command (/showthread.php?tid=584597)



Help Wrong Command - Hazliu - 06.08.2015

How i can put the message "[Server] That command dosn't exist" if command dosn't exist?


Re: Help Wrong Command - MrSwift - 06.08.2015

Quote:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)//callback from #include <zcmd>
{//open
if(!success)//If the command does not exist on the server, ! = false
return SendClientMessage(playerid, COLOR_WHITE, "[Server] That command dosn't exist.");//showing the message
return 1;
}//close

Credits to Patrick


ps you need zcmd


Re: Help Wrong Command - MarvinPWN - 06.08.2015

At the end of the callback OnPlayerCommandText you have to return this message.
Look here:
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext,"/car",true))
    {
        new 
Float:x,Float:y,Float:z;
        
GetPlayerPos(playerid,x,y,z);
        
CreateVehicle(560,x+2,y,z,0,99,99,-1,0);
        return 
1;
    }
    return 
SendClientMessage(playeridCOLOR_WHITE"[Server] That command dosn't exist.");