function FORCE_PLAYER_WALK( player, condition )
if( condition == true ) then
bindKey(player, "w", "down", function() setControlState(player, "walk", true) setControlState(player, "forwards", true) end)
bindKey(player, "w", "up", function() setControlState(player, "walk", false) setControlState(player, "forwards", false) end)
toggleControl( player, "sprint", false )
toggleControl( player, "forwards", false )
toggleControl( player, "backwards", false )
toggleControl( player, "left", false )
toggleControl( player, "right", false )
elseif( condition == false ) then
toggleControl( player, "sprint", true )
toggleControl( player, "forwards", true )
toggleControl( player, "backwards", true )
toggleControl( player, "left", true )
toggleControl( player, "right", true )
unbindKey( player, "w", "down" )
unbindKey( player, "w", "up" )
else
return nil
end
end
addCommandHandler("force",
function( player )
FORCE_PLAYER_WALK( player, true )
end
)
addCommandHandler("forceend",
function( player )
FORCE_PLAYER_WALK( player, false )
end
)
maybe like that?