What are your views on this method/practice? [rep++] -
Hoborific - 18.02.2012
So lately my gamemode has been reaching what I believe to be "too much" for one open document and I have decided to start moving code into includes, as I assume it is pretty much text replacement. for example
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <dini>
#include <GAMEMODE/AdminCommands>
#include <GAMEMODE/StockSystem>
#include <GAMEMODE/Vehicles>
#include <GAMEMODE/Stocks>
#include <GAMEMODE/HUD>
Vehicles.inc contains
pawn Код:
forward CreateVehicles();
public CreateVehicles()
{
// all teh vehicles here
}
and I just call CreateVehicles(); under OnGameModeInit, I have all my stocks inside Stocks.inc and so forth.
Personally I am just sick of not being able to have tabs or work as if I had classes, feedback?
Re: What are your views on this method/practice? [rep++] -
Guitar - 18.02.2012
Try to create them as a Filterscript?
Re: What are your views on this method/practice? [rep++] -
Hoborific - 18.02.2012
Limited to the number of filterscripts I can use, although I put all my objects into one, this method I still upload the same one file and everything is in the gamemode.
Re: What are your views on this method/practice? [rep++] -
Madd Kat - 18.02.2012
yeah I like this!!!
I was trying todo the same thing but somehow I kept getting undefined for vars in my include,
But that was my goal to make it modular and cleaner to work on code segments without digging threw 10,000 lines of code.
I think filter scripts are good for like loading/unloading a mini game at will
or maybe some gamemode development functions (saving positions and the likes)
I dont see a need to use a filter script to load objects, cars, zones ect that will be in the mode
at all times. This seams better in the gamemode or an include in the gamemode.
just my thoughts.
Re: What are your views on this method/practice? [rep++] -
Hoborific - 18.02.2012
Quote:
Originally Posted by Madd Kat
yeah I like this!!!
I was trying todo the same thing but somehow I kept getting undefined for vars in my include,
But that was my goal to make it modular and cleaner to work on code segments without digging threw 10,000 lines of code.
I think filter scripts are good for like loading/unloading a mini game at will
or maybe some gamemode development functions (saving positions and the likes)
I dont see a need to use a filter script to load objects, cars, zones ect that will be in the mode
at all times. This seams better in the gamemode or an include in the gamemode.
just my thoughts.
|
Just ran into the same problem, shame. I will look for ways around it but alas, I don't think there is any
Re: What are your views on this method/practice? [rep++] -
Madd Kat - 18.02.2012
well is there anywhere that describes what includes are used for....
seams to me that it should insert the code in the include file
at the point of the include statement in the GM,
now if thats the case we shouldnt get any errors.
if you find a solution to this please let me know, and I will the same to you.
Re: What are your views on this method/practice? [rep++] -
aRoach - 18.02.2012
Just create it with .pwn... In another Folder that is in your Server Locations...
For example:
pawn Код:
#include "../server/Defines.pwn"
#include "../server/News.pwn"
Re: What are your views on this method/practice? [rep++] -
Hoborific - 18.02.2012
Quote:
Originally Posted by aRoach
Just create it with .pwn... In another Folder that is in your Server Locations...
For example:
pawn Код:
#include "../server/Defines.pwn" #include "../server/News.pwn"
|
If this works I will forever be in your debt, going to test it later when I wake up properly.
Re: What are your views on this method/practice? [rep++] -
Madd Kat - 18.02.2012
oh Im gonna test this in about 10 mins thank you for this info!!!
Re: What are your views on this method/practice? [rep++] -
Hoborific - 18.02.2012
Quote:
Originally Posted by Madd Kat
oh Im gonna test this in about 10 mins thank you for this info!!!
|
Alright sweet, do post the results please.