Jump to content

Marker Deletar Veiculos


Recommended Posts

Posted

Galera tem como colocar um marker pra deletar so um tipo de veiculo tipo so o id 416 qnd ele passar em cima so o veiculo id 416 e deletado e os outros q passar nao

Posted

Por favor, crie o post na seção Portuguese / Português da próxima vez. Essa seção é apenas para a linguagem inglesa.

Sobre o seu problema:

addEventHandler( "onMarkerHit", marker,
	function ( hitElement )
		if getElementModel(vehicle) == 416 then -- verificando se o id do veículo é 416
			destroyElement(vehicle)
		end
	end
)

 

Please do not PM me with scripting related question nor support, use the forums instead.

  • Moderators
Posted
11 hours ago, DNL291 said:

(code)

Vai dar erro pois vehicle não foi declarado em lugar nenhum.

addEventHandler ("onMarkerHit", marker,	function (hitElement)
	if (getElementType (hitElement) == "vehicle") then -- Se o elemento que colidiu no marker for um veículo, então:
		if (getElementModel (hitElement) == 416) then -- Se o id do veículo que colidiu no marker for 416, então:
			destroyElement (hitElement) -- Destrói o veículo.
		end
	end
end)

Obs: Considerando que vc já criou o marker antes com createMarker.

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

Minha intenção foi só deixar a verificação com o getElementModel, por isso eu usei os valores genéricos vehicle e marker. Também vai precisar verificar se o veículo tem motorista (getVehicleController).

 

Please do not PM me with scripting related question nor support, use the forums instead.

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