igthomas Posted March 20, 2012 Share Posted March 20, 2012 Today I wanted to make players faster and thought that it's like setElementVelocity (source, speed) but then I saw X Y Z and why are they for and how could I use like to make the source 2 times faster? Link to comment
Kenix Posted March 20, 2012 Share Posted March 20, 2012 What you want create? Explain better. Link to comment
Castillo Posted March 20, 2012 Share Posted March 20, 2012 setElementVelocity set's a element velocity. Example from wiki: speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) -- get the velocity of the player named "someguy" setElementVelocity ( getPlayerFromName ( "Ted" ), speedx, speedy, speedz ) -- copy the velocity to a player named "Ted" You can't just use one simple argument, it doesn't work like game speed. Link to comment
Kenix Posted March 20, 2012 Share Posted March 20, 2012 It's not create any effect .. Explain:you set all arguments to 0 0 0 you stopped and again you create 0 0 0. You made the same.. I understand he need create fast move.( 2x faster ) -- uElement is your element.( player ) function fGetPointFromDistanceRotation( fX, fY, nDist, nAngle ) local nA = math.rad( 90 - nAngle ) local nDx = math.cos( nA ) * nDist local nDy = math.sin( nA ) * nDist return fX + nDx, fY + nDy end local fX, fY, fZ, fLx, fLy, fLz = getCameraMatrix( ) local fNewX, fNewY = fGetPointFromDistanceRotation( fX, fY, 10, getPedRotation( uElement ) ) setElementVelocity( uElement, fNewX, fNewY, fZ ) Just example Link to comment
igthomas Posted March 20, 2012 Author Share Posted March 20, 2012 Oh as I can see it's not as easy as the other setElement functions Anyway thanks for explaining on how it works. 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