SA-MP Forums Archive
Asking what is difference between stock and public - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Asking what is difference between stock and public (/showthread.php?tid=161485)



Asking what is difference between stock and public - silvan - 20.07.2010

Title, says it all.

What is the difference between the stock function ( when you're going to create a custom function yourself... ) and the public function.... I know that public needs to be forwarded like " forward NewFunction(parameter1, parameter2);
etc... but is there something else different?


Re: Asking what is difference between stock and public - bigcomfycouch - 20.07.2010

Stocks don't get compiled into the .amx unless they are used in code, saving you memory. Publics, on the other hand, are always compiled into the .amx and can be used in timers and in other scripts using CallRemoteFunction. I prefer using no function header.

pawn Код:
func()
{
    doStuff();
}



Re: Asking what is difference between stock and public - silvan - 20.07.2010

Ok, thanks for your reply, it really helped alot.