14.08.2012, 22:08
Just searched this myself.
For public functions:
For stocks:
Hope I helped.
For public functions:
Код:
A function should be public whenever "the server" must be able to call the function at run time.
Код:
Stocks are a form of function. The only noticeable difference between a stock and a function is that when you don't use a stock, you don't get a warning. Stocks are powerful little tools that allow you to move large repeated bits of code away from the main block, making it easier to edit something that is used in multiple places. When you compile a script only the stocks which you use in your script are saved, and any you fail to include do not appear in the compiled ".amx", thus increasing efficiency in one way or another. For example, if you have a stock that gave the player a vehicle, but you never use it, when you go to compile the compiler wouldn't bothered including it. This makes it advantageous to have large stock libraries stored in includes, as the script will only "extract" the ones it requires upon compiling.