CLEO Help Auto Accept gun

CLEO related

Ariya9473

Active member
Joined
Dec 7, 2014
Messages
59
Reaction score
0
Hi i need a auto accept gun cleo mod
when someone near me gose to sell me a gun i will get massages like this:
  • Arms Dealer Rustam offered you a Desert Eagle for 1$. Use (/accept gun 523). //// 523 is the player id in server
  • Arms Dealer Dark offered you a M4 for 1$. Use (/accept gun 523). ////
after i seen this masage i will send /accept gun 523 to accept that gun
i seen some one used this cods for cleo mod but i can't compelete it
if or
0AD4: 33@ = scan_string 4@ format "* Arms Dealer %*s offered you a %*s for %*s Use (/accept gun %d)." 12@
0AD4: 33@ = scan_string 4@ format "* Arms Dealer %*s offered you a %*s %*s for %*s Use (/accept gun %d)." 12@
0AD4: 33@ = scan_string 4@ format "* Distribuitorul de arme %*s ti-a oferit un %*s pentru %*s Scrie (/accept gun %d)." 12@
0AD4: 33@ = scan_string 4@ format "* Distribuitorul de arme %*s ti-a oferit un %*s %*s pentru %*s Scrie (/accept gun %d)." 12@
then
say "/ag %d" 12@
end


some one can help me?
 

Ariya9473

Active member
Joined
Dec 7, 2014
Messages
59
Reaction score
0
i need this mod for 1. Samp 0.3.7 R1
This is all the chats you can receive for accepting gun:
  • Arms Dealer [uV]Ariya2 offered you a Desert Eagle for 1$. Use (/accept gun 523).
  • Arms Dealer [uV]Ariya2 offered you a M4 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Silenced Pistol for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Shotgun for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a MP5 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a AK47 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Rifle for 1$. Use (/accept gun 264).
The only thing that changes is the id at the end of the /accept gun {player id}
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
i need this mod for 1. Samp 0.3.7 R1
This is all the chats you can receive for accepting gun:
  • Arms Dealer [uV]Ariya2 offered you a Desert Eagle for 1$. Use (/accept gun 523).
  • Arms Dealer [uV]Ariya2 offered you a M4 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Silenced Pistol for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Shotgun for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a MP5 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a AK47 for 1$. Use (/accept gun 264).
  • Arms Dealer [uV]Ariya2 offered you a Rifle for 1$. Use (/accept gun 264).
The only thing that changes is the id at the end of the /accept gun {player id}

PHP:
{$CLEO .cs}

0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

0B34: samp register_client_command "aa" to_label @cmd_mycmd

WHILE TRUE
WAIT 0

IF AND
31@ = = TRUE 
0B61:  samp is_local_player_spawned
THEN
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    IF 0C29: 4@ = stristr string1 0@ string2 "/accept gun"
    THEN
        0AC8: 5@ = allocate_memory_size 1024
        0AB1: @DeleteColorCodeFromText 2 text 4@ memory_to_store_characters_as_text 5@
        0AC8: 6@ = allocate_memory_size 260
        0AB1: @get_digits_to_print param_count 2 text 5@ memory_to_store_digits_as_text 6@
        IF 30@ == FALSE
        THEN
            30@ = TRUE
            SAY "/ag %d" 6@
            32@ = 0
        END
        
        IF 30@ == TRUE
        THEN
            IF 32@ >= 2000 // 2 sec delay
            THEN
                30@ = FALSE
            END
        END
    END
END        

END

:CMD
IF 31@ == FALSE
THEN
    31@ = TRUE
    0AD1: "~A~Auto Accept ~G~ON"
ELSE
    31@ = FALSE
    0AD1: "~A~Auto Accept ~R~OFF"
END
0B43: samp cmd_ret


:DeleteColorCodeFromText
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @DeleteColorCodeFromText 2 text 0@ memory_to_store_characters_as_text 1@
}
5@ = FALSE // inbracket
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 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
        
        IF 5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        END
        
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ 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
 
Top