SA-MP Forums Archive
need help wich servar command - 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: need help wich servar command (/showthread.php?tid=213062)



need help wich servar command - doreto - 18.01.2011

if someone know pls to tell me if someone wrong command to show on chat example wrong command use/cmds


Re: need help wich servar command - Kase - 18.01.2011

Do you mean it should show command's correct usage?


Re: need help wich servar command - Alex_Valde - 18.01.2011

If you use ZCMD command processor there is a function called OnPlayerCommandPerformed(...)

Just add it to your script.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, YourColor,"wrong command use/cmds";
    return 1;
}
If you don't use ZCMD don't even try it 'cause it won't work.


Re: need help wich servar command - doreto - 18.01.2011

lol cant found
Quote:

(1456) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandPerformed")




Re: need help wich servar command - Alex_Valde - 18.01.2011

Quote:
Originally Posted by doreto
Посмотреть сообщение
lol cant found
Do you use ZCMD?


Re: need help wich servar command - doreto - 18.01.2011

Quote:

Do you use ZCMD?

what is ZCMD ? i use pawn


Re: need help wich servar command - Kase - 18.01.2011

ZCMD is a command system for pawn.

Anyways, what do you exactly want?


Re: need help wich servar command - doreto - 18.01.2011

if someone wrong command to show on chat example wrong command use/cmds


Re: need help wich servar command - Alex_Valde - 18.01.2011

Quote:
Originally Posted by Kase
Посмотреть сообщение
ZCMD is a command system for pawn.

Anyways, what do you exactly want?
He means that if someone writes some non existing command, this will SendClientMessage(playerid,0xFF0000FF,"wrong command use/cmds");

Anyways you can do it like this. (Or just try it - I'm not sure).

Where's your OnPlayerCommandText callback.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}
And now just change this return 0; to return SendClientMessage(playerid,0xFF0000FF,"wrong command use/cmds");


Re: need help wich servar command - BlackWolf120 - 18.01.2011

replace the return 0; at the end of OnPlayerCommandText
with:

pawn Код:
SendClientMessage(playerid, 0xAA3333AA,"This command doesn't exist! Use /cmd");
return 1;
}
//Ah, already said