Brad96 Posted September 6, 2013 Posted September 6, 2013 con que funcion le doy velocidad a un auto ej :300km/h o velocidades exageradas ? gracias Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
NodZen Posted September 6, 2013 Posted September 6, 2013 setElementVelocity ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ ) esta es la sintaxis ,el elemento es Id o solo Vehicle ? Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
NodZen Posted September 6, 2013 Posted September 6, 2013 Es el elemento a que queres darle velocidad ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 function sp(vehicle) setElementVelocity ( vehicle , 0 , 50 , 0) end function bind() bindKey (vehicle , "mouse1" , "down" , sp) end addEventHandler ("onPlayerVehicleEnter",getRootElement(),bind que pasa ahi ? no funciona Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Arsilex Posted September 6, 2013 Posted September 6, 2013 function sp(vehicle) setElementVelocity ( vehicle , 0 , 50 , 0) end function bind() bindKey (vehicle , "mouse1" , "down" , sp) end addEventHandler ("onPlayerVehicleEnter",getRootElement(),bind que pasa ahi ? no funciona function sp(player) local vehicle = getPedOccupiedVehicle ( player) setElementVelocity ( vehicle , 0 , 50 , 0) end function bind() bindKey (source, "mouse1" , "down" , sp) end addEventHandler ("onPlayerVehicleEnter",getRootElement(),bind
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 pero le da una velocidad al auto no realista ..hay una funcion que solo lo empuje parecida a esta ? Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
NodZen Posted September 6, 2013 Posted September 6, 2013 pero le da una velocidad al auto no realista ..hay una funcion que solo lo empuje parecida a esta ? Sacá el 50 y probale 10 o menos. ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 si lo empuja , pero solo lo empuja para x ,y z , yo quisiera que lo empujara para donde vaya el auto , y no puedo usar getElementRotation Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
NodZen Posted September 6, 2013 Posted September 6, 2013 Algun ejemplo de lo que quieres puede ser? ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 eeh , quiero hacer que al presionar por ej : la tecla 0 el auto empieze a cojer mucha velocidad hasta que yo suelte el bind .. pero como dije con esta funcion se ve poco realista .. o de lo que quiero Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Castillo Posted September 6, 2013 Posted September 6, 2013 Tambien podes cambiar el handling del vehiculo con setVehicleHandling. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 como siempre aprecio tu ayuda solid , pero por ahora no es lo que busco , todavia Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Sensacion Posted September 6, 2013 Posted September 6, 2013 Con setVehicleHandling puedes aumentar a la velocidad, aceleración, motor, etc a la que quieras mientras presionas un tecla usando un bind.
Brad96 Posted September 6, 2013 Author Posted September 6, 2013 pero necesito hadling o son strings pequeños ? Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Sasu Posted September 7, 2013 Posted September 7, 2013 Usa la funcion useful setElementSpeed State: Inactive
GamerDeMTA Posted September 7, 2013 Posted September 7, 2013 Usa la funcion useful setElementSpeed es una useful function...
manawydan Posted September 7, 2013 Posted September 7, 2013 try function sp(player) local vehicle = getPedOccupiedVehicle ( player) setElementSpeed(vehicle, "kph", 50) end function bind() bindKey (source, "mouse1" , "down" , sp) end addEventHandler ("onPlayerVehicleEnter",getRootElement(),bind) function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.8 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end "Querer não é poder, mas tentar é avançar"!
Brad96 Posted September 7, 2013 Author Posted September 7, 2013 Bueno gracias por ala ayuda .. pero que hace la ultima funcion de abajo ..esque queria probar esta funcion para practicar , es script simple Mi Nick En El Juego : Bs|Brad Mi Skype : fer_va_96
Sasu Posted September 7, 2013 Posted September 7, 2013 Usa la funcion useful setElementSpeed es una useful function... Y yo que dije? State: Inactive
GamerDeMTA Posted September 8, 2013 Posted September 8, 2013 Usa la funcion useful setElementSpeed es una useful function... Y yo que dije? pero con esa funcion tambien necesitaria la useful function getElementSpeed .
Recommended Posts