main Posted March 7, 2019 Share Posted March 7, 2019 local blip = {} function createPlayerBlip(player) if not player or not isElement(player) or getElementType(player) ~= "player" then return false end local playerTeam = getPlayerTeam(player) blip[player] = createBlipAttachedTo(player, 0, 2, 255, 255, 255, 255) end Olá, queria saber uma forma eficiente de criar/mostrar o blip somente entre jogadores do team Link to comment
[M]ister Posted March 7, 2019 Share Posted March 7, 2019 setElementVisibleTo(blip[player], root, false) for _, teamMember in ipairs (getPlayersInTeam(playerTeam)) do setElementVisibleTo(blip[player], teamMember, true) end 1 Link to comment
main Posted March 7, 2019 Author Share Posted March 7, 2019 10 hours ago, MaligNos said: setElementVisibleTo(blip[player], root, false) for _, teamMember in ipairs (getPlayersInTeam(playerTeam)) do setElementVisibleTo(blip[player], teamMember, true) end function createPlayerBlip(player) if not player or not isElement(player) or getElementType(player) ~= "player" then return false end local playerTeam = getPlayerTeam(player) if playerTeam then if not blip[player] then blip[player] = createBlipAttachedTo(player, 0, 2, 255, 255, 255, 255) setElementVisibleTo(blip[player], root, false) for _, teamMember in ipairs (getPlayersInTeam(playerTeam)) do setElementVisibleTo(blip[player], teamMember, true) end end end end Tentei deste jeito e não funcionou, estou criando o blip no evento onResourceStart e onPlayerLogin Link to comment
main Posted March 7, 2019 Author Share Posted March 7, 2019 42 minutes ago, MainSCR said: function createPlayerBlip(player) if not player or not isElement(player) or getElementType(player) ~= "player" then return false end local playerTeam = getPlayerTeam(player) if playerTeam then if not blip[player] then blip[player] = createBlipAttachedTo(player, 0, 2, 255, 255, 255, 255) setElementVisibleTo(blip[player], root, false) for _, teamMember in ipairs (getPlayersInTeam(playerTeam)) do setElementVisibleTo(blip[player], teamMember, true) end end end end Tentei deste jeito e não funcionou, estou criando o blip no evento onResourceStart e onPlayerLogin @MaligNos desculpe, funcionou sim, eu que estava testando com o freeroam ligado .-. Muito obrigado pela ajuda. 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now