Cazomino05 Posted January 19, 2008 Share Posted January 19, 2008 (edited) Resource: http://rapidshare.com/files/85836435/ge ... d.zip.html This function is ONLY for vehicles support for anything else is not in this script Example usage (put this in your gamemode or where ever you want to doesent Have to be in this resource) obveously it could be cleaned up a little but just wanted to show how i did it and id use getElementVelocity but i prefer it this way function getPlayerSpeed2( thePlayer, commandName ) local speed = call( getResourceFromName("getPlayerSpeed"), "getPlayerSpeed", thePlayer, 1 ) if (speed ~= false) then outputChatBox( "Speed in mph: " .. speed ) end end addCommandHandler( "currentspeed", getPlayerSpeed2 ) Usages supported: Both below return mph its just your prefrence really... getPlayerSpeed( player thePlayer, "MPH" ) getPlayerSpeed( player thePlayer, 1 ) Both below return kmh its just your prefrence really... getPlayerSpeed( player thePlayer, "KMH" ) getPlayerSpeed( player thePlayer, 2 ) Returns an Integer of the the players speed Edited January 23, 2008 by Guest Link to comment
Cazomino05 Posted January 23, 2008 Author Share Posted January 23, 2008 Updated script: Smaller code more efficient thnx Talidan Link to comment
lil Toady Posted January 23, 2008 Share Posted January 23, 2008 i'd really like to see setPlayerSpeed though, or maybe even a speed-o-meter funcs Link to comment
50p Posted July 13, 2010 Share Posted July 13, 2010 This is server ? Your question is void. Link to comment
Xierra Posted July 16, 2010 Share Posted July 16, 2010 Hmm, might try this as a speed unit alternative. Thanks! Btw, Rapidshare link down... Link to comment
Thehookerkiller01 Posted August 8, 2010 Share Posted August 8, 2010 Upload to the community Link to comment
dzek (varez) Posted August 8, 2010 Share Posted August 8, 2010 link is down.. btw: this should be added as useful snippet rather than another resource.. https://wiki.multitheftauto.com/wiki/Useful_Functions edit: i just saw 2 years old bump.. speedx resource have useful function to count speed edit: if somebody needs: https://wiki.multitheftauto.com/wiki/GetElementSpeed https://wiki.multitheftauto.com/wiki/SetElementSpeed 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