y453bh Posted April 9, 2020 Share Posted April 9, 2020 Hello, what I want is that when I'm like this on a building or wall, It lets me do the jump without time restriction (the opposite of when I'm on the floor). That way I can press the key several times to go flying through the air. Link to comment
DiGiTal Posted April 9, 2020 Share Posted April 9, 2020 https://community.multitheftauto.com/index.php?p=resources&s=details&id=15676 I hope this will help u Link to comment
Infinity-War Posted April 10, 2020 Share Posted April 10, 2020 -- # Client Side function addBindKey ( ) bindKey ( 'lshift' , 'down' , JumpVehicle ) end addEventHandler ( 'onClientResourceStart' , resourceRoot , addBindKey ) local State = false function JumpVehicle () if ( not isPedInVehicle ( localPlayer ) ) then return end if ( State == true ) then return end local Vehicle = getPedOccupiedVehicle ( localPlayer ) if ( Vehicle ) and ( getVehicleController(Vehicle) == localPlayer ) then local x , y , z = getElementVelocity ( Vehicle ) if ( isLineOfSightClear ( x , y , z , x , y + 3 , z , true , false , false , true ) ) then setElementVelocity ( Vehicle , x , y + 3 , z ) end if ( isLineOfSightClear ( x , y , z , x + 3 , y , z , true , false , false , true ) ) then setElementVelocity ( Vehicle , x + 3 , y , z ) end State = true setTimer ( function ( ) State = false end , 1000 * 5 , 1 ) end end @y453bh Link to comment
y453bh Posted April 15, 2020 Author Share Posted April 15, 2020 On 10/04/2020 at 09:48, Infinity-War said: -- # Client Side function addBindKey ( ) bindKey ( 'lshift' , 'down' , JumpVehicle ) end addEventHandler ( 'onClientResourceStart' , resourceRoot , addBindKey ) local State = false function JumpVehicle () if ( not isPedInVehicle ( localPlayer ) ) then return end if ( State == true ) then return end local Vehicle = getPedOccupiedVehicle ( localPlayer ) if ( Vehicle ) and ( getVehicleController(Vehicle) == localPlayer ) then local x , y , z = getElementVelocity ( Vehicle ) if ( isLineOfSightClear ( x , y , z , x , y + 3 , z , true , false , false , true ) ) then setElementVelocity ( Vehicle , x , y + 3 , z ) end if ( isLineOfSightClear ( x , y , z , x + 3 , y , z , true , false , false , true ) ) then setElementVelocity ( Vehicle , x + 3 , y , z ) end State = true setTimer ( function ( ) State = false end , 1000 * 5 , 1 ) end end @y453bh not working brother, it makes some weird boost 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