nothing, stock & 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)
+--- Thread: nothing, stock & public? (
/showthread.php?tid=291334)
nothing, stock & public? -
Sinner - 19.10.2011
pawn Код:
forward someFunction(); // Not needed? I noticed you don't have to do this in includes
stock someFunction() {
}
public someFunction() {
}
someFunction() {
}
What would be the difference between declaring a function as "stock", "public" or not declaring it at all (just the name). Also, when do you need to forward a function and when don't you? I've been asking myself this for too long, it's time for answers!
Rep++ for the first.
Re: nothing, stock & public? -
aRoach - 19.10.2011
With stock you can't do Timers...
You can do a Define...
pawn Код:
#define Public:%0(%1) forward %0(%1);\
public %0(%1)
Ex.
pawn Код:
Public:someFunctions( )
{
return 1;
}
Re: nothing, stock & public? -
FireCat - 19.10.2011
Uhh another one of these.
In public functions you can't return strings.
Example:
pawn Код:
public Hello(playerid)
{
if(!IsPlayerConnected(0)) return "Bye";
else return "Hello";
}
Small dumbass example, but public's can't do so.
You would have to do with stock.
pawn Код:
stock Hello(playerid)
{
if(!IsPlayerConnected(0)) return "Bye";
else return "Hello";
}
@aRoach: Facepalm.
Re: nothing, stock & public? -
Sinner - 19.10.2011
Alright thanks I didn't know that ^
Re: nothing, stock & public? -
FireCat - 19.10.2011
Quote:
Originally Posted by Sinner
Alright thanks I didn't know that ^
|
Oh out of topic:
I was [Buki]Hikaru_Masuyo :b Aka dark_clown (:
Remember me? :b