ZCMD only works in 1 filterscript
#1

Whenever I have a zcmd use in more than 1 filterscript file, the first filterscript that loads with a zcmd renders the next file useless, because it stops any command in the other filterscript. How do I fix this?\

ex. in my server.cfg "filterscripts acmd admin jug veh" when I try to use an "admin" filterscript command in game, nothing happens. No Server Unknown Command or nothing. but when I use "acmd" filterscript command it works.
Why is this? How do I fix it it's annoying and took me 4 hours to figure out the problem

I even tried doing this

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>

CMD:test(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"It Works!");
return 1;
}
then I made another filter script

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>

CMD:mother(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"Your Mom!");
return 1;
}
I loaded both filterscripts but when I went in game none of the cmds work.
Reply
#2

Quote:
Originally Posted by doodlebob666
Посмотреть сообщение
Whenever I have a zcmd use in more than 1 filterscript file, the first filterscript that loads with a zcmd renders the next file useless, because it stops any command in the other filterscript. How do I fix this?\

ex. in my server.cfg "filterscripts acmd admin jug veh" when I try to use an "admin" filterscript command in game, nothing happens. No Server Unknown Command or nothing. but when I use "acmd" filterscript command it works.
Why is this? How do I fix it it's annoying and took me 4 hours to figure out the problem

I even tried doing this

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>

CMD:test(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"It Works!");
return 1;
}
then I made another filter script

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>

CMD:mother(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"Your Mom!");
return 1;
}
I loaded both filterscripts but when I went in game none of the cmds work.
add public OnFilterScriptInit()
and
OnFilterScriptExit()
Reply
#3

Quote:
Originally Posted by ProScripter
Посмотреть сообщение
add public OnFilterScriptInit()
and
OnFilterScriptExit()
I tried and it does nothing to help. I put ScriptInt at the top and ScriptExit at the bottom of the script
Reply
#4

Do you use OnPlayerCommandReceived in the first script?
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Do you use OnPlayerCommandReceived in the first script?
no, the only thing I use if onfilterscriptint, onfilterscriptexit, and zcmd. All my includes are there.
Reply
#6

u're getting any error? like SERVER: Uknown Command!
Reply
#7

Quote:
Originally Posted by Mugala
Посмотреть сообщение
u're getting any error? like SERVER: Uknown Command!
I said no
Reply
#8

Код:
CMD:test(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"It Works!");
return 1;
}
what is the use of params in this command? Try removing that in commands were params isn't used!
By the way , a warning should have appeared that params isn't used. haven't it?
Reply
#9

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
CMD:test(playerid,params[]){
SendClientMessage(playerid,0x00FFFFFF,"It Works!");
return 1;
}
what is the use of params in this command? Try removing that in commands were params isn't used!
By the way , a warning should have appeared that params isn't used. haven't it?
no warnings from pawno when I compile it. I thought that's just how you're supposed to use zcmd

here's more code from another file i downloaded which shows how params[] is used.

pawn Код:
CMD:kill(playerid, params[])
{
    SetPlayerHealth(playerid, 0);
    return 1;
}
// heal command
CMD:heal(playerid, params[])
{
    SetPlayerHealth(playerid, 100.0);
    SetPlayerArmour(playerid, 100.0);
    return 1;
}
// colorcar command
CMD:colorcar(playerid, params[])
{
    new color[2];
    if(sscanf(params,"dD",color[0],color[1]))
    {
        return SendClientMessage(playerid, -1, "USAGE: /colorcar [color1] [color2]");
    }
    new
    string[128];
    format(string, sizeof(string), "You have changed the vehicle's color 1 to %d and color 2 to %d!",color[0],color[1]);
    SendClientMessage(playerid, -1, string);
    ChangeVehicleColor(GetPlayerVehicleID(playerid),color[0],color[1]);
    return 1;
}
Reply
#10

Maybe it's my sever.cfg?

pawn Код:
echo Executing Server Config...
lanmode 0
rcon_password mapper
maxplayers 50
port 7777
hostname Ganton
gamemode0 server 1
filterscripts test test2
announce 0
chatlogging 0
weburl [url]www.sa-mp.com[/url]
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
language English
useartwork 0
sleep 1
mtu 1400
plugins streamer sscanf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)