CLEO Help Arrest nearest player

CLEO related

BTW

Member
Joined
Sep 22, 2022
Messages
11
Reaction score
0
Easly write command "/arrest [NEAREST PLAYER ID]"
So when i pres key "2" on keyboard, he will automatically arrest the nearest player to me.

Ty in advance.
 

BTW

Member
Joined
Sep 22, 2022
Messages
11
Reaction score
0
/.arrest - enable/disable
press 2 - auto-cmd "/arrest <nearest player id>"
[ML] (error) auto arrest.lua: ...m Files (x86)\Gta San Andreas\moonloader\auto arrest.lua:19: unexpected symbol near ')'
[ML] (error) auto arrest.lua: Script died due to an error. (01DC1714)

This come in sf console
 

BTW

Member
Joined
Sep 22, 2022
Messages
11
Reaction score
0
[ML] (error) auto arrest.lua: ...m Files (x86)\Gta San Andreas\moonloader\auto arrest.lua:19: unexpected symbol near ')'
[ML] (error) auto arrest.lua: Script died due to an error. (01DC1714)

This come in sf console
Fixed the error, but when I press 2, nothing is happening.
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
458
Solutions
9
Reaction score
166
Location
Poland
CLEO is better. Press 2.
Working on 0.3.7-R1 & without need SAMPFUNCS
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:
  
WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "2"
THEN
    IF 0256:   player $PLAYER_CHAR defined
    THEN
        IF 0AB1: @GetClosestPeds 0 0@
        THEN
            IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _StorePlayerID 1@
            THEN
                0AC8: 2@ = allocate_memory_size 260                
                0AD3: 2@ = format "/arrest %d" 1@           
                0AB1: @SEND_CMD 2 SampVersionID 1 Text 2@
                0AD1: show_formatted_text_highpriority "~y~%s" time 1337 2@
                0AC9: free_allocated_memory 2@
            END
        ELSE 0AD1: show_formatted_text_highpriority "~r~Player not found ~n~> 5 m" time 1337 
        END       
    END
END

END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    24.1 KB · Views: 18

BTW

Member
Joined
Sep 22, 2022
Messages
11
Reaction score
0
It's working, but what if I want to change /arrest to command?
I have only to change trought SB the "/chase %d" to something else?
 
Top