SA-MP Forums Archive
SendClientFormatMessageToAll - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientFormatMessageToAll (/showthread.php?tid=221984)



SendClientFormatMessageToAll - kurta999 - 06.02.2011

Hi!

Someone can make SendClientFormatMessageToAll with this code ?
pawn Код:
stock SendClientFormatMessage( iPlayer, iColor, const szFormat[ ], { Float, _ }:... )
{
    iArgCount = ( numargs( ) - 3 ) * 4;

    if ( !iArgCount )
        SendClientMessage( iPlayer, iColor, szFormat );
    else
    {

        #emit CONST.alt     szFormat
        #emit LCTRL         5
        #emit ADD
        #emit STOR.S.pri    iArgStart
        #emit LOAD.S.alt    iArgCount
        #emit ADD
        #emit STOR.S.pri    iArgEnd

        do
        {
            #emit LOAD.I
            #emit PUSH.pri

            iArgEnd -= 4;

            #emit LOAD.S.pri    iArgEnd
        }
        while ( iArgEnd > iArgStart );

        #emit PUSH.S    szFormat
        #emit PUSH.C    128
        #emit PUSH.ADR  szString

        iArgCount += 12;

        #emit PUSH.S    iArgCount
        #emit SYSREQ.C  format

        iArgCount += 4;

        #emit LCTRL         4
        #emit LOAD.S.alt    iArgCount
        #emit ADD
        #emit SCTRL         4

        SendClientMessage( iPlayer, iColor, szString );
    }
    return 1;
}
#define SendClientMessage SendClientFormatMessage
Thanks!


Re: SendClientFormatMessageToAll - [03]Garsino - 06.02.2011

pawn Код:
new FALSE = false;
#define SendMSG(%0,%1,%2,%3,%4) do{new _str[%2]; format(_str,%2,%3,%4); SendClientMessage(%0,%1,_str);}while(FALSE)
//------------------------------------------------------------------------------
#define SendMSGToAll(%0,%1,%2,%3) do{new _str[%1]; format(_str,%1,%2,%3); SendClientMessageToAll(%0,_str);}while(FALSE)
By ******.

+ You could've just replaced
pawn Код:
SendClientMessage( iPlayer, iColor, szString );
with
pawn Код:
SendClientMessageToAll(iColor, szString);
But it is better and faster having it as a macro.