public, private, and stock - 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: public, private, and stock (
/showthread.php?tid=79944)
public, private, and stock -
ledzep - 01.06.2009
I've been using PAWN for about two years now and I still don't fully understand what they each mean.
I tried looking, but all I could find were Public and Private stock markets? lol, anyway:
So what does Public, Private, and Stock mean and what are they officially called?
Thanks,
ledzep
Re: public, private, and stock -
ledzep - 01.06.2009
I also noticed you can make a function without using private/public/stock/etc...
And you also won't need to make a forward declaration.
i.e.
In what ways would this be different than:
Код:
public Function()
{
...
}
?
Re: public, private, and stock -
yom - 01.06.2009
There are load of infos about public and stock prefixes in the Pawn manual and private isn't used in Pawn.
For SA:MP, a public function should only be a function that is called by a timer of by CallRemoteFunction. If this isn't the case, don't make it public.
The stock prefix is useful for include files with functions that may not be used in the main script. Compiler doesn't include the stock functions if they are not used anywhere in the script.
Re: public, private, and stock -
yezizhu - 01.06.2009
emm,what's the differences
static var;
new var;
const var;
public var;
stock var;
new const (stock) var;
static const (stock) var;
?