#define vs normal function - 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: #define vs normal function (
/showthread.php?tid=661778)
#define vs normal function -
serqq - 14.12.2018
Hi, are there any downsides of using #define instead of normal functions?
I'm specifically talking about using it in this case:
Code:
GetPlayerAdminLevel(playerid) {
return Player[playerid][AdminLevel];
}
#define GetPlayerAdminLevelEx(%0) Player[%0][AdminLevel]
I've already tested that using #define is slightly faster than functions, but i'm unsure if it will make me run into some errors later.