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.
 

maldivass

New member
Joined
Dec 25, 2022
Messages
1
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.
 
Top