SA-MP Forums Archive
_ALS_ - 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: _ALS_ (/showthread.php?tid=636487)



_ALS_ - Bussyman - 28.06.2017

Hi,


Код:
stock AC_GivePlayerMoney(playerid,money)
{
   GivePlayerMoney( playerid, money );
}

#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney AC_GivePlayerMoney
So this code will be infinite? because giveplayermoney call ac_giveplayermoney, and there is giveplayermoney so this will be calling and calling or no?


Re: _ALS_ - Gammix - 28.06.2017

No since you redefine "GivePlayerMoney" after the function; and this is all compile time stuff, so anything written first compiles first!