What are your views on this method/practice? [rep++]
#1

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

Try to create them as a Filterscript?
Reply
#3

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

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

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

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

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"
Reply
#8

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

oh Im gonna test this in about 10 mins thank you for this info!!!
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)