Need suggestions!
#1

Hey, I was wondering this: if I have a looong code (10k+ lines) can I put longer callbacks into pawno/modules/src, making a .inc file and then including into main .pwn to optimize the script?

Thanks!
Reply
#2

It won't optimize anything it will just be more readable, but take into account that code should be split by functionality not by type. That means putting all house stuff in one file and all vehicle stuff in another file. It doesn't mean putting all callbacks in one file and all variables in another. You will need to hook callbacks in order to use the same callback in multiple different files.
Reply
#3

So it is only for having a more comfortable reading? Because I noticed that when you compile a .pwn (in which you included .inc files with callbacks and w/e), you don't need to upload the .inc files you included into the gamemode, but only the .amx file of the gamemode, and server will start anyways
Reply
#4

yes, it will make you coding a lot faster and when there is bug, you know file, where to search it.
notepad++ file editor is best choice for that.
Reply
#5

The include directive basically says "copy all contents of this file and paste them at this location"; anything that is in an include is also in the compiled amx.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)