View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-28-2015 , 21:31   Re: Writing Include Files (.inc)
Reply With Quote #7

Quote:
Originally Posted by Potato Uno View Post
So from reading those articles, functions can be made into natives, but there's no way of making variables visible in other plugins?

In other words, is there not a way to import handles, strings, and numeric variables from one plugin to another? Do I need to write additional natives that would, say, insert or retrieve data from the MyArray handle in the example above?

(Which doesn't sound right, since if you run #include <tf2> you get the TFClass_Scout, TFClass_Soldier, etc variables included within the namespace of your file.)
When you have an #include line, it is replaced with the contents of the file during one of the preprocessor passes.

So... its OK to have an enum or constant in an include file as their values never change. On the flip side, putting a variable there ends up with each plugin having their own independent copy of the variable.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline