CLEO Help cleo automatically mark the red checkpoints

CLEO related

Zaidroid

Member
Joined
Sep 20, 2022
Messages
6
Reaction score
0
I want him to automatically mark the red checkpoints that appear on the map with a way point by pressing the C + L combination while making a job.
 
Solution
Alright found some shit, all that had to be done was just create blip and set that as what the game percieves as the "marker" which is what that GPS mod will have to use as marker reference. Also converted to all samp versions (thank Parazitas for that).
C++:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??

WHILE TRUE
    WAIT 0
 
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN
        
            call @get_racecp_pos 0 X 0@ Y 1@ Z $NOT_USED
            call @setTargetMarker 3 x 0@ y 1@ z 0.0
              
        END
    END
 
END






:is_racecp_active
//  0AB1: @is_racecp_active 0
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1...

maldivass

Member
Joined
Dec 25, 2022
Messages
12
Reaction score
1
Code:
{$CLEO .cs}

0000: 'Author:'

// Function to check if player is making a job
function IsMakingJob()
  local job_id, has_job

  job_id = get_player_jobid($PLAYER_CHAR)
  has_job = job_id != 0

  return has_job
end

REPEAT
  WAIT 0
UNTIL 0AFA:

// Register C + L key combination
0A93: key_hook key_press 0x43 0x4C to_label @MARK_CHECKPOINTS

WHILE TRUE
  WAIT 0

  // Check if player is making a job and pressed C + L
  if IsMakingJob() and is_key_pressed(0x43) and is_key_pressed(0x4C) then
    // Get all checkpoints on the map
    local num_checkpoints, checkpoints

    num_checkpoints = get_all_checkpoints_of_type(CHECKPOINT_TYPE_RACE, checkpoints)

    // Loop through each checkpoint
    for i = 0 to num_checkpoints - 1 do
      local x, y, z

      // Get checkpoint coordinates
      get_checkpoint_pos(checkpoints[i], x, y, z)

      // Check if checkpoint is red
      if get_checkpoint_color(checkpoints[i]) == COLOR_RED then
        // Set waypoint at checkpoint coordinates
        set_player_waypoint($PLAYER_CHAR, x, y, z)
      end
    end
  end
END

:MARK_CHECKPOINTS
  0A95: return
 

Zaidroid

Member
Joined
Sep 20, 2022
Messages
6
Reaction score
0
Code:
{$CLEO .cs}

0000: 'Author:'

// Function to check if player is making a job
function IsMakingJob()
  local job_id, has_job

  job_id = get_player_jobid($PLAYER_CHAR)
  has_job = job_id != 0

  return has_job
end

REPEAT
  WAIT 0
UNTIL 0AFA:

// Register C + L key combination
0A93: key_hook key_press 0x43 0x4C to_label @MARK_CHECKPOINTS

WHILE TRUE
  WAIT 0

  // Check if player is making a job and pressed C + L
  if IsMakingJob() and is_key_pressed(0x43) and is_key_pressed(0x4C) then
    // Get all checkpoints on the map
    local num_checkpoints, checkpoints

    num_checkpoints = get_all_checkpoints_of_type(CHECKPOINT_TYPE_RACE, checkpoints)

    // Loop through each checkpoint
    for i = 0 to num_checkpoints - 1 do
      local x, y, z

      // Get checkpoint coordinates
      get_checkpoint_pos(checkpoints[i], x, y, z)

      // Check if checkpoint is red
      if get_checkpoint_color(checkpoints[i]) == COLOR_RED then
        // Set waypoint at checkpoint coordinates
        set_player_waypoint($PLAYER_CHAR, x, y, z)
      end
    end
  end
END

:MARK_CHECKPOINTS
  0A95: return
1708453323860.png
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
what do you mean mark checkpoints? You already see them in minimap. Explain more what you trying to make
 

Zaidroid

Member
Joined
Sep 20, 2022
Messages
6
Reaction score
0
1708481956582.png1708481922009.png
1708482105498.png


I use GPS mode, and every time I pass through a checkpoint while doing a job, a new checkpoint is created in a different position, so I want to mark the checkpoints with waypoint when the specified keys are pressed, and for this I wanted cleo.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,724
Solutions
2
Reaction score
113
Still want? Send screenshot of what the checkpoint looks like and what it looks like on the minimap and I shall have a look into it for you.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,724
Solutions
2
Reaction score
113
PHP:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??


WHILE TRUE
    WAIT 0
  
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN 
            // SET MARKER
            FOR 0@ = 0xBA86F0 TO 0xBA8EC0 STEP 40
                0A8E: 1@ = 0@ + 37 // byteFlags
                0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                IF AND
                    08B7:   test 2@ bit 1 // Does blip exist?
                    88B7:   test 2@ bit 2 // Is a long distance blip?
                THEN
                    0A8E: 1@ = 0@ + 36 // byteIcon
                    0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                    IF
                        2@ == 41 // TXT icon for marker
                    THEN
                        // COORDS
                        call @get_racecp_pos 0 X 3@ Y 4@ Z $NOT_USED
                      
                        0A8E: 1@ = 0@ + 8 // X
                        0A8C: write_memory 1@ size 4 value 3@ virtual_protect 0
                        0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0
  
                      
                        0A8E: 1@ = 0@ + 12 // Y
                        0A8C: write_memory 1@ size 4 value 4@ virtual_protect 0
                        0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0
                        
                    END 
                END
            END
        END
    END
  
END




:is_racecp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0


:get_racecp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Using 0.3.7 R1 offsets see this snippet for all different offsets from versions R1 onwards you may have to change (idk what version you are on). Key is "M" to mark your race checkpoint, just make sure you have a marker set somewhere (ik it's half-arsed but this script only MOVES your marker, if thats a problem we can look into marker memory and shit but it probably means doing some cheat engine shit).
 

alvisalward

Member
Joined
Jun 15, 2023
Messages
12
Reaction score
0
PHP:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??


WHILE TRUE
    WAIT 0
 
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN
            // SET MARKER
            FOR 0@ = 0xBA86F0 TO 0xBA8EC0 STEP 40
                0A8E: 1@ = 0@ + 37 // byteFlags
                0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                IF AND
                    08B7:   test 2@ bit 1 // Does blip exist?
                    88B7:   test 2@ bit 2 // Is a long distance blip?
                THEN
                    0A8E: 1@ = 0@ + 36 // byteIcon
                    0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                    IF
                        2@ == 41 // TXT icon for marker
                    THEN
                        // COORDS
                        call @get_racecp_pos 0 X 3@ Y 4@ Z $NOT_USED
                     
                        0A8E: 1@ = 0@ + 8 // X
                        0A8C: write_memory 1@ size 4 value 3@ virtual_protect 0
                        0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0
 
                     
                        0A8E: 1@ = 0@ + 12 // Y
                        0A8C: write_memory 1@ size 4 value 4@ virtual_protect 0
                        0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0
                       
                    END
                END
            END
        END
    END
 
END




:is_racecp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0


:get_racecp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Using 0.3.7 R1 offsets see this snippet for all different offsets from versions R1 onwards you may have to change (idk what version you are on). Key is "M" to mark your race checkpoint, just make sure you have a marker set somewhere (ik it's half-arsed but this script only MOVES your marker, if thats a problem we can look into marker memory and shit but it probably means doing some cheat engine shit).
I have some trouble here.
Unknown directive KEY_DOWN 77.
 

alvisalward

Member
Joined
Jun 15, 2023
Messages
12
Reaction score
0
Hey, @Zin. Can you please just upload it on .cs extension already? Because i dont even know how to compile it correctly, I'm so sorry to annoy you. Btw, I'm using 0.3DL. Thanks!
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I want him to automatically mark the red checkpoints that appear on the map with a way point by pressing the C + L combination while making a job.
I asume you are using some kind .asi which works when you mark on radar, please provide that asi in order to test and make code to work fully.
PHP:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??


WHILE TRUE
    WAIT 0
 
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN
            // SET MARKER
            FOR 0@ = 0xBA86F0 TO 0xBA8EC0 STEP 40
                0A8E: 1@ = 0@ + 37 // byteFlags
                0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                IF AND
                    08B7:   test 2@ bit 1 // Does blip exist?
                    88B7:   test 2@ bit 2 // Is a long distance blip?
                THEN
                    0A8E: 1@ = 0@ + 36 // byteIcon
                    0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                    IF
                        2@ == 41 // TXT icon for marker
                    THEN
                        // COORDS
                        call @get_racecp_pos 0 X 3@ Y 4@ Z $NOT_USED
                     
                        0A8E: 1@ = 0@ + 8 // X
                        0A8C: write_memory 1@ size 4 value 3@ virtual_protect 0
                        0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0
 
                     
                        0A8E: 1@ = 0@ + 12 // Y
                        0A8C: write_memory 1@ size 4 value 4@ virtual_protect 0
                        0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0
                       
                    END
                END
            END
        END
    END
 
END




:is_racecp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0


:get_racecp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Using 0.3.7 R1 offsets see this snippet for all different offsets from versions R1 onwards you may have to change (idk what version you are on). Key is "M" to mark your race checkpoint, just make sure you have a marker set somewhere (ik it's half-arsed but this script only MOVES your marker, if thats a problem we can look into marker memory and shit but it probably means doing some cheat engine shit).

Check Point:

Race Check Point:
 

alvisalward

Member
Joined
Jun 15, 2023
Messages
12
Reaction score
0
Race Check Point:
I tried to change into it but it says "Unknown directive KEY_DOWN 77." when i compile it. How can I make it?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
I tried to change into it but it says "Unknown directive KEY_DOWN 77." when i compile it. How can I make it?

Ready to use sanny builder.
Also make sure you have settings set to " As is "
 

alvisalward

Member
Joined
Jun 15, 2023
Messages
12
Reaction score
0
PHP:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??


WHILE TRUE
    WAIT 0
 
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN
            // SET MARKER
            FOR 0@ = 0xBA86F0 TO 0xBA8EC0 STEP 40
                0A8E: 1@ = 0@ + 37 // byteFlags
                0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                IF AND
                    08B7:   test 2@ bit 1 // Does blip exist?
                    88B7:   test 2@ bit 2 // Is a long distance blip?
                THEN
                    0A8E: 1@ = 0@ + 36 // byteIcon
                    0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0
                    IF
                        2@ == 41 // TXT icon for marker
                    THEN
                        // COORDS
                        call @get_racecp_pos 0 X 3@ Y 4@ Z $NOT_USED
                    
                        0A8E: 1@ = 0@ + 8 // X
                        0A8C: write_memory 1@ size 4 value 3@ virtual_protect 0
                        0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0
 
                    
                        0A8E: 1@ = 0@ + 12 // Y
                        0A8C: write_memory 1@ size 4 value 4@ virtual_protect 0
                        0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0
                      
                    END
                END
            END
        END
    END
 
END




:is_racecp_active
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0


:get_racecp_pos
{
    0.3.7 - R1
}
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x21A10C // SAMP_MISC_INFO
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x2C
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@

Using 0.3.7 R1 offsets see this snippet for all different offsets from versions R1 onwards you may have to change (idk what version you are on). Key is "M" to mark your race checkpoint, just make sure you have a marker set somewhere (ik it's half-arsed but this script only MOVES your marker, if thats a problem we can look into marker memory and shit but it probably means doing some cheat engine shit).

Ready to use sanny builder.
Also make sure you have settings set to " As is "
Thanks, it works!
But it is Race CheckPoint, there is gonna be "next" Race CheckPoint will appear when I reached. The problem is the marker will disappear when I reached it and because the script is just "moving" the marker not to mark, I have to mark it again and again to use it. So I'm thinking about how can I make my marker wont disappear when I arrived until I removed it manually from the Map on ESC, so I could just press "M" again when the Race CheckPoint shows the next.

Any solution?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,724
Solutions
2
Reaction score
113
I asume you are using some kind .asi which works when you mark on radar, please provide that asi in order to test and make code to work fully.


Check Point:

Race Check Point:
Thats the snippet to get it working but I don't understand C++ so I'm struggling to convert to CLEO atm.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,724
Solutions
2
Reaction score
113
Alright found some shit, all that had to be done was just create blip and set that as what the game percieves as the "marker" which is what that GPS mod will have to use as marker reference. Also converted to all samp versions (thank Parazitas for that).
C++:
{$CLEO .cs}

THREAD 'RACECPMARKER'

WAIT 5000 // WAIT UNTIL SAMP INIT??

WHILE TRUE
    WAIT 0
 
    IF
        KEY_DOWN 77  // KEY "M"
    THEN
        IF
            call @is_racecp_active 0
        THEN
        
            call @get_racecp_pos 0 X 0@ Y 1@ Z $NOT_USED
            call @setTargetMarker 3 x 0@ y 1@ z 0.0
              
        END
    END
 
END






:is_racecp_active
//  0AB1: @is_racecp_active 0
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x49 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x4D // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x29 // SAMP_CHECKPOINT_ACTIVE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        END
        IF 30@ == TRUE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 0


:get_racecp_pos
// 0AB1: @get_racecp_pos 0 XYZ 1@ 2@ 3@
IF 0AA2: 31@ = loadlib "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A10C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0x2C // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x30 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x34 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A114 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA3C // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8F4 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA24 // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EBAC // SAMP_MISC_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            0A8E: 29@ = 30@ + 0xC // SAMP_CHECKPOINT_X_OFFSET
            0A8D: 28@ = readMem 29@ sz 4 vp 0
            0A8E: 27@ = 30@ + 0x10 // SAMP_CHECKPOINT_Y_OFFSET
            0A8D: 26@ = readMem 27@ sz 4 vp 0
            0A8E: 25@ = 30@ + 0x14 // SAMP_CHECKPOINT_Z_OFFSET
            0A8D: 24@ = readMem 25@ sz 4 vp 0
        END
        0AA3: freelib 31@
    END
END
0AB2: ret 3 28@ 26@ 24@


:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@ 
30@ = 0
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
    31@ += 0x128
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5542F47A
    THEN // 0.3.7 R1
        30@ = 1
    END
    
    IF 29@ == 0x59C30C94
    THEN // 0.3.7 R2
        30@ = 2
    END
    
    IF 29@ == 0x5A6A3130
    THEN // 0.3.DL
        30@ = 3
    END
    31@ -= 8 // reading samp.dll + 0x120
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    IF 29@ == 0x5C0B4243
    THEN // 0.3.7 R3
        30@ = 4
    END 
    
    IF 29@ == 0x5DD606CD
    THEN // 0.3.7 R4
        30@ = 5
    END
    IF 29@ == 0x6094ACAB
    THEN // 0.3.7 R4 - v2
        30@ = 6
    END
    IF 29@ == 0x6372C39E
    THEN // 0.3.7 R5
        30@ = 7
    END
END
0AB2: ret 1 30@

:getTargetMarkerHandle
0A8D: 0@ = read_memory 0xBA6774 size 4 virtual_protect 0
ret 1 0@

:setTargetMarker
call @getTargetMarkerHandle 0 return: 3@
IF
    875C: marker 3@ enabled
THEN
    // CREATE MARKER
    call @setStateTargetMarker 1 state 1
END
// MOVE MARKER
0B10: 4@ = 3@ AND 0xFFFF
0012: 4@ *= 40
0A8E: 5@ = 0xBA86F8 + 4@
0A8C: write_memory 5@ size 4 value 0@ virtual_protect 0
5@ += 4
0A8C: write_memory 5@ size 4 value 1@ virtual_protect 0
5@ += 4
0A8C: write_memory 5@ size 4 value 2@ virtual_protect 0   
0AB2: ret 0

:setStateTargetMarker
call @getTargetMarkerHandle 0 return: 1@
if 1@ > 0
then
    if 0@ == 0
    then
        0AA5: call_function 0x587CE0 num_params 1 pop 1 1@ // CRadar::removeBlip         
        0A8C: write_memory 0xBA6774 size 4 value 0 virtual_protect 0 // CMenuManager::m_targetMarker
    end
else
    if 0@ == 1
    then
        0AA7: call_function 0x583820 num_params 6 pop 6 2 0 0 0 0 4 1@ // CRadar::createBlip
        0AA5: call_function 0x583D70 num_params 2 pop 2 41 1@ // CRadar::setBlipSprite
        0A8C: write_memory 0xBA6774 size 4 value 1@ virtual_protect 0 // CMenuManager::m_targetMarker
    end
end
ret 0
 
Solution
Top