SA-MP Forums Archive
Add some value to alpha - 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: Add some value to alpha (/showthread.php?tid=412005)



Add some value to alpha - Riddick94 - 31.01.2013

pawn Код:
case 1:
        {
            AlphaValue[playerid] += 5;
            PlayerTextDrawBoxColor(playerid, SerwerData[E_PLAYER_DARK_SCREEN], 0x000000(AA)?);
            if(AlphaValue[playerid] == 255)
            {
                Phase[playerid] = 2;
                SetPlayerPos(playerid, X, Y, Z);
                SetPlayerFacingAngle(playerid, A);
                SetPlayerInterior(playerid, Interior);
                SetPlayerVirtualWorld(playerid, Virtualworld);
            }
        }
       
        case 2:
        {
            AlphaValue[playerid] -= 5;
            PlayerTextDrawBoxColor(playerid, SerwerData[E_PLAYER_DARK_SCREE], 0x000000(AA)?);
            if(AlphaValue[playerid] == 255)Phase[playerid] = -1;
        }
    }
How to add some alpha value every time when timer will be called? Found some scripts like HexToRGBA or ****** RRGGBB topic but can't get it..


Re: Add some value to alpha - Vince - 31.01.2013

Use the bitiwse OR operator, I suppose.

Код:
0xAA | 0x11 = 0xBB



Re: Add some value to alpha - Riddick94 - 31.01.2013

Hm? Values should be:
pawn Код:
0x00000011, 0x00000022, 0x00000033, 0x00000044, 0x00000055, 0x00000066, 0x00000077, 0x00000088, 0x00000099, 0x000000AA, 0x000000BB, 0x000000CC, 0x000000DD, 0x000000EE, 0x000000FF
And then after i pass "FF":

FF to 11 alpha value.