nothing, stock & public?
#1

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.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

Alright thanks I didn't know that ^
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)