Jump to content

[AJUDA] Como limitar o isElementWithinMarker no Client?


Recommended Posts

Queria saber como posso usar o isElementWithinMarker, não posso utilizar source como parâmetro, obrigado Lord Henry kkk. Realmente estou travado, tentei utilizar player como primeiro argumento do isElementWith.... mas não deu certo.

local plugMarker1 = createMarker (1534.4379882813,-1675.3631591797,13.3828125, "cylinder", 1, 255, 255, 255, 100)

function plug(startedResource)
	
	setElementInterior(plugMarker1, 6)
	setElementPosition(plugMarker1, 254.49601745605, 67.918395996094, 1005.7)

end
addEventHandler("onClientResourceStart", root, plug)

function windowPlug(hitPlayer)

	local x,y = guiGetScreenSize()

	function textPlug()

		local level = getPlayerWantedLevel(player)

				if (level >= 1 ) then
					dxDrawRectangle(x/4, y/3, x/2, y/4.9, tocolor(0,0,0, 100))
					dxDrawRectangle(x/4, y/3.018, x/2, y/10, tocolor(0,0,0, 150))
					dxDrawText("DELEGACIA DE POLÍCIA - LOS SANTOS", x/3.3, y/2.85, x/2, y/2, tocolor(0,0,255), 1.7, 1.7, "pricedown", "left", "top")
					dxDrawText("VOCÊ ESTÁ PROCURADO", x/2.75, y/2.2, x/2, y/2, tocolor(255,255,255), 1.7, 1.7, "pricedown", "left", "top")

				else
					dxDrawRectangle(x/4, y/3, x/2, y/4.9, tocolor(0,0,0, 100))
					dxDrawRectangle(x/4, y/3.018, x/2, y/10, tocolor(0,0,0, 150))
					dxDrawText("DELEGACIA DE POLÍCIA - LOS SANTOS", x/3.3, y/2.85, x/2, y/2, tocolor(0,0,255), 1.7, 1.7, "pricedown", "left", "top")
					dxDrawText("VOCÊ        ESTÁ PROCURADO", x/2.9, y/2.2, x/2, y/2, tocolor(255,255,255), 1.7, 1.7, "pricedown", "left", "top")
					dxDrawText("NÃO", x/2.45, y/2.2, x/2, y/2, tocolor(255,0,0), 1.7, 1.7, "pricedown", "left", "top")
			end
end
	addEventHandler("onClientRender", root, textPlug)
end
addEventHandler("onClientMarkerHit", root, windowPlug)

Vlw Lord Henry, tmj meu mano.

Link to comment
37 minutes ago, Lord Henry said:

Não é necessário usar isElementWithinMarker se você estiver usando onClientMarkerHit, pois quando um elemento colide em um marker, obviamente ele já vai estar dentro do marker.

É o mesmo que verificar se o jogador está dentro do veículo logo após o evento onVehicleEnter.

O problema é que esses dxDraw aparece em qualquer marker que eu passo, queria limitar somente a um marker específico.

Link to comment

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...