Modular gamemode includes -
PepsiCola23 - 15.02.2019
So basically im starting to make my gamemode modular, i have my textdraws,objects and removed building and other stuff in a include called objects.inc.
When i add objects,i simply put them in objects.inc,i save and then i compile my gamemode.
My question is,if i wanna make a system into an include,like a pet system,how do i make it so i can use variables from the gamemode into the include? like PlayerInfo and other stuffs i hope you get it.
can i simply use the variables or should i do something?
also can i use mysql in includes and how would i do that? ( cmds that modify data in database)
Re: Modular gamemode includes -
TokicMajstor - 15.02.2019
No no no... You can't use includes for that. Just make file objects.pwn in your gamemodes folder. Then put your object inside it and just save it do not compile. Go to your main gamemode and put the #include < objects.pwn > after the a_samp include. And then compile the main. If there's errors in that include your main gamemode compiler will show them. And the same thing for that pets
Re: Modular gamemode includes -
PepsiCola23 - 15.02.2019
why can`t i use includes?i am currently doing that and it works.
Re: Modular gamemode includes -
TokicMajstor - 15.02.2019
It is not supposed for that, but you are too looking to a way to use variables from gm in that and Iam not 100% sure but I think it is possible in my way
Re: Modular gamemode includes -
Bolex_ - 15.02.2019
People already had a discussion about modular programming here:
https://forum.sa-mp.com/showthread.p...hlight=modular
Re: Modular gamemode includes -
PepsiCola23 - 15.02.2019
i have read that topic but i couldnt manage to find answers for my questions
Re: Modular gamemode includes -
Bolex_ - 15.02.2019
Quote:
Originally Posted by PepsiCola23
i have read that topic but i couldnt manage to find answers for my questions
|
How comes ?
Everything you need is there and first answer on your question starts with ****** post.
Re: Modular gamemode includes -
PepsiCola23 - 15.02.2019
should i use .inc files or .pwn ? do i comple the .pwn or i just save it?
Re: Modular gamemode includes -
polygxn - 15.02.2019
Use .pwn of course. You need to have your main .pwn file in /gamemodes/, and include all the systems and such there, for example if you have a fishing system in /gamemodes/other_stuff/fishing_system.pwn then add the line #include "other_stuff/fishing_system.pwn" after where a_samp included. This way you can keep your mode fairly snappier. Here is a topic about modular programming more in-depth:
https://sampforum.blast.hk/showthread.php?tid=597338
You need to use some of the stuff from
THIS if you want to do such things.
Re: Modular gamemode includes -
TokicMajstor - 15.02.2019
Quote:
Originally Posted by polygxn
Use .pwn of course. You need to have your main .pwn file in /gamemodes/, and include all the systems and such there, for example if you have a fishing system in /gamemodes/other_stuff/fishing_system.pwn then add the line #include "other_stuff/fishing_system.pwn" after where a_samp included. This way you can keep your mode fairly snappier. Here is a topic about modular programming more in-depth: https://sampforum.blast.hk/showthread.php?tid=597338
You need to use some of the stuff from THIS if you want to do such things.
|
I said the same thing ur just now copying my answer