Hey there im using darkrp 2.5 and when i test the guns out in sandbox and they are slower when they move for example a sniper when you aim it is slow but when i go into my darkrp server and i use the sniper and the scope is very fast is there a way to change the scopes or the iron sight to make when you aim the movement is slow not sure what i need to give what files just let me know and ill give them any help is great!
i think this is what is needed but it doesnt go into affect
[lua]
/*---------------------------------------------------------
Name: function ReduceScopeSensitivity()
---------------------------------------------------------*/
local function ReduceScopeSensitivity(uCmd)
if LocalPlayer():GetActiveWeapon() and LocalPlayer():GetActiveWeapon():IsValid() then
local newAng = uCmd:GetViewAngles()
if LastViewAng then
SimilarizeAngles (LastViewAng, newAng)
local diff = newAng - LastViewAng
diff = diff * (LocalPlayer():GetActiveWeapon().MouseSensitivity or 1)
uCmd:SetViewAngles (LastViewAng + diff)
end
end
LastViewAng = uCmd:GetViewAngles()
end
hook.Add ("CreateMove", "ReduceScopeSensitivity", ReduceScopeSensitivity)
[/lua]
I just googled "site:facepunch.com mouse sensitivity lua"
[url]http://facepunch.com/showthread.php?t=1291335[/url]
Try to use the swep hook
[url]http://wiki.garrysmod.com/page/WEAPON/AdjustMouseSensitivity[/url]
[code]
function SWEP:AdjustMouseSensitivity()
return 0.75
end
[/code]
or the gamemode hook
[url]http://wiki.garrysmod.com/page/GM/AdjustMouseSensitivity[/url]
[code]
function MouseSpeed()
return 0.75
end
hook.Add("AdjustMouseSensitivity","Scope", MouseSpeed)
[/code]
can you help me a little more im not sure where to put that so that when you aim it does that if you need more of my file i will share it
bump
The wiki page he gave shows that it goes into a clientside Lua file.
It's a hook, so it modifies the behavior of the original GM:AdjutMouseSensitivity( _sensitivity ) function.
It makes the mouse move at 75% speed since he returned it at .75.
You'd need to add additional code to detect when your LocalPlayer and currently held SWEP -- LocalPlayer( ):GetActiveWeapon( ) -- IsValid and if it's aiming down the sights. You could also bind the return value to the current FOV to see if they're "zoomed" in. So many different options, it just depends on what you want to do...
Sorry, you need to Log In to post a reply to this thread.