Jump to content

Marker Deletar Veiculos


Recommended Posts

  • Moderators

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
)

 

Link to comment
  • Other Languages Moderators
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.

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