SA-MP Forums Archive
zcmd QUESTION - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: zcmd QUESTION (/showthread.php?tid=224342)



zcmd QUESTION - park4bmx - 11.02.2011

well you know OnPlayerCommand at the end you can return a custum Message when command is wrong

EXAMPLE
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/blabla",true)==0)
{
//balbla
return 1;
}
new str[128];
format(str, sizeof(str),"Unknown command: \"%s\"",cmdtext[0] );
return SendClientMessage(playerid,COLOR_RED,str);
}
so my QUESTION is can you do that with ZCMD?


Re: zcmd QUESTION - Mean - 11.02.2011

pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    new str[ 128 ];
    format( str, sizeof str,"Unknown command: \"%s\"", cmdtext[0] );
    return SendClientMessage( playerid,COLOR_RED,str );
}
Add it anywhere in the script.
EDIT: Edited something


Re: zcmd QUESTION - park4bmx - 11.02.2011

ohh yhh so that's where it goes thanks man
i just read the ZCMD forum and saw it two but still TNX


Re: zcmd QUESTION - CyNiC - 11.02.2011

Put in your GM:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        SendClientMessage(playerid, 0xFF4040AA, "Error");
    }
    return 1;
}
PS: I don't saw the previous reply.


Re: zcmd QUESTION - [03]Garsino - 11.02.2011

pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    return SendClientMessage(playerid, -1, "Invalid command.");
}
Afaik there's no need to check if it succeed or not.