Unknown Command Help. - 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)
+--- Thread: Unknown Command Help. (
/showthread.php?tid=568845)
Unknown Command Help. -
Brys - 25.03.2015
I've got a basic RP gamemode, i started to add some features on it, but when i write an unknown command, nothing appears, can someone help me to set it giving a text like : Server:Unknown Command, use /help for commands...
Re: Unknown Command Help. -
Toxik - 25.03.2015
add /help command in your script
Put a dialog or SendClientMessage
or whatever command u need for /help
hope i helped you
Re: Unknown Command Help. -
CalvinC - 25.03.2015
Do you use y_commands, OnPlayerCommandText, zcmd or what?
For OnPlayerCommandText, you can add a SendClientMessage after all your commands, like:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/mycommand", true))
{
SendClientMessage(playerid, -1, "This is a command.");
return 1;
}
SendClientMessage(playerid, -1, "You have not entered a command.");
return 1;
}
For zcmd, you can simply use OnPlayerCommandPerformed.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessage(playerid, -1, "You have not entered a command.");
return 1;
}
Re: Unknown Command Help. -
Brys - 25.03.2015
You didn't understood me, when someone write an unknown command like :/testblahblah, i want a text appears for him like : This is unknown command...
you know.
+REP if you help me
Re: Unknown Command Help. -
Brys - 25.03.2015
Thank's ClavinC, i'll try it but i got some problems while compiling,,