SA-MP Forums Archive
Team developing - includes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team developing - includes (/showthread.php?tid=154581)



Team developing - includes - 0xCAFE23 - 14.06.2010

Hi!

I own an RP server with an ugly gamemode.
I don't want to rewrite it from scratch, i need to keep it, and make it better.

The problem is that it's a single pwn with lots of code on it, and this makes things harder for teamwork.
So, the idea is to split code in a set of includes

Does anyone have any experience doing this, or some idea to help us?

Thanks


Re: Team developing - includes - DJDhan - 14.06.2010

Splitting a Game Mode into includes? It's a NO NO. Why don't just take parts of code like OnPlayerSpawn, OnPlayerRequestClass etc.


Re: Team developing - includes - MadeMan - 14.06.2010

You can put each callback in a separate include file and then use #include in your main script.


Re: Team developing - includes - 0xCAFE23 - 14.06.2010

I wanted to do something like:

IRP_Vehicles.inc: With all vehicle related functions and dcmds
IRP_Player.inc: With all player info and account related functions
IRP_Properties.inc: With all property related functions
IRP_Commands: With OnPlayerCommandText and dcmd calls and some general commands that don't fit in other includes.

Isn't it a good idea?

Thanks all


Re: Team developing - includes - Flashy - 14.06.2010

Donґt make it us .inc.
Make it as a part of Filterscript. You can have till 15 Filterscripts in one server.




Re: Team developing - includes - 0xCAFE23 - 14.06.2010

But you cannot share info between filterscripts...

In example, if i make a vehicles fs, i need to have access to player's inventory to check if he has the keys...
And if i also do a properties fs, i have to check if he has the keys to enter it.
So i will need to share the inventory between filters... that's not possible