ah, I was gonna say thought my life was a lie haha
This is what Iām working with at the moment
Citizen.CreateThread(function()
while true do
local blipIterator = GetBlipInfoIdIterator()
local blip = GetFirstBlipInfoId(blipIterator)
while DoesBlipExist(blip) do
-- check if player
local entity = GetBlipInfoIdEntityIndex(blip)
if entity then -- it is attached to entity?
if IsEntityAPed(entity) and IsPedAPlayer(GetPedFromEntityIndex(entity)) then -- is a player?
SetBlipScale(blip,0.0)
end
end
blip = GetNextBlipInfoId(blipIterator)
end
Citizen.Wait(0)
end
end)
Put the citizen.wait after the while true loop
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local blipIterator = GetBlipInfoIdIterator()
local blip = GetFirstBlipInfoId(blipIterator)
while DoesBlipExist(blip) do
-- check if player
local entity = GetBlipInfoIdEntityIndex(blip)
if entity then -- it is attached to entity?
if IsEntityAPed(entity) and IsPedAPlayer(GetPedFromEntityIndex(entity)) then -- is a player?
SetBlipScale(blip,0.0)
end
end
blip = GetNextBlipInfoId(blipIterator)
end
end
end)
Shouldnāt matter if its at the end or beginning of the loop
oh okay, i just usually put it at the beginning just so i dont forget it
im probably gonna set this up with a command too
What would be the purpose of a command if you want to remove blips from a server? Unless, you made an admin command to toggle the blips being removed.
Was this working for you, by the way? Testing now and itās not working
well our vps broke so i cant really test but ive started up my server locally and getting someone in
Yeah, doesnt work for me either
Ok so, it appears I gave you some false information 2 weeks ago
Try the following and tell me if it works:
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local blip = GetFirstBlipInfoId(8) -- 8 is the ID of player sprites :)
while DoesBlipExist(blip) do
-- No need to check if player :D
SetBlipAlpha(blip, 0)
blip = GetNextBlipInfoId(8)
end
end
end)
Haha, saw something about that in the scripting channel, my friends just installing fivem so i will test it then Thanks!
Just tested, and unfortunately didnāt work
Thatās because Iām an idiotā¦ Iāve been coding too long today
This should work (Iām like 90% certain):
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerSprite = 6 -- look at http://gtaxscripting.blogspot.co.uk/2016/05/gta-v-blips-id-and-image.html and double check for me :)
local blip = GetFirstBlipInfoId(playerSprite)
while DoesBlipExist(blip) do
-- No need to check if player :D
SetBlipAlpha(blip, 0)
blip = GetNextBlipInfoId(playerSprite)
end
end
end)
Alright, will check in a few
Iāve tried different ways, setting the alpha, changing the location, deleting it, nothing works
From what I have seen in another topic, itās not possible, because Lambda just constantly recreates the blips every tick.
Turns out, LambdaMenu uses a different blip IDs (changing based on vehicle)ā¦
You might have to loop through them and check if itās a playerā¦
local blipIds = {
1,274,421,424,423,422,
426,404,308,427,226,56,
198,67,68,318,225,274
}
function isBlipAttachedToPlayer( blip )
local entity = GetBlipInfoIdEntityIndex(blip)
if entity then -- it is attached to entity?
if IsEntityAPed(entity) and IsPedAPlayer(GetPedIndexFromEntityIndex(entity)) then -- is a player?
return true
end
end
return false
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for _,v in pairs(blipIds) do
local blip = GetFirstBlipInfoId(v)
while DoesBlipExist(blip) do
if isBlipAttachedToPlayer(blip) then
SetBlipAlpha(blip, 0) -- Lambda doesn't touch alpha, it's safe to set it :)
end
blip = GetNextBlipInfoId(v)
end
end
end
end)
Edit:
It doesnāt look like it āconstantlyā re-created a blip, only when itās removed. So, setting the alpha (the scale is changed by lambda so, changing that wouldnāt work) should stop it from showing. You could probably add a check to make sure blipās apha only getās set to 0 once (save on resources?)
Edit 2:
Or, the āplayerSpriteā could just be 1
ā¦
Yeaā¦ My bad, the native is GetPedIndexFromEntityIndex