-
-
Save rubenwardy/a64eeb55b1f4ae8d7d8e630e5a00c2cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function update_basic_debug(player, value) | |
if type(player) == "string" then | |
player = core.get_player_by_name(name) | |
if not player then | |
return | |
end | |
end | |
player:hud_set_flags({ | |
basic_debug = value, | |
}) | |
end | |
core.register_privilege("basic_debug", { | |
on_grant = function(name) update_basic_debug(name, true) end, | |
on_revoke = function(name) update_basic_debug(name, false) end, | |
}) | |
core.register_on_joinplayer(function(player) | |
-- Mods may unregister the privilege | |
if not core.registered_privileges["basic_debug"] then | |
return | |
end | |
local has_priv = core.check_player_privs(player, { basic_debug = true }) | |
if has_priv then | |
update_basic_debug(player, true) | |
end | |
end)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment