BorderLine Posted May 29, 2013 Share Posted May 29, 2013 Hi everyone. I have a problem. I want create Blips but only visible to my team I have this. Debug script dont show error local playerBlipRoot = createElement("playerBlipRoot", "playerBlipRoot") local function resourceStart() team = getPlayerTeam(localPlayer) local tplayers = getPlayersInTeam ( team ) for _, tplayers in ipairs(tplayers) do if tplayers ~= localPlayer then local r, g, b = getPlayerNametagColor(tplayers) local blip = createBlipAttachedTo(tplayers, 0, 2, r, g, b, 255, 1, 70) setElementParent(blip, playerBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) local function playerJoin() local r, g, b = getPlayerNametagColor(source) local blip = createBlipAttachedTo(source, 0, 2, r, g, b, 255, 1,70) setElementParent(blip, playerBlipRoot) setTimer(updateBlipColor, 5000, 1, blip) --Upadate in 5 seconds, in case the server sets the color. end addEventHandler("onClientPlayerLogin", root, playerJoin) addEventHandler("onClientResourceStart", root, playerJoin) addEventHandler("onClientPlayerSpawn", root, playerJoin) local function playerQuit() for _, blip in ipairs(getElementChildrene(playerBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end end addEventHandler("onClientPlayerQuit", root, playerQuit) function updateBlipColor(blip) local player = getElementAttachedTo(blip) if player then local r, g, b = getPlayerNametagColor(player) setBlipColor(blip, r, g, b, 255) end end Thanks for your time Link to comment
Blaawee Posted May 29, 2013 Share Posted May 29, 2013 Use it in server side. createBlipAttachedTo There's an argument called ' visibleTo '. 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