Flipi Posted August 17, 2013 Posted August 17, 2013 Hola necesito ayuda con mi script, no me funciona el flip.. function flip(thePlayer) local Vehiculo = getPedOccupiedVehicle(thePlayer) if Vehiculo then outputChatBox("#0080FFVehiculo volteado!",thePlayer, 0,128,255, true) flip(Vehiculo) playSoundFrontEnd ( thePlayer, 101 ) else outputChatBox("#0080FFNo tienes un vehiculo para voltearlo!",thePlayer, 0,128,255, true) end end addEventHandler("onPlayerJoin",root,function() bindKey(source,"3", "down", flip) end) function onStart() for id, players in ipairs(getElementsByType("player")) do bindKey(players ,"3", "down", flip) end end
Castillo Posted August 17, 2013 Posted August 17, 2013 Eso es porque no tiene sentido, estas ejecutando la misma funcion que ejecuta a esa. Tenes que usar setElementRotation para voltearlo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted August 17, 2013 Author Posted August 17, 2013 Eso es porque no tiene sentido, estas ejecutando la misma funcion que ejecuta a esa.Tenes que usar setElementRotation para voltearlo. y como seria entonces?, que soy novato
BorderLine Posted August 17, 2013 Posted August 17, 2013 function buyFlip(p) if (isPedInVehicle(p)) then local v = getPedOccupiedVehicle(p) local x, y, z = getElementRotation (v) setElementRotation (v, 0, 0, (x > 90 and x < 270) and (z + 180) or z) end end addCommandHandler("flip", buyFlip) hazte una idea con eso Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
Flipi Posted August 17, 2013 Author Posted August 17, 2013 function buyFlip(p) if (isPedInVehicle(p)) then local v = getPedOccupiedVehicle(p) local x, y, z = getElementRotation (v) setElementRotation (v, 0, 0, (x > 90 and x < 270) and (z + 180) or z) end end addCommandHandler("flip", buyFlip) hazte una idea con eso funciona pero tira error un error en la parte de la linea 2 function flip(thePlayer) local Vehiculo = getPedOccupiedVehicle(thePlayer) if Vehiculo then outputChatBox("#0080FFVehiculo volteado!",thePlayer, 0,128,255, true) flip(Vehiculo) local x, y, z = getElementRotation (Vehiculo) setElementRotation (Vehiculo, 0, 0, (x > 90 and x < 270) and (z + 180) or z) playSoundFrontEnd ( thePlayer, 101 ) else outputChatBox("#0080FFNo tienes un vehiculo para voltearlo!",thePlayer, 0,128,255, true) end end addEventHandler("onPlayerJoin",root,function() bindKey(source,"3", "down", flip) end) function onStart() for id, players in ipairs(getElementsByType("player")) do bindKey(players ,"3", "down", flip) end end
FraN-724 Posted August 17, 2013 Posted August 17, 2013 function flip(thePlayer) local Vehiculo = getPedOccupiedVehicle(thePlayer) if Vehiculo then local x, y, z = getElementRotation (Vehiculo) setElementRotation (Vehiculo, 0, 0, (x > 90 and x < 270) and (z + 180) or z) playSoundFrontEnd ( thePlayer, 101 ) outputChatBox("#0080FFVehiculo volteado!",thePlayer, 0,128,255, true) else outputChatBox("#0080FFNo tienes un vehiculo para voltearlo!",thePlayer, 0,128,255, true) end end addEventHandler("onPlayerJoin",root,function() bindKey(source,"3", "down", flip) end) function onStart() for id, players in ipairs(getElementsByType("player")) do bindKey(players ,"3", "down", flip) end end
Flipi Posted August 17, 2013 Author Posted August 17, 2013 function flip(thePlayer) local Vehiculo = getPedOccupiedVehicle(thePlayer) if Vehiculo then local x, y, z = getElementRotation (Vehiculo) setElementRotation (Vehiculo, 0, 0, (x > 90 and x < 270) and (z + 180) or z) playSoundFrontEnd ( thePlayer, 101 ) outputChatBox("#0080FFVehiculo volteado!",thePlayer, 0,128,255, true) else outputChatBox("#0080FFNo tienes un vehiculo para voltearlo!",thePlayer, 0,128,255, true) end end addEventHandler("onPlayerJoin",root,function() bindKey(source,"3", "down", flip) end) function onStart() for id, players in ipairs(getElementsByType("player")) do bindKey(players ,"3", "down", flip) end end WOW! gracias!! !
Recommended Posts