SA-MP Forums Archive
[UNSOLVED] I realy need 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [UNSOLVED] I realy need help (/showthread.php?tid=106363)



[UNSOLVED] I realy need help - Pinehole - 02.11.2009

solved


Re: I realy need help - MadeMan - 02.11.2009

pawn Код:
if (strcmp("/help", cmdtext, true, 10) == 0)
Try removing that 10 from all commands.

pawn Код:
if (strcmp("/help", cmdtext, true) == 0)



Re: I realy need help - Pinehole - 02.11.2009

solved


Re: I realy need help - MadeMan - 02.11.2009

Do you use any filterscripts?


Re: I realy need help - Pinehole - 02.11.2009

solved


Re: I realy need help - MadeMan - 02.11.2009

Quote:
Originally Posted by Pinehole
Yep, but i dont think it's the problem. someone please help
It is.

Put return 0; at the end of all your filterscripts OnPlayerCommandText to fix it.


Re: I realy need help - Pinehole - 02.11.2009

I tested it with no filterscripts, and all my filterscripts were return 0 at the end, it isn't the problem
it has to do something with my gamemode, someome help me


Re: [UNSOLVED] I realy need help - Sergei - 02.11.2009

Uh, you will have pretty much to edit. You are doing it all wrong. Use 'return 0' only at the bottom of the OnPlayerCommandText callback. On all other places use 'return 1' otherwise it shows Unknown Command message:

Example how it should work:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp("/something",cmdtext,true))
  {
    //do something
    return 1;
  }
  if(!strcmp("/someelse",cmdtext,true))
  {
    //do something else
    return 1;
  }
  return 0;
}
Oh and consider using zcmd instead of strcmp, it's easier and faster


Re: [UNSOLVED] I realy need help - Pinehole - 02.11.2009

solved



Re: [UNSOLVED] I realy need help - Sergei - 02.11.2009

You are doing it wrong then.