Skip to content

Commit

Permalink
Let owner block their bindings (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrb93 authored Feb 4, 2025
1 parent 7c40a41 commit 5bbb36e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/starfall/libs_sh/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,15 @@ SF.hookAdd(PlayerButtonUp, "inputreleased", CheckButtonPerms)
-- @name InputBindPressed
-- @class hook
-- @param string bind Name of keybind pressed
-- @return boolean Returning true will block the binding from being pressed for the chip owner
SF.hookAdd("PlayerBindPress", "inputbindpressed", function(instance, ply, bind)
if haspermission(instance, nil, "input") then
return true, {bind}
end
return false
end,
function(instance, args, ply)
if args[1] and args[2] and instance.player == LocalPlayer() then return true end
end)

--- Called when the mouse is moved
Expand Down

0 comments on commit 5bbb36e

Please sign in to comment.