SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/04/2018, 11:20 AM   #1
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default ZCMD only works in 1 filterscript

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

Code:
// 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

Code:
// 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.
doodlebob666 is offline   Reply With Quote
Old 15/04/2018, 03:50 PM   #2
ProScripter
Banned
 
Join Date: Apr 2018
Location: India
Posts: 18
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Quote:
Originally Posted by doodlebob666 View Post
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

Code:
// 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

Code:
// 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()
ProScripter is offline   Reply With Quote
Old 15/04/2018, 06:25 PM   #3
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Quote:
Originally Posted by ProScripter View Post
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
doodlebob666 is offline   Reply With Quote
Old 15/04/2018, 07:09 PM   #4
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,500
Reputation: 254
Default Re: ZCMD only works in 1 filterscript

Do you use OnPlayerCommandReceived in the first script?
MadeMan is offline   Reply With Quote
Old 15/04/2018, 07:32 PM   #5
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Quote:
Originally Posted by MadeMan View Post
Do you use OnPlayerCommandReceived in the first script?
no, the only thing I use if onfilterscriptint, onfilterscriptexit, and zcmd. All my includes are there.
doodlebob666 is offline   Reply With Quote
Old 15/04/2018, 08:50 PM   #6
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: behind u
Posts: 647
Reputation: 30
Default Re: ZCMD only works in 1 filterscript

u're getting any error? like SERVER: Uknown Command!
__________________
here to help
Mugala is offline   Reply With Quote
Old 16/04/2018, 04:01 AM   #7
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Quote:
Originally Posted by Mugala View Post
u're getting any error? like SERVER: Uknown Command!
I said no
doodlebob666 is offline   Reply With Quote
Old 16/04/2018, 04:16 AM   #8
UFF
Big Clucker
 
UFF's Avatar
 
Join Date: Feb 2018
Posts: 132
Reputation: 8
Default Re: ZCMD only works in 1 filterscript

Code:
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?
UFF is offline   Reply With Quote
Old 16/04/2018, 06:02 AM   #9
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Quote:
Originally Posted by UFF View Post
Code:
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.

Code:
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;
}
doodlebob666 is offline   Reply With Quote
Old 17/04/2018, 02:43 AM   #10
doodlebob666
Little Clucker
 
Join Date: Nov 2017
Posts: 21
Reputation: 0
Default Re: ZCMD only works in 1 filterscript

Maybe it's my sever.cfg?

Code:
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
doodlebob666 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filterscript ZCMD issue. Stefhan Scripting Help 4 22/10/2017 02:22 PM
zcmd, 1 CMD works, the other one dosen't - FS gnoomen2 Scripting Help 1 12/08/2013 11:15 PM
RCON input via console - Only works when a filterscript is loaded Hiddos Scripting Help 3 18/12/2011 07:47 PM
OnPlayerCommandText only works on my filterscript? nckspec Help Archive 2 11/01/2010 02:09 AM
zcmd /kick doesnt works svorpyx Help Archive 5 09/01/2010 06:58 PM


All times are GMT. The time now is 09:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.