Malganys21 Posted September 4, 2017 Share Posted September 4, 2017 Buenas, hace poco empecé con la parte de scripting en MTA e intenté hacer un pequeño script que al entrar, cree un bind para que cuando suba a un vehículo equipe el nitro pero no funciona. script: Spoiler function nitro ( key, keyState ) local veh = getPedOccupiedVehicle ( localPlayer ) if ( keyState == "up" ) then addVehicleUpgrade ( veh, 1010 ) end end function bindKeys () bindKey ( "mouse1", "up", nitro ) end addEventHandler ( "onPlayerJoin", getRootElement(), bindKeys ) Link to comment
KaR0n! Posted September 4, 2017 Share Posted September 4, 2017 (edited) function nitro ( key ) local veh = getPedOccupiedVehicle ( localPlayer ) addVehicleUpgrade ( veh, 1010 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), nitro ) bindKey("mouse1","down", nitro) Edited September 4, 2017 by KaR0n! Link to comment
#Dv^ Posted September 4, 2017 Share Posted September 4, 2017 function nitro () local veh = getPedOccupiedVehicle ( source ) addVehicleUpgrade ( veh, 1010 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), nitro ) function bindKeys () bindKey(source, "mouse1", "down", nitro) end addEventHandler ( "onPlayerJoin", getRootElement(), bindKeys ) Link to comment
Malganys21 Posted September 5, 2017 Author Share Posted September 5, 2017 Gracias por la ayuda muchachos, solucionado. Terminé usando la solución de KaR0n! 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now