A question about stocks
#1

So, I read this topic https://sampforum.blast.hk/showthread.php?tid=220089 about Using Stocks or Hooks

And I really don't understand. So, instant of using

my custom function
Код:
stock GivePlayerMoneyEx(playerid, money) 
{
	PlayerMoney[playerid] += money;
	return GivePlayerMoney(playerid, money);
}
I should use this
Код:
stock My_GivePlayerMoney(playerid, money)
{
    PlayerMoney[playerid] += amount;
    return GivePlayerMoney(playerid, money);
}

#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney My_GivePlayerMoney
Is not the same thing?

Using GivePlayerMoney should call the stock My_GivePlayerMoney, so is like when I use GivePlayerMoneyEx for example, right?

So, what should I use? my custom function or the function like in tutorial?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)