Posts: 68
Threads: 37
Joined: Jan 2013
Reputation:
0
Hi, I just need to know how to add filterscripts to gamemodes- I am a bit confused on what to do. I've looked all over *******, ******, and other sites, but it is hard to understand what they are saying.
Thanks!
Posts: 2,628
Threads: 32
Joined: Apr 2007
Reputation:
0
Do you mean use filterscripts together with your gamemode? In that case add the name of the .amx of the filterscript on the filterscripts line in the server.cfg.
If not, then you simply need to put everything underneath OnFilterScriptInit into OnGameModeInit and the same with OnFilterScriptExit/OnGameModeExit, then put the remaining parts of the code at the same places as they are in the FS.
Posts: 1,594
Threads: 61
Joined: Oct 2009
Reputation:
0
This depends on the size of the filterscript. The bigger it is, the most likelier you will get errors due to same definitions of variables.
You basically have to copy all callback's content into the same named callback in your gamemode. Don't forget about the definitions of variables and functions.
You should only do this if you know what you are doing, I am speaking of experience. When I was very new to pawno, three and a half years ago, I also tried to do that, but failed since I had no idea what I was doing. ^^
If you need help, just say.
Posts: 68
Threads: 37
Joined: Jan 2013
Reputation:
0
Yes.. I am very new, but do understand some things towards filterscripts.
However, when adding the callbacks, There are others there as well.. Should I make sure they are closed?
Then when I add the others, how do I open the line? its { Right?
Posts: 1,594
Threads: 61
Joined: Oct 2009
Reputation:
0
You just have to merge them together at the right place. That's why I said you have to be aware of what you are doing, else it will end up in a chaos and bugged code.
Posts: 2,628
Threads: 32
Joined: Apr 2007
Reputation:
0
If you have the same callback in both GM and FS, simply add the content of the callback in the FS at the bottom (outside any if-statements and such) of the callback in the GM.