help with blackjack

davidhomosdean

Новичок
Автор темы
10
0
Код:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:


WHILE TRUE
WAIT 0
    IF
        0C5D: samp textdraw 2091 is_exists
THEN
ALLOC 1@ = 1024
0C5A: samp textdraw 2091 get_string_to 1@
0AC8: 2@ = allocate_memory_size 260
0AB1: @get_digits_to_print param_count 2 text 1@ memory_to_store_digits_as_text 2@
IF 2@ <= 16
then
wait 100
0BCA: samp send_click_textdraw 14
wait 100
0c8f: samp process_chat_input "/bjhit"
else
0c8f: samp process_chat_input "/bjstand"
END
end
END

    :get_digits_to_print
{
0@ = text
1@ = pointer to memory where digits will be stored as text
}
0C17: 31@ = strlen 0@
for 30@ = 0 to 31@
0085: 29@ = 0@ // copy pointer
005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
if and
28@ >= 0x30 // '0'
28@ <= 0x39 // '9'
then
0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
1@ += 1 // move to next address
end
end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

hello i made this but it s not working
the cleo above is a blackjack script this is the photo i am interested in textdraw 2091 which is PLAYER: 14
i want when i will have PLAYER number lower than 14 to execute 0c8f: samp process_chat_input "/bjhit", and if it is more than 14 execute 0c8f: samp process_chat_input "/bjstand" but i cant make it work
please help me i cant figure it out
 

D3.Pheonix

🎹
Модератор
2,813
1,592
try this:
CLEO:
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:

WHILE TRUE
WAIT 0
    IF
    0C5D: samp textdraw 2091 is_exists
    THEN
    ALLOC 1@ = 156
    0C5A: samp textdraw 2091 get_string_to 1@
    0AA5: call 0x8220AD num_params 3 pop 3 params 2@v "PLAYER: %d" 1@
        IF 
        2@ < 14
        then
        wait 100
        0BCA: samp send_click_textdraw 14
        wait 100
        0c8f: samp process_chat_input "/bjhit"
        else
        0c8f: samp process_chat_input "/bjstand"
        END
    free 1@
    end
END