Help Wrong Command
#1

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

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
Reply
#3

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.");

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)