Get Radar Blip Info

Example
PHP:
{$CLEO .cs}

0000:

wait 8500

while true
wait 0

if
0256:   player $PLAYER_CHAR defined
then
    for 0@ = 0 to 175 // from 0 to max blip
        0AB1: @GetRadarBlipInfo 1 BlipID 0@ _Return: ColorID 1@ RGB 2@ 3@ 4@ XYZ 5@ 6@ 7@ IconID 8@
        if
        8@ == 0 // Square/Triangle - mostly used to mark checkpoint or any place in server by owner
        then
            if
            00DF:   actor $PLAYER_ACTOR driving
            then
                03C0: 9@ = actor $PLAYER_ACTOR car
                00AE: set_car 9@ traffic_behaviour_to 2
                00A7: car 9@ drive_to 5@ 6@ 7@
            end
        end
    end
end

end

:GetRadarBlipInfo
{
    0AB1: @GetRadarBlipInfo 1 BlipID 0@ _Return: ColorID 1@ RGB 2@ 3@ 4@ XYZ 5@ 6@ 7@ IconID 8@
}
0A90: 1@ = 0@ * 0x28 // int
000A: 1@ += 0xBA86F0
0A8E: 31@ = 1@ + 0 // DWORD dwColourID
0A8D: 2@ = read_memory 31@ size 4 virtual_protect 0

// Get blip color RGB from color id
0A90: 30@ = 2@ * 4 // int
000A: 30@ += 0xBAB22C
0A8D: 3@ = read_memory 30@ size 1 virtual_protect 0 // R
000A: 30@ += 1
0A8D: 4@ = read_memory 30@ size 1 virtual_protect 0 // G
000A: 30@ += 1
0A8D: 5@ = read_memory 30@ size 1 virtual_protect 0 // B
// End of RGB

0A8E: 31@ = 1@ + 8 // PosX (float)
0A8D: 6@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 12 // PosY  (float)
0A8D: 7@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 16 // PosZ  (float)
0A8D: 8@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 36 // BYTE byteIconID
0A8D: 9@ = read_memory 31@ size 1 virtual_protect 0

0AB2: ret 8 2@ 3@ 4@ 5@ 6@ 7@ 8@ 9@

Marker/Radar/Blip icon id's
https://wiki.sa-mp.com/wiki/MapIcons

Snippet
PHP:
:GetRadarBlipInfo
{
    0AB1: @GetRadarBlipInfo 1 BlipID 0@ _Return: ColorID 1@ RGB 2@ 3@ 4@ XYZ 5@ 6@ 7@ IconID 8@
}
0A90: 1@ = 0@ * 0x28 // int
000A: 1@ += 0xBA86F0
0A8E: 31@ = 1@ + 0 // DWORD dwColourID
0A8D: 2@ = read_memory 31@ size 4 virtual_protect 0

// Get blip color RGB from color id
0A90: 30@ = 2@ * 4 // int
000A: 30@ += 0xBAB22C
0A8D: 3@ = read_memory 30@ size 1 virtual_protect 0 // R
000A: 30@ += 1
0A8D: 4@ = read_memory 30@ size 1 virtual_protect 0 // G
000A: 30@ += 1
0A8D: 5@ = read_memory 30@ size 1 virtual_protect 0 // B
// End of RGB

0A8E: 31@ = 1@ + 8 // PosX (float)
0A8D: 6@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 12 // PosY  (float)
0A8D: 7@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 16 // PosZ  (float)
0A8D: 8@ = read_memory 31@ size 4 virtual_protect 0

0A8E: 31@ = 1@ + 36 // BYTE byteIconID
0A8D: 9@ = read_memory 31@ size 1 virtual_protect 0

0AB2: ret 8 2@ 3@ 4@ 5@ 6@ 7@ 8@ 9@

Structure
C++:
struct RadarMarker {
uint32_t dwColourID; // 0
uint32_t* pEntity; // 4
tVector vecPos;
//float fPosX; // 8
//float fPosY; // 12
//float fPosZ; // 16
uint16_t wFlag; // 20
uint16_t _wAlign; // 22
float fUnknown; // 24 (either 1.0 or 5.0)
uint32_t dwIconSize; // 28
uint32_t* pEnterExit; // 32
uint8_t byteIcon; // 36
uint8_t byteFlags; // 37
uint8_t byteType; // 38
uint8_t _bAlign; // 39
};
 
Last edited:

SamThapa

Active member
Joined
Jan 22, 2018
Messages
38
Reaction score
1
Nice but i was here for info which shows in display but here need a car :) any way thanks
 
Top