Filterscript Problems -
MattyG - 30.10.2014
Hey there, I've not scripted anything in a while, so forgive me for any stupid mistakes.
So, here's the problem: filterscripts do not load properly. Let me show you what I mean.
For example, I have this piece of code in echo.pwn:
pawn Код:
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" echo script");
print("--------------------------------------\n");
return 1;
}
When I load it using "loadfs echo" in the console, I don't get these lines appearing. I also am unable to use any commands. I have this command:
pawn Код:
command(echo, playerid, params[])
{
new string[128], echotxt[128];
if(sscanf(params, "s", echotxt)) return SendClientMessage(playerid, -1, "Usage: /echo [echotext]");
format(string, sizeof(string), "ECHO: %s", params);
SendClientMessage(playerid, -1, string);
return 1;
}
But I just get "Server: Unknown Command". I also get no errors when I compile the script. I'll be really grateful to anyone who can offer any advice or help to this problem. Let me know if you need any more information!
Thanks, Matty.
Re: Filterscript Problems -
Pillhead2007 - 30.10.2014
if its filterscript did you put the filename under filerscripts in server.cfg
Re: Filterscript Problems -
Alex Magaсa - 30.10.2014
- Did you add "
#include <sscanf>" on the bottom of the script under
#include <a_samp>?
- Did you got sscanf plugin + include?
Re: Filterscript Problems -
MattyG - 30.10.2014
I did not put it under there. However, I didn't think that I needed to? When I type "loadfs echo" It does give me:
Код:
Console input: loadfs echo
[11:55:30] Filterscript 'echo.amx' loaded.
I will put it in the server.cfg now-.. I just put it under and it does not help. I get the "Filterscript 'echo.amx' loaded." in the console, but nothing more to do with that filterscript.
Re: Filterscript Problems -
MattyG - 30.10.2014
Quote:
Originally Posted by Alex Magaсa
- Did you add "#include <sscanf>" on the bottom of the script under #include <a_samp>?
- Did you got sscanf plugin + include?
|
Yes, I have both the plugin and include and I have #include <sscanf2>. Like I said, I get no errors when I compile the filterscript.
Re: Filterscript Problems -
Alex Magaсa - 30.10.2014
Quote:
Originally Posted by MattyG
Yes, I have both the plugin and include and I have #include <sscanf2>. Like I said, I get no errors when I compile the filterscript.
|
Did you include zcmd or streamer? im kind confused!
Re: Filterscript Problems -
MattyG - 30.10.2014
Quote:
Originally Posted by Alex Magaсa
Did you include zcmd or streamer? im kind confused!
|
I have at the top of my script:
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
I don't need streamer.
Re: Filterscript Problems -
Pillhead2007 - 30.10.2014
u could try return 0; but I doubt that would work but then again it works in ****** Command YCMD
Re: Filterscript Problems -
MattyG - 30.10.2014
Quote:
Originally Posted by Pillhead2007
u could try return 0; but I doubt that would work but then again it works in ****** Command YCMD
|
Where should I put this return 0;?
Re: Filterscript Problems -
Pillhead2007 - 30.10.2014
on the command(echo, playerid, params) or change this command to command(playerid, params) see if any of them work try return 0 or return 1; see if they work