Posts: 150
Threads: 45
Joined: Mar 2012
Else
PHP код:
stock SendClientFormattedMessage(playerid, couleur, const message[], {Float,_}:...)
{
static const
ARGUMENTS = 3;
new
n = (numargs() - ARGUMENTS) * BYTES_PER_CELL;
if (!n) return SendClientMessage(playerid, couleur, message);
new
fstring[145],
arg_start,
arg_end;
#emit CONST.alt message
#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 -= BYTES_PER_CELL;
#emit LOAD.S.pri arg_end
}
while (arg_end > arg_start);
#emit PUSH.S message
#emit PUSH.C 145
#emit PUSH.ADR fstring
n += BYTES_PER_CELL * 3;
#emit PUSH.S n
#emit SYSREQ.C format
n += BYTES_PER_CELL;
#emit LCTRL 4
#emit LOAD.S.alt n
#emit ADD
#emit SCTRL 4
return SendClientMessage(playerid, couleur, fstring);
}
Thank Sartek Le Bifsteak
SendClientFormattedMessage(playerid,-1, "Admininstrator %s(ID:%d) has cleared the chat!",GetPName(playerid));
Posts: 864
Threads: 57
Joined: Jan 2013
Reputation:
0
@DZX : Giving him the function as it is is not the best way to make him understanding anything of it.
@Author : Use y_va for this kind of functions. (directly using specifiers in a string without using format before).