DiGiTal Posted December 30, 2019 Share Posted December 30, 2019 Hi, i want to make my player running fast but it didn't once jump it going from the air like a arrow function updateCamera () local xs, ys, zs = getElementVelocity(localPlayer) setElementVelocity(localPlayer, xs*2, ys*2, zs*2) end addEventHandler ( "onClientPreRender", root, updateCamera ) Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 That is not ging to work. The GTA engine will adjust the running speed to the default until the ped leaves the ground. You could try to use a walk animation and speed it up: https://wiki.multitheftauto.com/wiki/SetPedAnimationSpeed 1 Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 @IIYAMA nothing happens addEventHandler( "onClientResourceStart", getRootElement( ), function ( ) setPedAnimationSpeed (localPlayer,"sprint_civi",0.001) end ) Link to comment
Moderators Patrick Posted December 30, 2019 Moderators Share Posted December 30, 2019 It speeds up everything, but maybe helps: https://wiki.multitheftauto.com/wiki/SetGameSpeed Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 (edited) 36 minutes ago, DiGiTal said: nothing happens Use resourceRoot, not getRootElement... or don't even use onResourceStart at all. Just run the line for the animation speed. Because wrong using this event can lead to bugs. Where are you starting the animation? Because it is missing in your code. Without animation you will not notice the difference. --------- P.s you might need this instead because it doesn't allow you to go faster than 100% = 1. https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress Edited December 30, 2019 by IIYAMA Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 addEventHandler( "onClientRender", root, function ( ) setPedAnimationSpeed (localPlayer,"run_player",0.5) setPedAnimationSpeed (localPlayer,"SPRINT_civi",0.5) end ) @IIYAMA i used this works fine , but it slows the player. and the limit of the animspeed is 1 (1== default) https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress tried doesn't work at all addEventHandler( "onClientRender", root, function ( ) setPedAnimationSpeed (localPlayer,"run_player",1) setPedAnimationSpeed (localPlayer,"SPRINT_civi",1) setPedAnimationProgress ( localPlayer "run_player",1) setPedAnimationProgress ( localPlayer "SPRINT_civi",1) end ) Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 4 minutes ago, DiGiTal said: player. and the limit of the animspeed Use this instead: https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress + onClientRender Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 animationProgress just my player no animation but like freezing but keep moving slowly Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 3 minutes ago, DiGiTal said: animationProgress just my player no animation but like freezing but keep moving slowly An animation goes from 0 to 100%. That takes an amount of time. But what if you increase that progress? Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 addEventHandler( "onClientRender", root, function ( ) setPedAnimationProgress ( localPlayer,"run_player",1) setPedAnimationSpeed (localPlayer,"run_player",1) end ) like bugging animation but keep moving ,nothing more speed added Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 38 minutes ago, DiGiTal said: like bugging animation but keep moving ,nothing more speed added You are putting the animation progress to 100% ever frame... That is the same as 0% progress. Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 Why mention the progress of the animation , i think it's useless. i don't understand your idea Link to comment
Moderators IIYAMA Posted December 30, 2019 Moderators Share Posted December 30, 2019 4 minutes ago, DiGiTal said: Why mention the progress of the animation , i think it's useless. i don't understand your idea You do not understand that you have to go through an animation from 0% to 100% in order to even do the animation in the first place? Link to comment
DiGiTal Posted December 30, 2019 Author Share Posted December 30, 2019 that's why i dont understand why we must specify a % for the animation ! ! so just need to speed it 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