Ne Funktion um formatierte Nachrichten direkt mit SendClientMessageEx ausgeben zu koennen statt immer format zu nutzen
C
#define BYTECOUNT (cellbits / 8)
stock SendClientMessageEx(playerid, color, fstring[], {Float, _}:...)
{
static const
ARGC = 3;
new n = (numargs() - ARGC) * BYTECOUNT;
if (n)
{
new message[128], arg_start, arg_end;
#emit CONST.alt fstring
#emit LCTRL 5
#emit ADD
#emit STOR.S.pri arg_start
#emit LOAD.S.alt n
#emit ADD
#emit STOR.S.pri arg_end
do
{
#emit LOAD.I
#emit PUSH.pri
arg_end -= BYTECOUNT;
#emit LOAD.S.pri arg_end
}
while (arg_end > arg_start);
#emit PUSH.S fstring
#emit PUSH.C 128
#emit PUSH.ADR message
n += BYTECOUNT * 3;
#emit PUSH.S n
#emit SYSREQ.C format
n += BYTECOUNT;
#emit LCTRL 4
#emit LOAD.S.alt n
#emit ADD
#emit SCTRL 4
return SendClientMessage(playerid, color, message);
}
else
{
return SendClientMessage(playerid, color, fstring);
}
}
Alles anzeigen