CLEO Help How to edit textdraw... like /editpi

CLEO related
Status
Not open for further replies.

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
I want to know how to move something ( i want textdraw) like /editpi of Player informer, i want  to do to that code...

{$CLEO .cs}
0000:
REPEAT
    WAIT 0
UNTIL 0AFA: SAMP IS READY

0B6D: 31@ CREATE_FONT "BigText" HEIGHT 20 FLAGS 0x4

WHILE TRUE
WAIT 0
    0AC8: 0@ = allocate_memory_size 260
    0209: 1@ = random_int_in_ranges 1 9999
    0AD3: 0@ = "Why does Springfield abuse me :(? %d" 1@
    0B6F: FONT 31@ draw_text 0@ pos 350 350 color 0xFFF00000
    0AC9: free_allocated_memory 0@
END
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
IDK how to do that, but you can get the X, Z position of the text while you are in-game :looky:.
Use this script:
{$CLEO}

0000: NOP

{
////////////////////
//Made by TH3RM4L.//
//Visit ugbase.eu///
////////////////////
}

:START                 
wait 0
03F0: enable_text_draw 1
31@ = false
4@ = 0.0
6@ = 0.0
jump @UP

:UP
wait 0
if
0AB0: 98
jf @MAIN
000B: 6@ += 1.0
31@ = true
jump @MAIN

:DOWN
wait 0
if
0AB0: 104
jf @RIGHT
000F: 6@ -= 1.0
31@ = true
jump @MAIN

:RIGHT
wait 0
if
0AB0: 102
jf @LEFT
000B: 4@ += 1.0
31@ = true
jump @MAIN

:LEFT
wait 0
if
0AB0: 100
jf @UP
000F: 4@ -= 1.0
31@ = true
jump @MAIN

:MAIN
wait 0
if
31@ == true
jf [member=5997]Down[/member]
033F: set_text_draw_letter_size 0.5 1.0
081C: draw_text_outline 1 RGBA 0 0 0 255
0AA8: call_function_method 6946896 struct 12694336 num_params 1 pop 0 'BJ_PUSH' 1@ 
0AA5: call 7439872 num_params 2 pop 2 1@ "TEXT" 
033E: set_draw_text_position 4@ 6@ GXT 'BJ_PUSH'
printf "X: %f Z: %f" 3000 4@ 6@
31@ = false
jump [member=5997]Down[/member]
NUMPAD 8 = the text will go up
NUMPAD 2 = the text will go down
NUMPAD 4 = the text will go left
NUMPAD 6 = the text will go right

printf shows you the X,Z pos., so don't delete it.

Once you placed the text where you wanted, remember the pos. or take a screenshoot of it.
Then replace 4@ and 6@ with the pos. and make another cleo using only the MAIN script, like this:

:a
wait 0
033F: set_text_draw_letter_size 0.5 1.0
081C: draw_text_outline 1 RGBA 0 0 0 255
0AA8: call_function_method 6946896 struct 12694336 num_params 1 pop 0 'BJ_PUSH' 1@ 
0AA5: call 7439872 num_params 2 pop 2 1@ "TEXT" 
033E: set_draw_text_position 260.0 17.0 GXT 'BJ_PUSH'
jump @a
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
TH3RM4L link said:
IDK how to do that, but you can get the X, Z position of the text while you are in-game :looky:.
Use this script:
{$CLEO}

0000: NOP

{
////////////////////
//Made by TH3RM4L.//
//Visit ugbase.eu///
////////////////////
}

:START                 
wait 0
03F0: enable_text_draw 1
31@ = false
4@ = 0.0
6@ = 0.0
jump @UP

:UP
wait 0
if
0AB0: 98
jf @MAIN
000B: 6@ += 1.0
31@ = true
jump @MAIN

:DOWN
wait 0
if
0AB0: 104
jf @RIGHT
000F: 6@ -= 1.0
31@ = true
jump @MAIN

:RIGHT
wait 0
if
0AB0: 102
jf @LEFT
000B: 4@ += 1.0
31@ = true
jump @MAIN

:LEFT
wait 0
if
0AB0: 100
jf @UP
000F: 4@ -= 1.0
31@ = true
jump @MAIN

:MAIN
wait 0
if
31@ == true
jf [member=5997]Down[/member]
033F: set_text_draw_letter_size 0.5 1.0
081C: draw_text_outline 1 RGBA 0 0 0 255
0AA8: call_function_method 6946896 struct 12694336 num_params 1 pop 0 'BJ_PUSH' 1@ 
0AA5: call 7439872 num_params 2 pop 2 1@ "TEXT" 
033E: set_draw_text_position 4@ 6@ GXT 'BJ_PUSH'
printf "X: %f Z: %f" 3000 4@ 6@
31@ = false
jump [member=5997]Down[/member]
NUMPAD 8 = the text will go up
NUMPAD 2 = the text will go down
NUMPAD 4 = the text will go left
NUMPAD 6 = the text will go right

printf shows you the X,Z pos., so don't delete it.

Once you placed the text where you wanted, remember the pos. or take a screenshoot of it.
Then replace 4@ and 6@ with the pos. and make another cleo using only the MAIN script, like this:

:a
wait 0
033F: set_text_draw_letter_size 0.5 1.0
081C: draw_text_outline 1 RGBA 0 0 0 255
0AA8: call_function_method 6946896 struct 12694336 num_params 1 pop 0 'BJ_PUSH' 1@ 
0AA5: call 7439872 num_params 2 pop 2 1@ "TEXT" 
033E: set_draw_text_position 260.0 17.0 GXT 'BJ_PUSH'
jump @a
i don't see any text with the script you put, so if i try to move with that numbers, nothing get moved, so idk what to do, anyways springfield are only...
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
:urtheman: Open the CHATBOX with T and then the TEXT will be at your cursors position!

Code:
{$CLEO .cs}
0000:
REPEAT
    WAIT 0
UNTIL 0AFA: SAMP IS READY

0B6D: 31@ CREATE_FONT "BigText" HEIGHT 20 FLAGS 0x4
10@ = 400
11@ = 400

WHILE TRUE
WAIT 0
    0AC8: 0@ = allocate_memory_size 260
    0209: 1@ = random_int_in_ranges 1 9999
    0AD3: 0@ = "Why does Springfield abuse me :(? %d" 1@
    0B6F: FONT 31@ draw_text 0@ pos 10@ 11@ color 0xFFF00000
    0AC9: free_allocated_memory 0@
    IF
    0B21: 	samp is_chat_opened
    THEN
        0B5E: get_cursor_pos 10@ 11@
        0AD1: show_formatted_text_highpriority "TEXTPOS: %d x %d" time 100 10@ 11@
    END
END
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
Opcode.eXe link said:
:urtheman: Open the CHATBOX with T and then the TEXT will be at your cursors position!

Code:
{$CLEO .cs}
0000:
REPEAT
    WAIT 0
UNTIL 0AFA: SAMP IS READY

0B6D: 31@ CREATE_FONT "BigText" HEIGHT 20 FLAGS 0x4
10@ = 400
11@ = 400

WHILE TRUE
WAIT 0
    0AC8: 0@ = allocate_memory_size 260
    0209: 1@ = random_int_in_ranges 1 9999
    0AD3: 0@ = "Why does Springfield abuse me :(? %d" 1@
    0B6F: FONT 31@ draw_text 0@ pos 10@ 11@ color 0xFFF00000
    0AC9: free_allocated_memory 0@
    IF
    0B21: 	samp is_chat_opened
    THEN
        0B5E: get_cursor_pos 10@ 11@
        0AD1: show_formatted_text_highpriority "TEXTPOS: %d x %d" time 100 10@ 11@
    END
END
Works, omfg...

Thermal u script works too.

opcode one question, i can change that textdraw to a all font i want, for example, i want this font....
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Nope. You can only choose between these as i know:

FCR_NONE = 0x0
FCR_BOLD = 0x1 (жирный)
FCR_ITALICS = 0x2 (курсив)
FCR_BORDER = 0x4 (с обводкой)
FCR_SHADOW = 0x8 (с тенью)
FCR_UNDERLINE = 0x10 (подчеркнутый)
FCR_STRIKEOUT = 0x20 (зачеркнутый)
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
Not solved, if i press to write it moves to center, so i want with /edit or any other sampfuncs command pls opcodeee :(
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
:hellno: You didnt get it, right?
You need to join the game once, press T and move the text where u want it.
Then copy the cordinates u see on your screen and paste it into the .cs , then compile it..
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
625
Reaction score
39
Opcode.eXe link said:
:hellno: You didnt get it, right?
You need to join the game once, press T and move the text where u want it.
Then copy the cordinates u see on your screen and paste it into the .cs , then compile it..
OHHHH, it's like thermal say, good, but i think you didnt get what i say at first, i want like your script do, move that text, but stay where i move, and do this with command, no when chat is opened, because if i want to write, it moves... anyway i think will work with that, i will put the x/y coords where i need the textdrawy and done.
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
omg, 1/0 as in true/false

0B5D: samp toggle_cursor 1 //LE MOUSE CURSOR SHOWS  :youdontsay:
0B5D: samp toggle_cursor 0 // NO MOUSE CURSOR, OPCODE STOLE IT  :eek:hgodwhy:
 
Status
Not open for further replies.
Top