Global var in Stock
Hello!
How could i put a global in a stock or is it even possible. I have searched for some time and haven't found information on this For example: PHP Code:
|
Re: Global var in Stock
As long as you make it global, you can use it anywhere
PHP Code:
|
Re: Global var in Stock
So it can only be called as global if its defined?
|
Re: Global var in Stock
It's a function, not a stock. Stocks should be defined only in include files and they are compiled in the binary (.amxx) only if they are called in code. So if you have an include file with 100 stocks but your plugin only calls one of them (and that one stock does not use any of the other stocks), then 99 of them are excluded in the .amxx at compile time.
If you want a variable accessible throughout your plugin then you declare it globally at the top of your plugin. If you want the variable accessible in only one function, then you declare it within the function. |
Re: Global var in Stock
Quote:
|
| All times are GMT -4. The time now is 02:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.