Posts: 1,849
Threads: 96
Joined: Apr 2010
Reputation:
0
I never really understand a difference between a Stock and a public function?Though im kinda ashamed to ask.
Could you please help me understand them in a easy way. Will rep everyone who will help me.
Thanks for reading.
Ballu Miaa
Posts: 138
Threads: 17
Joined: Jan 2011
Reputation:
0
"stock" defines that a function may not be used, and if it isn't don't give a warning at compile time. This is used for library functions, you don't need it for writing normal modes.
"public" saves the name of the function in the amx (normally functions are just called be address, the human-readable name is not important). Saving the name means that the function can be found by name later on. When you specify a function in "SetTimer", "SetTimerEx", "CallLocalFunction" or "CallRemoteFunction" you specify it by name so these can only call public functions. Callbacks such as "OnPlayerConnect" are also public for the same reason.