Question about .inc files
I got some questions about the includes, file.inc ...
1.How do we make them (like making new commands. ex: "zp_get_user_zombie" from zombieplague.inc 2.I'd also like some info about natives. 3. If i think right, a include can hold a bool like this. example: plugins: jailbreak.sma and lr.sma include holds bool:lr_started so when you code a rebelling system in jailbreak.sma but lr.sma says lr is started. No rebeling thing will start. 4.if you can help me out with this, i'll be a very happy guy. ;):) |
Re: Question about .inc files
2 Attachment(s)
Heres one of my includes..
It hods all the values for cvars and class/ranks/XP as well as stocks. and other stuff i call frequently. How ever the version of battle field that i will be releasing will be fully modular and rewritten. Meaning it will hold natives as well as stock functions and variables that all the attatched plugins will uses such as (Primary weapons, Secondary, Armor, Health, Speed, Gravity) And that example is the second include file i have attatched. |
Re: Question about .inc files
|
Re: Question about .inc files
@ NbC_Sav:
so you make it like the start of a normal plugin, defining things and such. Could you explain a little more about the stocks to? And i create a float in my inc and 1 plugin changes the value of the float, will plugin 2 see the changed value or not? @wrecked_: And agian you make my day a lot easyer. @Both: Thanks |
Re: Question about .inc files
Don't create 'global' variables in includes. They will not be used as you are hoping.
|
Re: Question about .inc files
Quote:
They work fine to seperate the two plugins just fine... The first one was just to keep the main plugin nice and simple to read.. How ever say i added another plugin that used that include if i dont use all those variables i get errors saying that all the variables werent used. So if its just a really large plugin to make it more readable i sperated them. The plugin was like 4k lines of code lol so makeing the inc and regular file it was so much easier. Quote:
When you create a Float in your inc. Plugin one can use it and make the value what it would like change it and do what ever how ever plugin two can use it but its a completely different variable So technically it would be like creating a float in each of the 2 plugins. I believe that is correct. Now for the stock PHP Code:
PHP Code:
It makes it simpler to use multiple functions calling the same function. (if that makes sense) |
Re: Question about .inc files
On an off-note, you may want to add a prefix on to each of your variables / stocks in the include (if you're publicizing it), so that people don't waste their time looking through the main plugin to modify something, when something as simple as JB_Strip_Weapons would notify the editor that the stock he wants to modify is in the .include file.
|
Re: Question about .inc files
Quote:
|
Re: Question about .inc files
is the stock called in another function then? like so:
PHP Code:
the other plugin sees that it's true? like this jailbreak last request plugin: PHP Code:
the rebel plugin: PHP Code:
|
Re: Question about .inc files
JailBreak plugin that sets lr_started:
Code:
Code:
Code:
That was with using Dynamic Natives. |
| All times are GMT -4. The time now is 08:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.