Not too familiar with #emit.
#1

I'm trying to transform

PHP код:
SendAdminMsg(msg[])
{
    foreach(new 
Player)
    {
        if(!
IsSpawned[i]) continue;
        if(
PlayerInfo[i][Admin_Level] > 1)
            
SendClientMessage(i, -1msg);
    }

into something like

PHP код:
SendAdminMsgEx(color, const text[], {Float_}:...)
{
    static 
argsstr[144];
    if((
args numargs()) == 3)
    {
        foreach(new 
Player)
        {
            if(!
IsSpawned[i]) continue;
            if(
PlayerInfo[i][Admin_Level] > 1)
                
SendClientMessage(icolortext);
        }
    }
    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 Player)
        {
            if(!
IsSpawned[i]) continue;
            if(
PlayerInfo[i][Admin_Level] > 1)
                
SendClientMessage(icolorstr);
        }
        
#emit RETN
    
}
    return 
1;

SendAdminMsgEx just outputs a blank string.

The example usage of SendAdminMsgEx would be
PHP код:
SendAdminMsgEx(-1"%s bla bla"PlayerName(playerid)); 
instead of doing the whole new string[50]; and formatting it lmao
Reply


Messages In This Thread
Not too familiar with #emit. - by itsCody - 30.01.2016, 05:25
Re: Not too familiar with #emit. - by Gammix - 30.01.2016, 05:38
Re: Not too familiar with #emit. - by itsCody - 30.01.2016, 05:44
Re: Not too familiar with #emit. - by Yashas - 31.01.2016, 03:39
Re: Not too familiar with #emit. - by itsCody - 31.01.2016, 03:53
Re: Not too familiar with #emit. - by jamesbond007 - 31.01.2016, 12:32

Forum Jump:


Users browsing this thread: 1 Guest(s)