ZCMD only works in 1 filterscript -
doodlebob666 - 15.04.2018
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.
Re: ZCMD only works in 1 filterscript -
ProScripter - 15.04.2018
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()
Re: ZCMD only works in 1 filterscript -
doodlebob666 - 15.04.2018
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
Re: ZCMD only works in 1 filterscript -
MadeMan - 15.04.2018
Do you use OnPlayerCommandReceived in the first script?
Re: ZCMD only works in 1 filterscript -
doodlebob666 - 15.04.2018
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.
Re: ZCMD only works in 1 filterscript -
Mugala - 15.04.2018
u're getting any error? like SERVER: Uknown Command!
Re: ZCMD only works in 1 filterscript -
doodlebob666 - 16.04.2018
Quote:
Originally Posted by Mugala
u're getting any error? like SERVER: Uknown Command!
|
I said no
Re: ZCMD only works in 1 filterscript -
UFF - 16.04.2018
Код:
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?
Re: ZCMD only works in 1 filterscript -
doodlebob666 - 16.04.2018
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;
}
Re: ZCMD only works in 1 filterscript -
doodlebob666 - 17.04.2018
Maybe it's my sever.cfg?
pawn Код:
echo Executing Server Config...
lanmode
0rcon_password mapper
maxplayers
50port
7777hostname Ganton
gamemode0 server
1filterscripts test test2
announce
0chatlogging
0weburl
[url
]www.sa-mp.com
[/url
]onfoot_rate
40incar_rate
40weapon_rate
40stream_distance
300.0stream_rate
1000maxnpc
0logtimeformat
[%H:%M:%S
]language English
useartwork
0sleep 1mtu
1400plugins streamer sscanf