Unknown 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)
+--- Thread: Unknown Command (
/showthread.php?tid=486116)
Unknown Command -
[SU]Spartan - 07.01.2014
Hello,
I've made SOME cmds with STRCMP because ZCMD doesnt load to me,I went IG to test them and they said"Unknown Command"
Re: Unknown Command -
Voxel - 07.01.2014
Make sure it returns 1;
example using ZCMD (regular strcmp is the same)
pawn Код:
CMD:example(playeris, params[])
{
SendClientMessage(playerid, -1, "This is a example");
return 1;//add this
}
if I remember correctly with strcmp command you need to do return 1; and return 0; at the last bracket aswell.
example from samp wiki:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;//returning 1 for each command code
}
if(!strcmp(cmdtext, "/example", true, 3)) //our zcmd command in strcmp
{
SendClientMessage(playerid, -1, "This is a example");
return 1;//returning 1 for each command code
}
return 0;//returning 0 for the last bracket
}
Re: Unknown Command -
offon - 07.01.2014
Could you post the code, please?