open.mp forum
[Pawn] Which one is better? - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Which one is better? (/showthread.php?tid=2274)



Which one is better? - Zow - 2022-01-26

PHP Code:
#define SendErrorMessage(%0, %1) SendClientMessage(%0, COLOR_RED, "[*]{FFFFFF} "%1) 



PHP Code:
SendErrorMessage(playerid, const msg[]) {

? ? new

? ? ? ? 
string[145];



? ? 
format(stringsizeof(string), "[*]"C_WHITE" %s"msg);



? ? return 
SendClientMessage(playeridCOLOR_REDstring);





I just want to know how different


RE: Which one is better? - Behemoth - 2022-02-18

(2022-01-26, 09:29 PM)Zow Wrote:
PHP Code:
#define SendErrorMessage(%0, %1) SendClientMessage(%0, COLOR_RED, "
[*]{FFFFFF"%1) 

PHP Code:
SendErrorMessage(playerid, const msg[]) {
? ? new
? ? ? ? 
string[145];

? ? 
format(stringsizeof(string), "
[*]"
C_WHITE" %s"msg);

? ? return 
SendClientMessage(playeridCOLOR_REDstring);


I just want to know how different

PHP Code:
#define SendErrorMessage(%0, %1) SendClientMessage(%0, COLOR_RED, "{FFFFFF} "%1) 

I think just because you're using less resources as you don't need to create a variable etc. Marginally better


RE: Which one is better? - Y_Less - 2022-03-25

Of the two, the define is better.