ZCMD Question - +REP
#1

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?
Reply
#2

Код:
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?
Reply
#3

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!
Reply
#4

Код:
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...
Reply
#5

Nice copy from mine...
Reply
#6

+ Rep For you Thank you
Reply
#7

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Nice copy from mine...
Actually mister, you forgot a return there earlier. He just fixed your mistake.
Reply
#8

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)