EW1611 Posted August 17, 2019 Share Posted August 17, 2019 olá, fiz um dx pequeno apenas pra mostrar infos na tela, mas qria q ele ficasse na tela enquanto o player está no marker, com esse script aki ele só "pisca" qndo passa no marker marker1 = createMarker(2122.7575683594,-1784.9986572266,12.387022018433, "cylinder", 1.5) function startRender (hitElement) if (getElementType (hitElement) == "player") then addEventHandler ("onClientRander", root, DX1) end end function DX1(player) if isElementWithinMarker(player, marker1) then dxDrawLine(395 - 1, 0 - 1, 395 - 1, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine(972, 0 - 1, 395 - 1, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawLine(395 - 1, 38, 972, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine(972, 38, 972, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawRectangle(395, 0, 577, 38, tocolor(0, 0, 0, 93), false) dxDrawText("Pizzaria: Temos ... Pizzas disponíveis para entrega", 443, 5, 923, 28, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "top", false, false, false, false, false) end end addEventHandler("onClientMarkerHit", marker1, DX1) removeEventHandler("onClientRender", root, DX1 ) Obrigado. Link to comment
Jonas^ Posted August 17, 2019 Share Posted August 17, 2019 (edited) marker1 = createMarker(2122.7575683594,-1784.9986572266,12.387022018433, "cylinder", 1.5) addEventHandler ("onClientMarkerHit", root, function (hitPlayer, matchingDimension) if isElementWithinMarker (hitPlayer, marker1) then if (getElementType (hitPlayer) == "player") then addEventHandler ("onClientRander", root, DX1) end end end) function DX1 () dxDrawLine (395 - 1, 0 - 1, 395 - 1, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 0 - 1, 395 - 1, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (395 - 1, 38, 972, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 38, 972, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawRectangle (395, 0, 577, 38, tocolor(0, 0, 0, 93), false) dxDrawText ("Pizzaria: Temos ... Pizzas disponíveis para entrega", 443, 5, 923, 28, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "top", false, false, false, false, false) end Edited August 17, 2019 by Jonas^ 1 Link to comment
EW1611 Posted August 17, 2019 Author Share Posted August 17, 2019 Não funcionou, passo em cima do marker não acontece nada, nenhum erro tbm Link to comment
DNL291 Posted August 17, 2019 Share Posted August 17, 2019 Tente: local marker1 = createMarker(2122.7575683594,-1784.9986572266,12.387022018433, "cylinder", 1.5) local rendering = nil addEventHandler ("onClientMarkerHit", resourceRoot, function (hitPlayer, matchingDimension) if source == marker1 then if not rendering then addEventHandler ("onClientRander", root, DX1) rendering = true end end end) function DX1 () dxDrawLine (395 - 1, 0 - 1, 395 - 1, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 0 - 1, 395 - 1, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (395 - 1, 38, 972, 38, tocolor(255, 254, 254, 255), 1, false) dxDrawLine (972, 38, 972, 0 - 1, tocolor(255, 254, 254, 255), 1, false) dxDrawRectangle (395, 0, 577, 38, tocolor(0, 0, 0, 93), false) dxDrawText ("Pizzaria: Temos ... Pizzas disponíveis para entrega", 443, 5, 923, 28, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "top", false, false, false, false, false) end Digite /debugscript 3 quando testar. Link to comment
EW1611 Posted August 17, 2019 Author Share Posted August 17, 2019 Nada tbm, nenhum erro no debugscript Link to comment
DNL291 Posted August 17, 2019 Share Posted August 17, 2019 O nome do evento tá errado, substitua "onClientRander" por "onClientRender". 1 Link to comment
EW1611 Posted August 17, 2019 Author Share Posted August 17, 2019 (edited) Agora esta funcionando, mt obrigado e desculpe o incomodo. Na verdade, agora o dx não some '-' Edited August 17, 2019 by EW1611 Link to comment
DNL291 Posted August 17, 2019 Share Posted August 17, 2019 Pra "sumir" você precisa dar essa funcionalidade ao script. Use removeEventHandler. 1 Link to comment
EW1611 Posted August 17, 2019 Author Share Posted August 17, 2019 funcionando do jeito que eu queria, mt obrigado e desculpe o incomodo 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