02.02.2020, 19:59
I wonder if there's a way to shorten this function and make a macro instead (#define SendClientMessageEx ...)
pawn Code:
stock SendClientMessageEx(playerid, color, const str[], {Float,_}:...)
{
static args, start, end,string[200];
#emit LOAD.S.pri 8
#emit STOR.pri args
if(args > 12)
{
#emit ADDR.pri str
#emit STOR.pri start
for(end = start + (args - 12); end > start; end -= 4)
{
#emit LREF.pri end
#emit PUSH.pri
}
#emit PUSH.S str
#emit PUSH.C 156
#emit PUSH.C string
#emit PUSH.C args
#emit SYSREQ.C format
SCM(playerid, color, string);
#emit LCTRL 5
#emit SCTRL 4
#emit RETN
}
return SCM(playerid, color, str);
}