CLEO Help Player info in radius

CLEO related
Status
Not open for further replies.

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Hi, I would like a script that will work similarly to the HP car, but I would like it on the player, it will take my position, in the radius of 50m around me it will find the player and display it in their position their ID, ping and HP. Does anyone know how to write this? I would appreciate it a lot and I would love to.
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
I have this code which was originally on an HP vehicle, but there is probably a mistake somewhere in it because I don't want to display anything on the screen. Can anyone look at this, please?

PHP:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0AA8: call_function_method 6946896 struct 12694336 num_params 1 pop 0 'HJ_IS' 0@
0AA5: call 7439872 num_params 2 pop 2 0@ "Ping: ~1~ms"
0006: 1@ = 1           

:Noname_57
0001: wait 0 ms
00D6: if
0AB0:   key_pressed 101
004D: jump_if_false @Noname_221
00D6: if
0039:   1@ == 0
004D: jump_if_false @Noname_159
0ACD: show_text_highpriority "~B~Player-INFO ~G~ON" time 1337
018C: play_sound 1083 at 0.0 0.0 0.0
0006: 1@ = 1
0001: wait 250 ms
0002: jump @Noname_57

:Noname_159
0ACD: show_text_highpriority "~B~Player-INFO ~R~OFF" time 1337
018C: play_sound 1084 at 0.0 0.0 0.0
0006: 1@ = 0
0001: wait 250 ms
0002: jump @Noname_221

:Noname_221
00D6: if
0039:   1@ == 1
004D: jump_if_false @Noname_472
03F0: enable_text_draw 1
00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
00D6: if
0AE1: 31@ = random_actor_near_point 22@ 23@ 24@ in_radius 100.0 find_next 0 pass_deads 0
004D: jump_if_false @Noname_472
0050: gosub @Noname_479

:Noname_428
0AE1: 31@ = random_actor_near_point 22@ 23@ 24@ in_radius 100.0 find_next 1 pass_deads 0
004D: jump_if_false @Noname_472
0050: gosub @Noname_479
0002: jump @Noname_428

:Noname_472
0002: jump @Noname_57

:Noname_479  
00A0: store_actor 31@ position_to 2@ 3@ 4@
0AB1: call_scm_func @Noname_687 3 2@ 3@ 4@ 6@ 7@
00D6: if and
00C2:   sphere_onscreen 2@ 3@ 4@ radius 0.0
0031:   6@ >= 0.0
8021:   not  6@ > 640.0
0031:   7@ >= 0.0
8021:   not  7@ > 448.0
004D: jump_if_false @Noname_685
0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 31@ _StorePlayerID 5@        
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
033F: set_text_draw_letter_size 0.17 0.77
081C: draw_text_outline 1 RGBA 0 0 0 255
0340: set_text_draw_RGBA 255 147 20 255
045A: draw_text_1number 6@ 7@ GXT 'HJ_IS' number 5@  // Tara K. Spencer, Taron Benson,

:Noname_685
0051: return

:Noname_687
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 7392816 num_params 6 pop 6 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 12677188 size 4 virtual_protect 0
0A8D: 15@ = read_memory 12677192 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@ // (float)
0073: 13@ /= 15@ // (float)
006B: 3@ *= 12@ // (float)
006B: 4@ *= 13@ // (float)
0AB2: 2 3@ 4@ ret

:SAMPGetPlayerIDByActorHandle // 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _StorePlayerID 25@
25@ = -1
if 0AA2: 31@ = load_dynamic_library "samp.dll" // pSAMPBase // no need to Free Memory
then
    31@ += 0x21A0F8
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPInfo
    if 31@ > 0
    then
        31@ += 0x3CD
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPPools
        if 31@ > 0
        then
            31@ += 0x18
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stPlayerPool
            if 31@ > 0
            then
                if 07D6: 0@ == $PLAYER_ACTOR
                then
                    31@ += 0x4
                    0A8D: 25@ = read_memory 31@ size 2 virtual_protect 0 // sLocalPlayerID
                else
                    0A96: 26@ = ped 0@ struct
                    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // ulMaxPlayerIDStreamedOnly
                    31@ += 0x2E // pRemotePlayer[0]
                    0A8E: 29@ = 31@ + 0xFB0 // iIsListed[0]
                    for 28@ = 0 to 30@
                        0A8D: 27@ = read_memory 29@ size 4 virtual_protect 0 // iIsListed[n]
                        if 27@ == true
                        then
                            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // pRemotePlayer
                            if 27@ > 0
                            then
                                0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pPlayerData
                                if 27@ > 0
                                then
                                    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pSAMP_Actor
                                    if 27@ > 0
                                    then
                                        27@ += 0x40
                                        0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pGTA_Ped
                                        if 003B: 26@ == 27@  // Same Ped
                                        then
                                            0085: 25@ = 28@ // save this Player ID
                                            break
                                        end
                                    end
                                end
                            end
                        end
                            // next index
                        31@ += 0x4
                        29@ += 0x4
                            //
                    end
                end
            end
        end
    end
end
if 25@ >= 0
then 0485: return_true
else 059A: return_false
end
0AB2: cleo_return 1 25@

i use snippet: https://ugbase.eu/threads/samp-get-player-id-using-actor-handle.22355/
 
Last edited:
Status
Not open for further replies.
Top