#emit
#1

Hello!
I've returned to SA:MP after quite some time now and I checked a script and found this.
PHP Code:
stock SendClientMessageEx(playeridcolor, const text[], {Float_}:...)
{
    static
        
args,
        
str[144];
    if ((
args numargs()) == 3)
    {
        
SendClientMessage(playeridcolortext);
    }
    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
        
SendClientMessage(playeridcolorstr);
        
#emit RETN
    
}
    return 
1;

From the usages of it, I see that this function is used to send messages with "variables" instead of formatting it and then sending the formatted message.

I just don't get what this #emit does. I tried to search for an emit preprocessor for C/C++(so I can get a general answer rather than a samp-related one), but can't find any results(There is a _emit keyword, which is not what this is).

It would be greatly appreciated if someone can briefly explain to me what that is. No complicated topics since I am just 14.

Have a nice day.

EDIT: If there is a "non-emit" alternative to do this, please let me know.
Reply


Messages In This Thread
#emit - by Salint - 24.01.2020, 15:51
Re: #emit - by Markski - 24.01.2020, 20:52
Re: #emit - by Kwarde - 24.01.2020, 21:25
Re: #emit - by Markski - 24.01.2020, 22:36
Re: #emit - by Salint - 25.01.2020, 04:35
Re: #emit - by Calisthenics - 25.01.2020, 07:56

Forum Jump:


Users browsing this thread: 1 Guest(s)