SA-MP Forums Archive
preformatted messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: preformatted messages (/showthread.php?tid=659883)



preformatted messages - g1venchy - 19.10.2018

after compiling my gamemode with latest version of pawno, pre formatted messages doesn't work correctly anymore.


Re: preformatted messages - GameOvr - 19.10.2018

What you mean? Can you post the code


Re: preformatted messages - g1venchy - 19.10.2018

it may be releated with SendClientMessage being const now
PHP код:
#define BYTES_PER_CELL                 4
stock fmessage(playeridcolorfstring[], {Float_}:...){
    static const 
STATIC_ARGS 3;
    new 
= (numargs() - STATIC_ARGS) * BYTES_PER_CELL;
    if(
n)
    {
        new 
message[144],arg_start,arg_end;
        
#emit CONST.alt        fstring
        #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          fstring
        #emit PUSH.C          144
        #emit PUSH.ADR         message
        
+= BYTES_PER_CELL 3;
        
#emit PUSH.S          n
        #emit SYSREQ.C         format
        
+= BYTES_PER_CELL;
        
#emit LCTRL          4
        #emit LOAD.S.alt        n
        #emit ADD
        #emit SCTRL          4
        
return SendClientMessage(playeridcolormessage);
    } else {
        return 
SendClientMessage(playeridcolorfstring);
    }
    return 
1;




Re: preformatted messages - g1venchy - 19.10.2018

fmessage(playerid, -1, "%d %s",1000,"hello");
result: "1000 "