PDA

View Full Version : Help Unknow command


kalanerik99
16/03/2013, 03:25 PM
Hi

Can someone tell me how to make if player will type unknown command it will show him "Unknown command type /c for commands"

Patrick
16/03/2013, 03:28 PM
show us the code?

Krakuski
16/03/2013, 03:31 PM
public OnPlayerCommandText(playerid,cmdtext[])
{
//What ever you commands are go here
return 1;
//Return 0 returns the message
return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}

kalanerik99
16/03/2013, 03:32 PM
i want if player will type unknown command it will send him the message: Unknown command type /c for commands"

kamzaf
16/03/2013, 03:34 PM
i want if player will type unknown command it will send him the message: Unknown command type /c for commands"


public OnPlayerCommandText(playerid, cmdtext[])
{
return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}

kalanerik99
16/03/2013, 05:20 PM
but how can I do that in zcmd

Patrick
16/03/2013, 05:21 PM
Here you go

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}
return 1;
}

kamzaf
16/03/2013, 05:28 PM
Here you go

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}
return 1;
}

that wont work.

you have to forward it first:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success)
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");

}