Player/StartSprinting

From Garry's Mod
Revision as of 11:25, 23 January 2018 by Robotboy655 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 Player:StartSprinting( )

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

This appears to be a direct binding to internal functionality that is overridden by the engine every frame so calling these functions may not have any or expected effect.

Doesn't appear to do anything.

Examples

Example

An example alternative to this function.

local vDelay = 0
local prevDown = 0
hook.Add( "StartCommand", "TestFunc", function( ply, cmd )
    if ( cmd:KeyDown( IN_FORWARD ) and prevDown == false ) then
        vDelay = CurTime() + 0.4
    elseif ( cmd:KeyDown( IN_FORWARD ) ) then
        if ( vDelay < CurTime() )then
            cmd:SetButtons( bit.bor( cmd:GetButtons(), IN_SPEED ) )
        end
    end
	prevDown = cmd:KeyDown(IN_FORWARD)
end )


Personal tools
Navigation