Jump to content

omar0101565111

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by omar0101565111

  1. no error , but it's only working for all players i need to make it only for 2 teams , f.e Admins and ALT Team ..
  2. Hello , i just need to make Player blip for only 2 teams , Admins and Events Organization Zone , i tried local allowedTeam{} but not working , still working for all Players at F11 , local restrictedTeams = { ["Admins"] = true, ["Events Organization Zone"] = true } local textFont = "default-bold" local textScale = 1 local heightPadding = 1 local widthPadding = 1 local xOffset = 8 local minAlpha = 10 local textAlpha = 255 local floor = math.floor local w,h = guiGetScreenSize() local function drawMapStuff() if (restrictedTeams[getTeamName(getPlayerTeam(getLocalPlayer()))] ~= nil) then if isPlayerMapVisible() then local sx,sy,ex,ey = getPlayerMapBoundingBox() local mw,mh = ex-sx,sy-ey local cx,cy = (sx+ex)/2,(sy+ey)/2 local ppuX,ppuY = mw/6000,mh/6000 local fontHeight = dxGetFontHeight(textScale,textFont) local yOffset = fontHeight/2 local blips = getElementsByType("blip") for k,v in ipairs(blips) do local attached=getElementAttachedTo(v) if isElement(attached) and getElementType(attached)=="player" then local px,py = getElementPosition(attached) local x = floor(cx+px*ppuX+xOffset) local y = floor(cy+py*ppuY-yOffset) local pname = getPlayerName(attached) local nameLength = dxGetTextWidth(pname,textScale,textFont) local r,g,b = getPlayerNametagColor(attached) local _,_,_,a = getBlipColor(v) if a>minAlpha then dxDrawBorderedText(pname,x,y,x+nameLength,y+fontHeight,tocolor(r,g,b,textAlpha),textScale,textFont,"left","top",false,false,false) end end end end end end addEventHandler("onClientRender",getRootElement(),drawMapStuff) function dxDrawBorderedText(text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak,postGUI) for oX = -1, 1 do for oY = -1, 1 do dxDrawText(text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak,postGUI) end end dxDrawText(text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) end
×
×
  • Create New...