CLEO Help Auto chat-detector.

CLEO related
Status
Not open for further replies.

couldnot

Active member
Joined
Dec 24, 2018
Messages
25
Reaction score
1
I'm working on Auto accept weapons script, but it seems that it's not working, cat anyone help me resolve this.

Code:
0BE3: raknet setup_incoming_rpc_hook @chat_detector
0b34: "autoaccept" @GangHelp_1005


:GangHelp_1005
 if 19@ == 1
then
    chatmsg "{FFFFFF}Functia AutoAccept este acum {ff0900}OFF{FFFFFF}, vei accepta arme manual{FFFFFF}." -1
    19@ = 0
else
    chatmsg "{FFFFFF}Functia AutoAccept este acum {3bb44a}ON{FFFFFF}, vei accepta armele in mod automat{FFFFFF}." -1
    19@ = 1
end
0B43: samp cmd_ret

:chat_detector
0BE5: raknet 0@ = get_hook_param 1
if and
19@ == 1
0@ == 93
then
    0AB1: @GET 2 var_number 2 var_size 4 receiver 25@
    if 25@ == 1
    then
              
        if or
            0AD4: 33@ = scan_string 4@ format "* Arms Dealer %*s offered you a %*s for %*s Use (/accept gun %d)." 17@
            0AD4: 33@ = scan_string 4@ format "* Arms Dealer %*s offered you a %*s %*s for %*s Use (/accept gun %d)." 17@
            0AD4: 33@ = scan_string 4@ format "* Distribuitorul de arme %*s ti-a oferit un %*s pentru %*s Scrie (/accept gun %d)." 17@
            0AD4: 33@ = scan_string 4@ format "* Distribuitorul de arme %*s ti-a oferit un %*s %*s pentru %*s Scrie (/accept gun %d)." 17@
        then   
            say "/ag %d" 17@
        end                                 
    
    end   
    0AC9: free_allocated_memory 4@
end
0BE0: raknet hook_ret true

:GET
0AC6: 3@ = get_label_pointer @MEMORY
int 0@ *= 4
int 3@ += 0@
0A8D: 2@ = read_memory 3@ size 1@ virtual_protect 0
ret 1 2@

:MEMORY
hex
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
end
 

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:

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    0AC8: 4@ = allocate_memory_size 260
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 4@
    if
    0C29: 5@ = stristr string1 4@ string2 "(/accept gun"
    then
        0AC8: 6@ = allocate_memory_size 260
        0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 6@
        chatmsg "%s" -1 6@
    end
end

end

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text
}
5@ = FALSE // inbracket
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end
 
        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END
 
        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

: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
 
Status
Not open for further replies.
Top