SA-MP Forums Archive
forward vs. stock vs. native - 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: forward vs. stock vs. native (/showthread.php?tid=240798)



forward vs. stock vs. native - pantelimonfl - 16.03.2011

What is the difference between theese three functions? I'm confused.


Re: forward vs. stock vs. native - Mauzen - 16.03.2011

forward is not a function type, but you use it to register the function headers of other functions, so the compiler knows the function exists before he reached it in the code.

stock functions will only be included in the amx file if it is needed, that means, if it is used somewhere in your code. Else it wont use any ressources.

natives are functions provided by samp or plugins, or in general: functions, that are not scripted in pawn, but they come from another program/library.


Re: forward vs. stock vs. native - Calgon - 16.03.2011

Just to add on to Mauzen's post: forwards are also used for public functions. You can find an explanation of what public functions do here.


Re: forward vs. stock vs. native - Mauzen - 16.03.2011

They are also used for normal functions/ stocks with tagged result
But youre right, you need forwards mostly for publics