Posts: 105
Threads: 29
Joined: Jan 2013
Reputation:
0
I am trying to create a RP-Server.
I have a login system, but I want to change that login system to only save the username and password.
And I want to create another filterscript to save the adminrank and to add the commands there.
So it's basically I want to create mutliple filterscripts that has all it's own part of doing something.
Like 1 for the adminrank, 1 for the property owned, 1 for the cars. and so on.
How would I do that?
Posts: 680
Threads: 143
Joined: Nov 2014
Reputation:
0
You are asking to fail in scripting !....
If you do that i think that there won't anything work.
Posts: 105
Threads: 29
Joined: Jan 2013
Reputation:
0
I want to do this to create a bit of a structure in my gamemode.
I normally code java which is much nicer because everything is in different files.
Posts: 348
Threads: 26
Joined: Oct 2012
Reputation:
0
Better make includes rather than filterscripts
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Use a hooking method (ALS 7 or y_hooks or something) so you can write each module in a separate file. Then include everything in one filterscript and compile it. If you want to disable a module, comment it out and compile the script again. You could also create several different pre-compiled versions so you can load the one you want immediately.
Posts: 1,733
Threads: 20
Joined: Nov 2010
Reputation:
0
I also wanted my admin-system, housing and business systems, refuelling system and alot more inside a filterscript, and only hold the job/class systems inside my gamemode.
I didn't want to extract all those systems in case I want to create a new gamemode later on, so it was my plan to have all the systems I would need later inside a filterscript.
But it was too hard to maintain and both scripts needed to communicate too much between them.
Even some values needed to be shared and both scripts would eventually hold almost identical data to prevent too many CallRemoteFunction calls to transfer all the data all the time.
Even some commands needed to be split between both scripts (as I have alot of in-game editing commands), because I didn't want to make 2 separate commands to edit data about the same thing (vehicles for example).
The filterscript held fuel-tank size, fuel consumption, current fuel, and a few other values.
The gamemode held values such as cargobay size, the products inside the cargobay and also a few other values.
I had an /editv command, where I could adjust the fuel-values from inside the filterscript.
But because the data was split between both scripts, the gamemode would need an /editv2 command to modify data about the cargobay.
Admins would need to know which values are in which script and execute the proper command to access the right data, where the interface is nearly identical.
And making one command to edit everything would mean I had to move all data to one script and modify it there and make many CallRemoteFunction calls to transfer the data when the gamemode needed them.
Or share dialogs between both scripts to go back and forth between them, so the user doesn't even notice he's working with 2 scripts.
My head was nearly exploding while figuring out how I could make it as painless as possible for myself, keep the code simple, edit as much data as possible, get the best flexibility, have the ability to do whatever I wanted and whatever else.
I eventually decided to merge the filterscript and gamemode, since both scripts need eachother anyway to work properly, and because of this, I have to start from scratch (again), copying code and modify it to get it to work.
I was only making things harder then needed.