[SNIPPET] For All Peds

// 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@
        // GOT THE PED.
    end
end
// FOR ALL PEDS END
 

lol7

Active member
Joined
Apr 3, 2013
Messages
120
Reaction score
1
Location
Blumenau, Santa Catarina, Brasil
Re: For All Peds

Opcode.eXe link said:
// 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@
        // GOT THE PED.
    end
end
// FOR ALL PEDS END
I think my asking is nooby, but does it just get ped streamed?
 

TheZeRots

Expert
Joined
Dec 21, 2013
Messages
1,247
Reaction score
1
Re: For All Peds

Wait, ppl just confused me - what exactly does it do?
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Re: For All Peds

Searches through the pedPool. Gettin' all streamed peds.
 

Grubitsh

Active member
Joined
Jul 28, 2014
Messages
104
Reaction score
0
Re: For All Peds

This @31 is like "$player_actor" from another player in SAMP ?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Example:
PHP:
if
0AB1: @GetClosestPeds 0 31@
then
    00A0: store_actor 31@ position_to 26@ 27@ 28@
    06D5: 29@ = create_racing_checkpoint_at 26@ 27@ 28@ point_to 26@ 27@ 28@ type 2 radius 1.0
    wait 5000
    06D6: disable_racing_checkpoint 29@
end

Snippet:
PHP:
:GetClosestPeds
20@ = 9999.0
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
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
        056D:   actor 31@ defined
        803B:   31@ == $PLAYER_ACTOR // not my ped
        then
            04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
            04C4: store_coords_to 7@ 8@ 9@ from_actor 31@ with_offset 0.0 0.0 0.0
            0509: 10@ = distance_between_XY 4@ 5@ and_XY 7@ 8@
            if
            0025:   20@ > 10@  // (float)
            then
                0087: 20@ = 10@ // (float)
                8085: 2@ = 31@ // (int)
            end
        end
    end
end
if
056D:   actor 2@ defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 1 2@
 
Last edited:
Top