Gravestone Posted March 8, 2016 Share Posted March 8, 2016 I want to color the blips of players according to their name color. What should I edit in this code? function updatePlayerBlips() if not g_PlayerData then return end local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos local mapControl = getControl(wnd, 'map') for elem,player in pairs(g_PlayerData) do if not player.gui.mapBlip then player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl) player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl) local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow) guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false) guiSetFont(player.gui.mapLabelShadow, 'default-bold') guiLabelSetColor(player.gui.mapLabelShadow, 0, 0, 0) player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl) guiSetFont(player.gui.mapLabel, 'default-bold') local r, g, b = getPlayerNametagColor(g_Me) guiLabelSetColor(player.gui.mapLabel, r, g, b) for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do addEventHandler('onClientGUIDoubleClick', player.gui[name], function() server.warpMe(elem) closeWindow(wnd) end, false ) end end local x, y = getElementPosition(elem) x = math.floor((x + 3000) * g_MapSide / 6000) - 4 y = math.floor((3000 - y) * g_MapSide / 6000) - 4 guiSetPosition(player.gui.mapBlip, x, y, false) guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false) guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false) end end Link to comment
Seba500PLK Posted April 8, 2016 Share Posted April 8, 2016 check https://forum.multitheftauto.com/viewto ... 48&t=61670 Link to comment
Seba500PLK Posted April 8, 2016 Share Posted April 8, 2016 check https://forum.multitheftauto.com/viewto ... 48&t=61670 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