Commands 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: Commands help. (
/showthread.php?tid=364892)
Commands help. -
xSkullx - 01.08.2012
Hi everybody, i enter on server and type every cmd (from OnPlayerCommandText, other ones works) and it says me
Код:
SERVER: Unknown Command.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
....commands....
return 0;
}
Re: Commands help. -
RedJohn - 01.08.2012
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
....commands....
return 1;
}
If you want to stop
SERVER: Unknown Command. If you enter wrong command, nothing will happen.
Re: Commands help. -
Cxnnor - 01.08.2012
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// Bla bla
return 1;
}
Only use return 0; at the end of the call back, like your last command, for example:
pawn Код:
if(strcmp(cmdtext, "/command",true))
{
// Bla bla
return 1;
}
else if(!strcmp(cmdtext, "/command", true))
{
// Bla bla
return 1;
}
return 0;
}
Re: Commands help. -
xSkullx - 01.08.2012
thats what i use :/
Re: Commands help. -
Devilxz97 - 01.08.2012
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/command", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 1;
}
Re: Commands help. -
ZBits - 01.08.2012
do you use any other command processor?
if yes convert all strcmp to your command processor
+rep if i helped
Re: Commands help. -
farCry.xD - 01.08.2012
Show me what you have at includes xD
Re: Commands help. -
xSkullx - 01.08.2012
Код:
#include < a_samp >
#include < streamer >
#include < zcmd >
#include < sscanf >
return 0, return 1. Same shit.
Re: Commands help. -
xSkullx - 01.08.2012
Quote:
Originally Posted by Domnic Toretto
do you use any other command processor?
if yes convert all strcmp to your command processor
+rep if i helped
|
I don't use other, just this.
Re: Commands help. -
farCry.xD - 01.08.2012
Remove #include zcmd ..
If you don't use it..
You can't use strcmp and zcmd in the same script !
Just dcmd and strcmp !