Jump to content

[Ayuda] como setear un auto en un createColRectangle


vinexX

Recommended Posts

Quizás esto te sirva, no lo probé
 

local col_radar = createRadarArea(-1328, -160, 100, 100, 0, 255, 0, 150) -- Zona en el aeropuerto de SF
local rx, ry = getElementPosition(col_radar)
local col_shape = createColCuboid(rx, ry, 13, 100, 100, 10)
local car = {}

addEventHandler("onColShapeHit", col_shape,
	function(p)
		if getElementType(p) == "player" then
			if not isPedInVehicle(p) then
				if isElement(car[p]) then
					destroyElement(car[p])
				end
				local x, y, z = getElementPosition(p)
				car[p] = createVehicle(411, x, y, z)
				warpPedIntoVehicle(p, car[p])
			end
		end
	end
)

 

Link to comment
45 minutes ago, #Dv^ said:

Quizás esto te sirva, no lo probé
 


local col_radar = createRadarArea(-1328, -160, 100, 100, 0, 255, 0, 150) -- Zona en el aeropuerto de SF
local rx, ry = getElementPosition(col_radar)
local col_shape = createColCuboid(rx, ry, 13, 100, 100, 10)
local car = {}

addEventHandler("onColShapeHit", col_shape,
	function(p)
		if getElementType(p) == "player" then
			if not isPedInVehicle(p) then
				if isElement(car[p]) then
					destroyElement(car[p])
				end
				local x, y, z = getElementPosition(p)
				car[p] = createVehicle(411, x, y, z)
				warpPedIntoVehicle(p, car[p])
			end
		end
	end
)

 

Muchas gracias me funciono tu eres uno de los que siempre me ayuda :v de verdad muchas gracias bro :D 

Link to comment

Bro, para no crear otro post... como puedo hacer para que al morir me vuelva a setear el auto pero solo si muero en esa zona ? :/

addEventHandler("onPlayerWasted", root,
	function(p)
	if getElementData(source,"zona") == true then
	local x, y, z = getElementPosition(p)
	car[p] = createVehicle(556, x, y, z)
	warpPedIntoVehicle(p, car[p])
    setTimer(spawn2, 1801, 1, source)	
	
	else

	end
end
)

 

Link to comment
14 hours ago, vinexX said:

Bro, para no crear otro post... como puedo hacer para que al morir me vuelva a setear el auto pero solo si muero en esa zona ? :/


addEventHandler("onPlayerWasted", root,
	function(p)
	if getElementData(source,"zona") == true then
	local x, y, z = getElementPosition(p)
	car[p] = createVehicle(556, x, y, z)
	warpPedIntoVehicle(p, car[p])
    setTimer(spawn2, 1801, 1, source)	
	
	else

	end
end
)

 

Solucionado.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...