SA-MP Forums Archive
[Tutorial] [TUT] How to add a message when the command is wrong - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] How to add a message when the command is wrong (/showthread.php?tid=129740)

Pages: 1 2


Re: [TUT] How to add a message when the command is wrong - ShockDM - 16.07.2010

It's
return SendClientMessage(playerid, COLOR_ORANGE, "Command does not exist please use /help");

you need one S more in Message =D


Re: [TUT] How to add a message when the command is wrong - DRIFT_HUNTER - 25.07.2010

for zcmd.....
Just add these somewhere in GM

Code:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    return 	SendClientMessage(playerid, 0xFF0000FF, "Wrong command?USE /HELP");
}
Hope its helped and i use zcmd+sscanf


Re: [TUT] How to add a message when the command is wrong - CSMajor - 29.07.2010

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
if(!GetPlayerMoney(playerid) => 500) return SendClientMessage(playerid, COLOR_RACE, "You don't have enough $ to heal.");
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, COLOR_RACE, "Healed for 500$.");
SetPlayerHealth(playerid, 100);
return 1;
}

return SendClientMesage(playerid, COLOR_ORANGE, "Command does not exist please use /help");
}
Yoan try this ok, it might work.


Re: [TUT] How to add a message when the command is wrong - John_F - 29.07.2010

Quote:
Originally Posted by Thebest96
View Post
N00b tuturial dont helped in nothing, ohhh helped in CRASH MY SCRIPT!
Then you fail because this works fine.


Re: [TUT] How to add a message when the command is wrong - GaGlets(R) - 29.07.2010

this suc*s my a**..

Tell something for zcmd`s?


Re: [TUT] How to add a message when the command is wrong - TuTu89 - 07.09.2010

at the end of "public onplayercommandtext" I have return 1, no return 0

/imageshack/i/62629366.png/

/imageshack/i/49390728.png/


Re: [TUT] How to add a message when the command is wrong - Scenario - 07.09.2010

ZCMD has 2 callbacks which could be used for returning an incorrect command message.

pawn Code:
OnPlayerCommandPerformed(...) and OnPlayerCommandReceived(...)



Re: [TUT] How to add a message when the command is wrong - Nat_Pagle - 22.02.2011

He wrote SendClientMesage
Instead of SendClientMessage

Only problem I received.


Re: [TUT] How to add a message when the command is wrong - alpha500delta - 22.02.2011

There's already a tutorial like this...


Re: [TUT] How to add a message when the command is wrong - [M.A]Angel[M.A] - 02.03.2011

Quote:
Originally Posted by yoan103
View Post
OK but does it work for the people that are using normal commands?
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RACE, "You don't have enough $ to heal.");
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, COLOR_RACE, "Healed for 500$.");
SetPlayerHealth(playerid, 100);
return 1;
}

return SendClientMesage(playerid, COLOR_ORANGE, "Command does not exist please use /help");
}
You can also add this messege down so you add it at every cmd :S