Raised This Month: $ Target: $400
 0% 

Global var in Stock


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-18-2021 , 08:53   Re: Global var in Stock
Reply With Quote #5

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.
__________________

Last edited by Bugsy; 05-18-2021 at 08:54.
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode