[HELP] 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: [HELP] COmmand (
/showthread.php?tid=109263)
[HELP] COmmand -
Lilcuete - 18.11.2009
Ok how can i make a Command so when they type in a command thats not in my server instead of Unknow command i want it to say
SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
Thanks please tell me
Re: [HELP] COmmand -
Correlli - 18.11.2009
Look for the 'return 0':
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// your commands.
return 0;
}
and replace it with your message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// your commands.
return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}
Re: [HELP] COmmand -
Lilcuete - 18.11.2009
No like if they type a command in thats not in my gm instead of it saying Unkown command i want it to say public // your commands.
return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}
Re: [HELP] COmmand -
Correlli - 18.11.2009
I already gave you the code which you're looking for.
Re: [HELP] COmmand -
Lilcuete - 18.11.2009
Ok so i put it at the end of my commands?
Re: [HELP] COmmand -
Correlli - 18.11.2009
Yes.
Re: [HELP] COmmand -
Lilcuete - 18.11.2009
ok i did dat but when i type a command and its there its says Sorry command not found in Database but it works the command
Re: [HELP] COmmand -
Correlli - 18.11.2009
I guess you didn't understand it.
Here's another example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/mycommand_1", true) == 0)
{
// command's code.
return 1;
}
if(strcmp(cmdtext, "/mycommand_2", true) == 0)
{
// command's code.
return 1;
}
if(strcmp(cmdtext, "/mycommand_3", true) == 0)
{
// command's code.
return 1;
}
return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}