CLEO Help Delete a textdraw with a specific text.

CLEO related
Status
Not open for further replies.

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
So basically I'm trying to delete a textdraw that has a specific text as soon as samp is ready, I have been converting one of my LUA mods to a CLEO and this is the last bit that I can't get to work.

Here's my LUA code so that you can get an idea of what I'm trying to do:

(under my loop)
PHP:
if removeCount ~= 3 then deleteServerSide() end

(outside my loop)
PHP:
function deleteServerSide()
    for i = 0, 2500 do
        if string.len(sampTextdrawGetString(i)) < 2 and not string.find(sampTextdrawGetString(i), "'") then
            sampTextdrawDelete(i) 
            removeCount = removeCount+1
        end
    end
end

So I'm trying to delete the first 3 textdraws that have the text ' and only the first 3.

Works perfect in LUA but I'm getting close to giving up on the CLEO version, I can't work it out.

Any help would be amazing, tah.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
So basically I'm trying to delete a textdraw that has a specific text as soon as samp is ready, I have been converting one of my LUA mods to a CLEO and this is the last bit that I can't get to work.

Here's my LUA code so that you can get an idea of what I'm trying to do:

(under my loop)
PHP:
if removeCount ~= 3 then deleteServerSide() end

(outside my loop)
PHP:
function deleteServerSide()
    for i = 0, 2500 do
        if string.len(sampTextdrawGetString(i)) < 2 and not string.find(sampTextdrawGetString(i), "'") then
            sampTextdrawDelete(i)
            removeCount = removeCount+1
        end
    end
end

So I'm trying to delete the first 3 textdraws that have the text ' and only the first 3.

Works perfect in LUA but I'm getting close to giving up on the CLEO version, I can't work it out.

Any help would be amazing, tah.

Hi there, if you need it for CLEO, that's how you can do it:

Code:
if 0@ == RPC_SCRTEXTDRAWSETSTRING // or better use RPC_SCRSHOWTEXTDRAW
then                                         
    0BE5: raknet 1@ = get_hook_param 0
    0BE7: raknet 2@ = bit_stream_read 1@ type 2 // Textdraw ID
    0BE7: raknet 3@ = bit_stream_read 1@ type 2
  
    if 2@ == 69 // We will get the string of 69 textdraw
    then
        0AC8: 4@ = allocate_memory_size 260
        0BE8: raknet bit_stream 1@ read_array 4@ size 3@
        0C0D: struct 4@ offset 3@ size 1 = 0
    
        // Now we got the textdraw string
        0AC9: free_allocated_memory 4@
    end
end

If you don't know the ID of textdraw, you can make a loop for all textdraws
 
Status
Not open for further replies.
Top