Jump to content

[REL] getPlayerSpeed


Cazomino05

Recommended Posts

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 by Guest
Link to comment
  • 2 years later...
  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...