CLEO Help TextDraw Disappears after Set Pos

CLEO related
Status
Not open for further replies.

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
hi guys i just wanted to change a positon of textdraw but when when i do it the textdraw disapears
i even tried set it at its original position of textdraw but still it disapears whenever this opcode applies
0C51: samp textdraw 1@ set_pos 601 352
 

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea


thanks and i found it and how can i use a snippet like this
i tried puting it in loop and got crashed and where will i enter the cords, im very noob scripter pls help

Code:
:SetTextdrawPosition
{
    0.3.7 - R1
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,123
Solutions
5
Reaction score
882
Location
Lithuania
hi guys i just wanted to change a positon of textdraw but when when i do it the textdraw disapears
i even tried set it at its original position of textdraw but still it disapears whenever this opcode applies
0C51: samp textdraw 1@ set_pos 601 352
Where is your code which you have made?
Show me how you using it in code.
 
Last edited:

blvck0v

Active member
Joined
Feb 23, 2019
Messages
97
Reaction score
51
Location
ugbase.eu
hi guys i just wanted to change a positon of textdraw but when when i do it the textdraw disapears
i even tried set it at its original position of textdraw but still it disapears whenever this opcode applies
0C51: samp textdraw 1@ set_pos 601 352
As @Parazitas says, stop giving bits of information and just say and post everything you tried here so we can undestand better.
 

Skyfer

Member
Joined
Feb 4, 2022
Messages
18
Reaction score
1
Location
North Korea
guys i fixed it without the snippet the Problem here was the cordinates must be float
im just a fucking noob damn,
it was just a timer textdraw and its position is annoying to me
the textdraw is always there on ID 40 so no need of a scanner

the old coords

601 352

the new coords

601.0 352.0

OLD CODE that makes textdraw dissapear
Code:
{$CLEO .cs}



//-------------MAIN---------------

0000: NOP

thread 'FukTimerTexdrw'


:always
wait 100

if

0C5D: samp textdraw 40 is_exists

jf @always

0C51: samp textdraw 40 set_pos 601 352

wait 3000

jump @always


New Code that works

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
thread 'FukTimerTexdrw'



:always
wait 100
if
0C5D: samp textdraw 40 is_exists
jf @always
0C51: samp textdraw 40 set_pos 601.0 352.0
wait 3000
jump @always

how did i get a integer coords ?
its from the fucking textdraw scanner that i made myself that writes textdraw coords into ini file
but it was writen in integer




how i used your snippet code
idk how to properly use a snipet


Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
thread 'tedsdwcdlear'




:counter
wait 100
if
0C5D: samp textdraw 40 is_exists
jf @counter
0AB1: @SetTextdrawPosition 40 ID 1000 XY 601 352
jump @counter


:SetTextdrawPosition
{
    0.3.7 - R1
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
jump @counter
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,123
Solutions
5
Reaction score
882
Location
Lithuania
guys i fixed it without the snippet the Problem here was the cordinates must be float
im just a fucking noob damn,
it was just a timer textdraw and its position is annoying to me
the textdraw is always there on ID 40 so no need of a scanner

the old coords

601 352

the new coords

601.0 352.0

OLD CODE that makes textdraw dissapear
Code:
{$CLEO .cs}



//-------------MAIN---------------

0000: NOP

thread 'FukTimerTexdrw'


:always
wait 100

if

0C5D: samp textdraw 40 is_exists

jf @always

0C51: samp textdraw 40 set_pos 601 352

wait 3000

jump @always


New Code that works

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
thread 'FukTimerTexdrw'



:always
wait 100
if
0C5D: samp textdraw 40 is_exists
jf @always
0C51: samp textdraw 40 set_pos 601.0 352.0
wait 3000
jump @always

how did i get a integer coords ?
its from the fucking textdraw scanner that i made myself that writes textdraw coords into ini file
but it was writen in integer




how i used your snippet code
idk how to properly use a snipet


Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
thread 'tedsdwcdlear'




:counter
wait 100
if
0C5D: samp textdraw 40 is_exists
jf @counter
0AB1: @SetTextdrawPosition 40 ID 1000 XY 601 352
jump @counter


:SetTextdrawPosition
{
    0.3.7 - R1
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
jump @counter

1. Change 40 to 3 (it's parameters count, you shouldn't touch it)
2. Change 1000 to 40 (this is where you should put your Textdraw id)
3. Delete jump @counter after snippet
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,123
Solutions
5
Reaction score
882
Location
Lithuania
guys i fixed it without the snippet the Problem here was the cordinates must be float
im just a fucking noob damn,
it was just a timer textdraw and its position is annoying to me
the textdraw is always there on ID 40 so no need of a scanner

Since problem solved, thread will be closed.
 
Status
Not open for further replies.
Top