Jump to content

todos conseguem ver o marker por que?


Recommended Posts

Posted

Olá estou tentando fazer um trabalho de entregas, consegui faze-lo funcionar porem percebi que quando fui testar com um amigo a minha rota ele consegue ver e também interagir com ela pegando os meus checkpoints como posso resolver isso? 

function onStartBind(thePlayer)
     if getElementData(thePlayer, "entregadorP") == false then 
	    setElementData (thePlayer, "entregadorP", true)
	    outputChatBox("rota iniciada.", thePlayer, 122, 255, 122)
	    marker1 = createMarker(2133.99487, -1213.40466, 23.9657, "checkpoint", 5.5, 33, 255, 255, 170)
        btrabalho = createBlipAttachedTo(marker1, 12, 2)

            function markerHitTb(hitElement, matchingDimension)
                if source == marker1 and getElementType(hitElement) == "player" then
                    destroyElement(marker1)
		    destroyElement(btrabalho)
		    marker2 = createMarker(1984.42798, -1233.10547, 20.0678, "checkpoint", 5.5, 33, 255, 255, 170)
                    btrabalho = createBlipAttachedTo(marker2, 12, 2)
				end
            end
            addEventHandler("onMarkerHit", root, markerHitTb)

			function markerHitTb2(hitElement, matchingDimension)
                            if source == marker2 and getElementType(hitElement) == "player" then
                                    destroyElement(marker2)
			            destroyElement(btrabalho)
				    marker3 = createMarker(1833.17200, -1318.03601, 13.5799, "checkpoint", 5.5, 33, 255, 255, 170)
                    btrabalho = createBlipAttachedTo(marker3, 12, 2)
				end
            end
            addEventHandler("onMarkerHit", root, markerHitTb2)

			function markerHitTb3(hitElement, matchingDimension)
                if source == marker3 and getElementType(hitElement) == "player" then
                    destroyElement(marker3)
					destroyElement(btrabalho)
					marker4 = createMarker(1714.52161, -1253.03369, 13.3915, "checkpoint", 5.5, 33, 255, 255, 170)
                    btrabalho = createBlipAttachedTo(marker4, 12, 2)
				end
            end
            addEventHandler("onMarkerHit", root, markerHitTb3)

 

  • Moderators
Posted

Faça tudo client-side. Exceto a parte de criar o veículo e de dar o dinheiro.

  • Thanks 1

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.

Posted

consegui funcionou perfeitamente, tenho outra duvida como eu posso deixar uma imagem determinados segundos na tela? por exemplo quero que apareça a imagem de uma caixa por 5 segundos na tela e após isso ela suma porem não consegui achar um jeito de fazer isso.

  • Moderators
Posted
function renderBox()
	dxDrawImage(...) -- Insira a imagem aqui, junto dos valores de posição e tamanho.
end

addCommandHandler("ola", function() -- Comando para mostrar a imagem.
	addEventHandler("onClientRender", root, renderBox) -- Começa a mostrar a imagem.
	setTimer(function() -- Depois de 5 segundos:
		removeEventHandler("onClientRender", root, renderBox) -- Para de mostrar a imagem.
	end, 5000, 1)
end)

 

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