CLEO Help [Help] Multicolor text

CLEO related
Status
Not open for further replies.

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
1@ = 0
2@ = 0
3@ = 0

0340: set_text_draw_RGBA 1@ 2@ 3@ 255
033E: set_draw_text_position x(float) (float)y GXT 'BJ_PUSH'  // Push
Increase and decrease the variables to get different colors.
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
Thanks. But how can i change the color to a stored in exe memory word, like "rpg.b-zone.ro". You can give me a snippet? Thank again! 
:urtheman: :urtheman: :urtheman: :urtheman: :urtheman: :urtheman: :urtheman:
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Use sampfuncs opcodes to edit the color - 0C52: samp textdraw <tId> set_letter_size 1@ 2@ color 3@
Note that color is hex, so use some simple gosub while increasing/decreasgin each RGB var in a loop.

0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@
0C52: samp textdraw <tId> set_letter_size 1@ 2@ color 5@
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
Thanks a lot, but I have a misunderstanding how can i find that the "textdraw id (0@)"?  <<0C52: samp textdraw 0@ set_letter_size 1@ 2@ color 3@>>

Edit:

I made this and everything is ok, no crash but the healthbar does not appear
{$CLEO}

thread "Hp-Color"

CONST
    R = 1@
    G = 2@
    B = 3@
END


WHILE TRUE
    WAIT 0
    R = 255
    G = 0
    B = 0
    FOR B = 0 TO 255
        WAIT 0
        GOSUB @Hp
    END
    B = 255

    FOR R = 255 DOWNTO 0
        WAIT 0 
        GOSUB @Hp
    END
    R = 0

    FOR G = 0 TO 255
        WAIT 0
        GOSUB @Hp
    END 
    G = 255
 
    FOR B = 255 DOWNTO 0
        WAIT 0
        GOSUB @Hp
    END
    B = 0
    FOR R = 0 TO 255
        WAIT 0
        GOSUB @Hp
    END
    R = 255
    FOR G = 255 DOWNTO 0
        WAIT 0
        GOSUB @Hp
    END 
    G = 0 
END
:Hp
    0B67: render a 0xFF r 1@ g 2@ b 3@ to_argb 4@
    0A8C: write_memory 0xBAB22C size 4 value 4@ virtual_protect 1
return
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Rebo link said:
Thanks a lot, but I have a misunderstanding how can i find that the "textdraw id (0@)"?  <<0C52: samp textdraw 0@ set_letter_size 1@ 2@ color 3@>>

Make a loop;

Code:
for 0@ = 0 to 3000
    if 0C5D: samp textdraw 0@ is_exists
    then 0C5A: samp textdraw 0@ get_string_to 1@
           0AF8: show_msg "%d, %s" -1 0@ 1@
    end
end
This is just to get the ids, don't use this everytime(it will drop your fps) note the ids, and use them.
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
Code:
{$CLEO .cs}
0000: NOP

CONST
    R = 2@
    G = 3@
    B = 4@
END

 
WHILE TRUE
    WAIT 0
    R = 255
    G = 0
    B = 0
    FOR B = 0 TO 255
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@ 
        GOSUB @paris
    END
    B = 255
 
    FOR R = 255 DOWNTO 0
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@   
        GOSUB @color
    END
    R = 0
 
    FOR G = 0 TO 255
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@ 
        GOSUB @color   
    END   
    G = 255
   
    FOR B = 255 DOWNTO 0
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@ 
        GOSUB @color 
    END 
    B = 0
    FOR R = 0 TO 255
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@
        GOSUB @color 
    END 
    R = 255 
    FOR G = 255 DOWNTO 0
        WAIT 0
        0B67: render a 0xFF r 2@ g 3@ b 4@ to_argb 5@ 
        GOSUB @color
    END   
    G = 0   
END

:color
While true
wait 100
        if  0C5D: samp textdraw 2054 is_exists
            then 0C52: samp textdraw 2054 set_letter_size 1051931410 1067030938 color 5@

        end
end

With "color 5@" the text is always black. If i change to "color 0xFF0000FF" the textdraw color changes to blue. What problem have this script?

Can you please correct this script?
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
i made this for letter_size

then 0C5C: samp textdraw 2054 get_letter_size 1@ 2@ color 3@
            0AF8: samp add_message_to_chat "%d %d %d" color 0xFFFFFFFF 1@ 2@ 3@

and 1051931410 1067030938 was the values, I hope I did well.

But i can't make a increasing/decreasing of the color...
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
It works. But i can't make a increasing/decreasing of the color.. the color is always black.

Here it is my script.
Code:
{$CLEO .cs}
0000: NOP



 
CONST
    R = 1@
    G = 2@
    B = 3@
END

 
WHILE TRUE
    WAIT 0
    R = 255
    G = 0
    B = 0
    FOR B = 0 TO 255
        WAIT 0 
        GOSUB @color
    END
    B = 255
 
    FOR R = 255 DOWNTO 0
        WAIT 0   
        GOSUB @color
    END
    R = 0
 
    FOR G = 0 TO 255
        WAIT 0 
        GOSUB @color
    END   
    G = 255
   
    FOR B = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END 
    B = 0
    FOR R = 0 TO 255
        WAIT 0
        GOSUB @color 
    END 
    R = 255 
    FOR G = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END   
    G = 0   
END

:color
While true
wait 100
        if  0C5D: samp textdraw 2054 is_exists
            then 0B67: render a 0xFF r 1@ g 2@ b 3@ to_argb 5@
            0C52: samp textdraw 2054 set_letter_size 0.349999 1.200000 color 5@

            end
end
return
 

rebootsrl

Member
Joined
Mar 16, 2014
Messages
18
Reaction score
0
0B67: render a 1@ r 2@ g 3@ b 0xFF to_argb 5@ - Texdraw always blue
0B67: render a 0xFF r 1@ g 2@ b 3@ to_argb 5@ - Texdraw always red
0B67: render a 1@ r 0xFF g 2@ b 3@ to_argb 5@ - Texdraw always red
0B67: render a 1@ r 2@ g 0xFF b 3@ to_argb 5@ - Texdraw always green

Help, now i can change the color but this colos is static
and i get this  Warning(s007): Exception 0xC0000005 at 0x588B5614 upper then {FFFFFF}SA-MP {B9C9BF}0.3z {FFFFFF}Started

Script:
Code:
{$CLEO .cs}
0000: NOP


 
WHILE TRUE
    WAIT 0
    1@ = 255
    2@ = 0
    3@ = 0
    FOR 3@ = 0 TO 255
        WAIT 0 
        GOSUB @color
    END
    3@ = 255
 
    FOR 1@ = 255 DOWNTO 0
        WAIT 0   
        GOSUB @color
    END
    1@ = 0
 
    FOR 2@ = 0 TO 255
        WAIT 0 
        GOSUB @color
    END   
    2@ = 255
   
    FOR 3@ = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END 
    3@ = 0
    FOR 1@ = 0 TO 255
        WAIT 0
        GOSUB @color 
    END 
    1@ = 255 
    FOR 2@ = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END   
    2@ = 0   
END

:color
While true
wait 100
        if  0C5D: samp textdraw 2054 is_exists
            then 0B67: render a 1@ r 2@ g 3@ b 0xFF to_argb 5@
            0C52: samp textdraw 2054 set_letter_size 0.349999 1.200000 color 5@

            end
end
return
that script makes the textdraw blue, just blue.
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Code:
{$CLEO .cs}
0000: NOP
REPEAT
    WAIT 100
UNTIL SAMP.Available()

WHILE TRUE
    WAIT 0
    1@ = 255
    2@ = 0
    3@ = 0
    FOR 3@ = 0 TO 255
        WAIT 0 
        GOSUB @color
    END
    3@ = 255
 
    FOR 1@ = 255 DOWNTO 0
        WAIT 0   
        GOSUB @color
    END
    1@ = 0
 
    FOR 2@ = 0 TO 255
        WAIT 0 
        GOSUB @color
    END   
    2@ = 255
   
    FOR 3@ = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END 
    3@ = 0
    FOR 1@ = 0 TO 255
        WAIT 0
        GOSUB @color 
    END 
    1@ = 255 
    FOR 2@ = 255 DOWNTO 0
        WAIT 0 
        GOSUB @color
    END   
    2@ = 0   
END

:color  
if  0C5D: samp textdraw 2054 is_exists
then 
    0B67: render a 1@ r 2@ g 3@ b 0xFF to_argb 5@
    0C52: samp textdraw 2054 set_letter_size 0.349999 1.200000 color 5@
end
return

Color is ABGR, so RGB inversed.
 
Status
Not open for further replies.
Top