From 84fa1b665ee1b1f53239ec94307eb2ecf846fbb8 Mon Sep 17 00:00:00 2001 From: AbueloEbrio Date: Sat, 1 Mar 2025 16:34:46 -0300 Subject: [PATCH] Update race_client.lua Fixed checkpoints problem from specting mode. Fixed code by robson from MTA Race community --- [gamemodes]/[race]/race/race_client.lua | 27 ++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/[gamemodes]/[race]/race/race_client.lua b/[gamemodes]/[race]/race/race_client.lua index 9321008c0..6fcda9a62 100644 --- a/[gamemodes]/[race]/race/race_client.lua +++ b/[gamemodes]/[race]/race/race_client.lua @@ -1259,11 +1259,24 @@ function createCheckpoint(i) if checkpoint.type == 'ring' and i < #g_Checkpoints then setMarkerTarget(checkpoint.marker, unpack(g_Checkpoints[i+1].position)) end - checkpoint.blip = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3]) + checkpoint.blip = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3], 255) setBlipOrdering(checkpoint.blip, 1) return checkpoint.marker end +function createRadarBlips(i) + local checkpoint = g_Checkpoints[i] + if checkpoint.marker then + return + end + local pos = checkpoint.position + local color = checkpoint.color or { 0, 0, 80 } + + checkpoint.blip2 = createBlip(pos[1], pos[2], pos[3], 0, isCurrent and 2 or 1, color[1], color[2], color[3], 100) + + return checkpoint.marker +end + function makeCheckpointCurrent(i,bOtherPlayer) local checkpoint = g_Checkpoints[i] local pos = checkpoint.position @@ -1287,10 +1300,22 @@ end function destroyCheckpoint(i) local checkpoint = g_Checkpoints[i] + local blip2 = g_Checkpoints[i+1] + local blip3 = g_Checkpoints[i+2] if checkpoint and checkpoint.marker then destroyElement(checkpoint.marker) checkpoint.marker = nil destroyElement(checkpoint.blip) + + if (#g_Checkpoints - i) >= 3 then + --destroyElement(blip2.blip2) + if isElement(blip3.blip2) then + if blip3.blip2 then + destroyElement(blip3.blip2) + end + end + end + checkpoint.blip = nil if checkpoint.colshape then destroyElement(checkpoint.colshape)