Help Help with cleo

Status
Not open for further replies.

easanchez

Member
Joined
Nov 1, 2023
Messages
7
Reaction score
0
Location
Canada
Hi, I found this code that by typing "/textdraw" removes all textdraws from the server. The problem is that I want it to be able to be activated and deactivated, that is, when using "/textdraw" they disappear, and when used again they appear again. it's possible?



{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "textdraw" @txd
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:txd
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
0C5E: samp textdraw 1@ delete
end
free 2@
end
end
0B43: samp cmd_ret
 
Solution
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "txdhide" @TxdHide
0B34: "txdshow" @TxdShow
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:TxdHide
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
0B43: samp cmd_ret

:TxdShow
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State True
end
0B43: samp cmd_ret

:SetTextdDrawState
{
    0.3.7 R1
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@...

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "textdraw" @txd
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:txd
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
free 2@
end
end
0B43: samp cmd_ret

:SetTextDrawState
{
    0.3.7 - R1
    0AB1: @SetTextDrawState 2 TextDrawID 0@ State False
}
0AA2: 31@ = load_library "samp.dll"
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@
0A8C: writeMem 31@ sz 1 vl 1@ vp 1 
0AB2: 0
 

easanchez

Member
Joined
Nov 1, 2023
Messages
7
Reaction score
0
Location
Canada
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "textdraw" @txd
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:txd
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
free 2@
end
end
0B43: samp cmd_ret

:SetTextDrawState
{
    0.3.7 - R1
    0AB1: @SetTextDrawState 2 TextDrawID 0@ State False
}
0AA2: 31@ = load_library "samp.dll"
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@
0A8C: writeMem 31@ sz 1 vl 1@ vp 1
0AB2: 0
I appreciate your help, the's cleo compiled correctly. When you enter the game and use /textdraw they clearly all disappear, but when you use it again they don't reappear Is there any other solution for this problem?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I appreciate your help, the's cleo compiled correctly. When you enter the game and use /textdraw they clearly all disappear, but when you use it again they don't reappear Is there any other solution for this problem?

PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "txdhide" @TxdHide
0B34: "txdshow" @TxdShow
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:TxdHide
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
free 2@
end
end
0B43: samp cmd_ret

:TxdShow
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State True
end
free 2@
end
end
0B43: samp cmd_ret

:SetTextDrawState
{
    0.3.7 - R1
    0AB1: @SetTextDrawState 2 TextDrawID 0@ State False
}
0AA2: 31@ = load_library "samp.dll"
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@
0A8C: writeMem 31@ sz 1 vl 1@ vp 1
0AB2: 0


I have done codes using phone...

This weak crappy code, but i not gonna waste time to make it better.
 

easanchez

Member
Joined
Nov 1, 2023
Messages
7
Reaction score
0
Location
Canada
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "txdhide" @TxdHide
0B34: "txdshow" @TxdShow
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:TxdHide
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
free 2@
end
end
0B43: samp cmd_ret

:TxdShow
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
if
0C5D: samp textdraw 1@ is_exists
then
alloc 2@ = 1024
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: 3@ = stristr string1 2@ string2 0@
then
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State True
end
free 2@
end
end
0B43: samp cmd_ret

:SetTextDrawState
{
    0.3.7 - R1
    0AB1: @SetTextDrawState 2 TextDrawID 0@ State False
}
0AA2: 31@ = load_library "samp.dll"
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@
0A8C: writeMem 31@ sz 1 vl 1@ vp 1
0AB2: 0


I have done codes using phone...

This weak crappy code, but i not gonna waste time to make it better.
Hello, it still doesn't work and I don't understand why.

 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "txdhide" @TxdHide
0B34: "txdshow" @TxdShow
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:TxdHide
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
0B43: samp cmd_ret

:TxdShow
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State True
end
0B43: samp cmd_ret

:SetTextdDrawState
{
    0.3.7 R1
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@
    0A8E: 30@ = 31@ + 0x2400 // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 
Solution

easanchez

Member
Joined
Nov 1, 2023
Messages
7
Reaction score
0
Location
Canada
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0afa: samp_is_ready

0B34: "txdhide" @TxdHide
0B34: "txdshow" @TxdShow
0AF8: samp add_message_to_chat "[CLEO TextDraw]: {FFFFFF}by {D01686}Bladee Herrera{FFFFFF}!" color -1

while true
wait 0
end

:TxdHide
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State False
end
0B43: samp cmd_ret

:TxdShow
0B35: samp 0@ = get_last_command_params
for 1@ = 0 to 2304
    0AB1: @SetTextDrawState 2 TextDrawID 1@ State True
end
0B43: samp cmd_ret

:SetTextdDrawState
{
    0.3.7 R1
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@
    0A8E: 30@ = 31@ + 0x2400 // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
I thank you, this time it worked. Thank you!
 
Status
Not open for further replies.
Top