Jump to content

Marker spawnar e destruir carro


Recommended Posts

Ola,eu estava tentando fazer um maker para criar um carro eu queria saber como que faz um marker para destruir o carro

local criar = createMarker(1604.15, -1612.056, 13.881, 'corona', 1.0, 0, 255, 255, 0 )


function vehicleSpawner(hitElement,matchingDimension)
    if getElementType(hitElement) == "player" then
        if getPedOccupiedVehicle(hitElement) == false then
        local 1604.15, -1612.056, 13.881 = getElementPosition(hitElement)
            local veh = createVehicle(599, 1604.15, -1612.056, 13.881)
            warpPedIntoVehicle(hitElement,veh)
        end
    end 
end 
addEventHandler("onMarkerHit",criar,vehicleSpawner)


 

Link to comment
local criar = createMarker(1604.15, -1612.056, 13.881, 'corona', 1.0, 0, 255, 255, 0 )


function vehicleSpawner(hitElement,matchingDimension)
	if getElementType(hitElement) == "player" then
		local vehicle = getPedOccupiedVehicle(hitElement)
 		if vehicle == false then
			local veh = createVehicle(599, 1604.15, -1612.056, 13.881)
			warpPedIntoVehicle(hitElement,veh)
		elseif vehicle then
			destroyElement( vehicle )
		end
	end 
end 
addEventHandler("onMarkerHit",criar,vehicleSpawner)

 

Edited by DNL291
Link to comment
  • 9 months later...

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