AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What are stocks exactly? (https://forums.alliedmods.net/showthread.php?t=307878)

GoldNux 05-28-2018 22:06

What are stocks exactly?
 
What is the difference between a STOCK and a regular function?
Is it only that it is not compiled if it is not used?

Thank you.

ddhoward 05-28-2018 23:34

Re: What are stocks exactly?
 
Quote:

Originally Posted by GoldNux (Post 2594320)
Is it only that it is not compiled if it is not used?

yes

Bugsy 05-29-2018 07:57

Re: What are stocks exactly?
 
Yup and many on these forums refer to a function as a stock..when you hear 'stock', 9/10 times it means function. They should only be used in include files.

^SmileY 05-29-2018 08:27

Re: What are stocks exactly?
 
Quote:

Originally Posted by GoldNux (Post 2594320)
What is the difference between a STOCK and a regular function?
Is it only that it is not compiled if it is not used?

Thank you.

Yes, and if you code incorrectly and not use it, compiler will not give any error from that function.
Also stocks are welcome where you will use in multiple plugins the same function, like access from amxmisc or others

CrazY. 05-29-2018 10:51

Re: What are stocks exactly?
 
Generally stocks are added in includes, since codders doesn't use all that exists into them. So when he compile, do not get errors like "Function is not be used". So, consider when you want a custom function, add as an private functions instead of stock in plugin


All times are GMT -4. The time now is 04:39.

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