From 33795ada885f74b24e1b64e59bfbb4d32938bebb Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Sat, 31 May 2025 21:05:06 +0200 Subject: [PATCH] Make blips visible only to other players --- [gameplay]/playerblips/server/main.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/[gameplay]/playerblips/server/main.lua b/[gameplay]/playerblips/server/main.lua index a7cd75788..a88539e64 100644 --- a/[gameplay]/playerblips/server/main.lua +++ b/[gameplay]/playerblips/server/main.lua @@ -66,6 +66,13 @@ function createPlayerBlip(player) blips[player]:setColor(r, g, b, blipAlpha) else blips[player] = Blip.createAttachedTo(player, 0, blipSize, r, g, b, blipAlpha, 0, blipRange) + clearElementVisibleTo(blips[player]) + + for _, v in pairs(getElementsByType("player")) do + if v ~= player then + setElementVisibleTo(blips[player], v, true) + end + end end end @@ -92,6 +99,13 @@ function destroyPlayerBlip(player) colors[player] = nil end +addEventHandler("onPlayerJoin", root, function() + for k, v in pairs(blips) do + if k ~= source then + setElementVisibleTo(v, source, true) + end + end +end) addEventHandler("onPlayerQuit", root, function() destroyPlayerBlip(source) end)