vinexX Posted January 18, 2017 Posted January 18, 2017 Hola amigos como podría hacer para que al entrar a una zona me de un auto ?? me pueden dar un ejemplo ?, Desde ya muchas gracias como siempre
#Dv^ Posted January 18, 2017 Posted January 18, 2017 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 )
vinexX Posted January 18, 2017 Author Posted January 18, 2017 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
vinexX Posted January 19, 2017 Author Posted January 19, 2017 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 )
vinexX Posted January 19, 2017 Author Posted January 19, 2017 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.
Recommended Posts