CLEO Help Arrest a player which is nearest you.

CLEO related
Status
Not open for further replies.

Anonymou5

Active member
Joined
Nov 7, 2015
Messages
82
Reaction score
2
How to make a cleo with a command which do a thing to a nearest player to you. 

I need a thing with it like /arrest but command should be /ant make someone have a thing with it and could replace the /arrest with /ant ?
 

opce

Active member
Joined
Dec 11, 2014
Messages
61
Reaction score
0
lol, i'm dead

LT
jeigu tu ieškai, kad su NUM4 NUM1 užrakintu žaidėją ir atrištu jį tai aš turiu tokius .cleo modus.  :fuck_yea:
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
Anonymou5 said:
How to make a cleo with a command which do a thing to a nearest player to you. 

I need a thing with it like /arrest but command should be /ant make someone have a thing with it and could replace the /arrest with /ant ?

va lukai prasau, imk dalele is mano anti aimo ir panaudok jei sugebesi
Code:
IF
056D: actor $PLAYER_ACTOR defined 
THEN 
00A0: store_actor $PLAYER_ACTOR position_to 13@ 14@ 15@ 
10@ = 100.0 //minimal distance
12@ = false //to check if there are any players around at all
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@
00A0: store_actor 31@ position_to 16@ 7@ 8@
050A: 9@ = distance_between_XYZ 13@ 14@ 15@ and_XYZ 16@ 7@ 8@
IF AND
0025:   10@ > 9@ 
0021:   9@ > 0.2 
THEN
0087: 10@ = 9@ // (float) to save the new closest distance found
0085: 11@ = 31@ // (int) to save the new closest player found
12@ = true
END
END
END
END
  
IF 
12@ == true
THEN
IF
10@ <= 5.0
THEN
1@ = FALSE
ELSE
1@ = TRUE
END
END
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
idk
Code:
{$CLEO .cs}
0000: NOP
0B34: samp register_client_command "ant" to_label @cmd_mycmd

WHILE TRUE
    wait 0
    if 
    0@ == 1
    then
        0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 1@ closest_ped_to 2@
        if
        056D:   actor 2@ defined
        then
            0B2B: samp 3@ = get_player_id_by_actor_handle 2@
            0AF9: samp say_msg "/arrest %d" 3@
            wait 100
            0@ = 0
        end
    end
  END      
  
:cmd_mycmd
0@ = 1
0B43: samp cmd_ret

            

[attachment=5352]
 

Attachments

  • arrest.cs
    17.8 KB · Views: 22
Joined
Dec 31, 2015
Messages
712
Reaction score
27
noob213 said:
idk
Code:
{$CLEO .cs}
0000: NOP
0B34: samp register_client_command "ant" to_label @cmd_mycmd

WHILE TRUE
    wait 0
    if 
    0@ == 1
    then
        0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 1@ closest_ped_to 2@
        if
        056D:   actor 2@ defined
        then
            0B2B: samp 3@ = get_player_id_by_actor_handle 2@
            0AF9: samp say_msg "/arrest %d" 3@
            wait 100
            0@ = 0
        end
    end
  END      
  
:cmd_mycmd
0@ = 1
0B43: samp cmd_ret

            

0AB5 doesn't work in MP
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,121
Solutions
5
Reaction score
882
Location
Lithuania
Fucking shit ...
Simple code...

PHP:
{$CLEO .cs}
0000:
  
  
REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 
  
  
WHILE TRUE
    WAIT 0   
IF
056D:   actor $PLAYER_ACTOR defined 
THEN
WAIT 0 
// GET ALL STREAMED 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 AND
            803B:   31@ == $PLAYER_ACTOR  // (int)
            056D:   actor 31@ defined
            THEN
                0B2B: samp 0@ = get_player_id_by_actor_handle 31@
                0B36: samp 8@ = get_player_nickname 0@ 
                00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
                00A0: store_actor 31@ position_to 4@ 5@ 6@
                0509: 7@ = distance_between_XY 1@ 2@ and_XY 4@ 5@
                IF
                7@ <= 6.0 /// If distance smaller 6 then... , max 300.
                THEN
                    IF
                    0AB0: 51 {Key 3} // if press KeyBoard Number 3 then..
                    THEN
                        say "/ant %s" 8@
                        wait 3000 // Anti spam command
                    END    
                END
           END 
       END
   END
   END
END  
Key codes..:
https://www.gta-modding.com/san_andreas/tutorials/virtual_key_codes.html
 
Status
Not open for further replies.
Top