CLEO Help Need a function help

CLEO related
Status
Not open for further replies.

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
Hello, i want to read a textdraw (not string) but sampfunc only supports to read strings (0C5A: samp textdraw 0@ get_string_to 1@). Is there any way to read integer?

Thanks in advance
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Can you post an example on how you used them both?
Here's a mini example.

Code:
0AC8: 0@ = 255
IF 0C5D: samp textdraw 1337 exists
THEN 
    0C5A: samp textdraw 1337 get_string_to 0@
    0C1A: 1@ = 0@
    //IF 0AD4: $nul = scan 0@ "%d" 1@
    //THEN
    0AF8: "text to int -> %d" -1 1@
    //END
END
0AC9: 0@

0C1A will convert to integer, but with 0AD4 you can extract integers from strings.
 

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
I use this, it was your example on another topic which i saw.

Code:
WHILE TRUE
wait 0
if 0ADC: "so"
then
    if 0C5D: samp textdraw 1337 is_exists
    then 
        0C5A: samp textdraw 1337 get_string_to 1@
        0AD4: 2@ = scan_string 1@ format "%d" 3@ //IF and SET
        0AF8: show_msg "%d" -1 3@
    end
end
END
 
Status
Not open for further replies.
Top