Készítõ: Ryder stock SendFormatMessage(const iPlayer, const iColor, const szFormat[], {Float, _}: ...)
{
new iArgs = (numargs() - 3) << 2;
if(iArgs)
{
static s_szBuf[144],s_iAddr1,s_iAddr2;
#emit ADDR.PRI szFormat
#emit STOR.PRI s_iAddr1
for(s_iAddr2 = s_iAddr1 + iArgs, iArgs += 12; s_iAddr2 != s_iAddr1; s_iAddr2 -= 4)
{
#emit LOAD.PRI s_iAddr2
#emit LOAD.I
#emit PUSH.PRI
}
#emit CONST.PRI s_szBuf
#emit PUSH.S szFormat
#emit PUSH.C 144
#emit PUSH.PRI
#emit PUSH.S iArgs
#emit SYSREQ.C format
#emit LCTRL 4
#emit LOAD.S.ALT iArgs
#emit ADD.C 4
#emit ADD
#emit SCTRL 4
return (iPlayer != -1) ? SendClientMessage(iPlayer, iColor, s_szBuf) : SendClientMessageToAll(iColor, s_szBuf);
}
return (iPlayer != -1) ? SendClientMessage(iPlayer, iColor, szFormat) : SendClientMessageToAll(iColor, szFormat);
}
Példa a használatára (format nélkül):
SendFormatMessage(-1, -1, \"Név mindenkinek: %s\", nev);
SendFormatMessage(playerid, -1, \"Név: %s\", nev);