Adding Filterscripts to gamemodes
#1

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)