ZCMD Question - +REP -
Aira - 20.03.2012
ALright, so i'm using ZCMD now.. My question is, how can i change "Server Unkown Command to something?
Like, for strcmp its this
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
SendClientMessage(playerid, RED,"[VG:TDM] Unkown Command, - /cmds for the list of Player Commands");
return 1;
}
So how?
Re: ZCMD Question - +REP -
_Shade. - 20.03.2012
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
if(success == 0) return SendClientMessage(playerid,0xA70000FF,"Command was not found.");
return true;
}
Is this what you're looking for?
Re: ZCMD Question - +REP -
Twisted_Insane - 20.03.2012
Lol, that's not clean! And I'm not sure if this will work! But MINE will work for 100%...
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[128];
format(string, sizeof(string), "Command %s doesn't exist, please type /help for all the available commands!", cmdtext);
SendClientMessage(playerid, -1, string);
}
}
Add it outside ANY callback you got!
Re: ZCMD Question - +REP -
legodude - 20.03.2012
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
if(success == 0){
new str[128];
format(str,sizeof(str),"[VG:TDM] Command '%s' doesnt exist, - /cmds for the list of Player Commands",cmdtext);
return SendClientMessage(playerid,RED,str);
}
return true;
}
is better imho, it is more clarified
E:\
ninja'd...
Re: ZCMD Question - +REP -
Twisted_Insane - 20.03.2012
Nice copy from mine...
Re: ZCMD Question - +REP -
Aira - 20.03.2012
+ Rep For you

Thank you
Re: ZCMD Question - +REP -
_Shade. - 20.03.2012
Quote:
Originally Posted by Twisted_Insane
Nice copy from mine...
|
Actually mister, you forgot a return there earlier. He just fixed your mistake.
Re: ZCMD Question - +REP -
Twisted_Insane - 20.03.2012
It isn't necessary here, I just tested it and it worked, that's why I told him that it'll work for 100 percent!
Well, if it won't work for him:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[128];
format(string, sizeof(string), "Command %s doesn't exist, please type /help for all the available commands!", cmdtext);
SendClientMessage(playerid, -1, string);
}
return 1;
}