CLEO Help Short Help GTA SAN Andreas

CLEO related
Status
Not open for further replies.

Coldnew

Member
Joined
Jan 2, 2015
Messages
5
Reaction score
0
I need someone to script a CLEO Code;

If someone kills me over 3 Times he will get killed, after that it will be resettet.


Why ?

I need that Code for learning to handle with pid, and variables.

Would be very cool if someones does that
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,493
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Code:
{$CLEO .cs}
0000:
0@ = 0 // reset counter



WHILE TRUE
    WAIT 0
    
    
    IF
    0118:   actor $PLAYER_ACTOR dead
    THEN
        0@ += 1 // increase counter
        REPEAT
            WAIT 1000
        UNTIL 8118: not actor $PLAYER_ACTOR dead   
        
        IF
        0@ >= 3 // death counter is 3 or bigger 
        THEN
            0AD1: show_formatted_text_highpriority "You died %d times! Resetting counter.." time 1000 0@
            0@ = 0 // reset counter       
        END   
    END


END
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
17
Location
Romania
I need someone to script a CLEO Code;

If someone kills me over 3 Times he will get killed, after that it will be resettet.


Why ?

I need that Code for learning to handle with pid, and variables.

Would be very cool if someones does that


that's really hard lmao
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,493
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
What i did:
Get the name of the last player that attacked you. ( It must be the one that kills you.)
Assing a global variable to the nickname to keep the kill count.
If you are dead it gets last players nickname, increates the values by one and
then checks if its equal to 3...

Code:
{$CLEO .cs}
0000:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY


WHILE TRUE
    WAIT 0

    // FOR ALL PEDS     
    0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
    000A: 29@ += 0x4
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 35584 step 0x100
        0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
        000A: 29@ += 0x1
        if and
            0029:  31@ >= 0x00
            001B:  0x80 > 31@
        then
            005A: 31@ += 30@
            IF
            051A:   actor $PLAYER_ACTOR damaged_by_actor 31@
            THEN
                0B2B: samp 5@ = get_player_id_by_actor_handle 31@
                0B36: samp 6@ = get_player_nickname 5@
                0BFC: set_global_var "LastDmgFrom" = 6@
            END
        end
    end


    
    IF
    0118:   actor $PLAYER_ACTOR dead
    THEN
        0BFD: 7@ = get_global_var "LastDmgFrom"
        0BFD: 8@ = get_global_var  7@ // get kill counter value from killers nickname
        8@ += 1 // increase by one
        0BFC: set_global_var 7@ = 8@ // set new value       
        IF
        8@ >= 3 // death counter is 3 or bigger
        THEN
            0BFC: set_global_var 7@ = 0 // set nicknames counter to 0
            0AD1: show_formatted_text_highpriority "You got killed by %s 3x! Resetting counter.." time 1000 7@
        END
        
        REPEAT
            WAIT 1000
        UNTIL 8118: not actor $PLAYER_ACTOR dead                   
    END


END
 
Status
Not open for further replies.
Top