Filterscript Problems
#1

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.
Reply
#2

if its filterscript did you put the filename under filerscripts in server.cfg
Reply
#3

- Did you add "#include <sscanf>" on the bottom of the script under #include <a_samp>?
- Did you got sscanf plugin + include?
Reply
#4

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.
Reply
#5

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.
Reply
#6

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!
Reply
#7

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.
Reply
#8

u could try return 0; but I doubt that would work but then again it works in ****** Command YCMD
Reply
#9

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;?
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)