30.01.2016, 05:25
(
Последний раз редактировалось itsCody; 30.01.2016 в 19:17.
)
I'm trying to transform
into something like
SendAdminMsgEx just outputs a blank string.
The example usage of SendAdminMsgEx would be
instead of doing the whole new string[50]; and formatting it lmao
PHP код:
SendAdminMsg(msg[])
{
foreach(new i : Player)
{
if(!IsSpawned[i]) continue;
if(PlayerInfo[i][Admin_Level] > 1)
SendClientMessage(i, -1, msg);
}
}
PHP код:
SendAdminMsgEx(color, const text[], {Float, _}:...)
{
static args, str[144];
if((args = numargs()) == 3)
{
foreach(new i : Player)
{
if(!IsSpawned[i]) continue;
if(PlayerInfo[i][Admin_Level] > 1)
SendClientMessage(i, color, text);
}
}
else
{
while(--args >= 3)
{
#emit LCTRL 5
#emit LOAD.alt args
#emit SHL.C.alt 2
#emit ADD.C 12
#emit ADD
#emit LOAD.I
#emit PUSH.pri
}
#emit PUSH.S text
#emit PUSH.C 144
#emit PUSH.C str
#emit PUSH.S 8
#emit SYSREQ.C format
#emit LCTRL 5
#emit SCTRL 4
foreach(new i : Player)
{
if(!IsSpawned[i]) continue;
if(PlayerInfo[i][Admin_Level] > 1)
SendClientMessage(i, color, str);
}
#emit RETN
}
return 1;
}
The example usage of SendAdminMsgEx would be
PHP код:
SendAdminMsgEx(-1, "%s bla bla", PlayerName(playerid));