Question | what the different about stocks and publics
#1

<< Topic >>
Reply
#2

Written by ******:

Quote:

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

Reply
#3

Written by the SA-MP wiki, I encourage you to read it all.

https://sampwiki.blast.hk/wiki/Public_functions

https://sampwiki.blast.hk/wiki/Stock_Functions
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)