Jump to content

Nome Player (Mapa)


Recommended Posts

Posted

Boa Tarde,

 

Tenho um sistema no meu servidor que funciona so que ai coloquei em outro servidor e ele naoe sta funcionando tem alguma função que desabilita isso? pois ele funciona em um servidor mais no outro nao. Segue abaixo o sistema Client

 

Obrigado

local textFont = "default-bold"			-- The font of the tag text
local textScale = 1						-- The scale of the tag text
local heightPadding = 1						-- The amount of pixels the tag should be extended on either side of the vertical axis
local widthPadding = 1						-- The amount of pixels the tag should be extended on either side of the horizontal axis
local xOffset = 8						-- Distance between the player blip and the tag
local minAlpha = 10						-- If blip alpha falls below this, the tag won't the shown
local textAlpha = 255
local rectangleColor = tocolor(0,0,0,230)

local w,h = guiGetScreenSize()
addEventHandler("onClientRender",getRootElement(),function()
	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
		for k,v in pairs(getElementsByType("blip")) do
			local attached=getElementAttachedTo(v)
			if isElement(attached) and getElementType(attached)=="player" and attached ~= getLocalPlayer() then
				local px,py = getElementPosition(attached)
				local x = math.floor(cx+px*ppuX+xOffset)
				local y = math.floor(cy+py*ppuY-yOffset)
				local pname = getPlayerName(attached):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','')
				local nameLength = dxGetTextWidth(pname,textScale,textFont)
				local _,_,_,a = getBlipColor(v)
				-- if getElementData(attached,"Dominando") then return end
				if a > minAlpha then
					dxDrawRectangle(x-widthPadding,y+heightPadding,nameLength+widthPadding*2,fontHeight-heightPadding*2,rectangleColor,false)
					dxDrawText(pname,x,y,x+nameLength,y+fontHeight,tocolor(255,255,255,textAlpha),textScale,textFont,"left","top",false,false,false)
				end
			end
		end
	end
end)

 

  • Moderators
Posted

Provavelmente este outro servidor tem algum resource entrando em conflito com este.

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanksspacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...