Possible to let more groups textscreens?
Opened this issue · 3 comments
Hello. My staff roles are mod, admin, management, and superadmin. My mod and management roles cannot permaprop textscreens because they arent default gmod groups. Is it possible to make it so I can add these groups so they can perma the textscreens? Thank you
Interesting suggestion.
Currently, it's hardcoded to ply:IsSuperAdmin
, but what if I added a hook such as TextscreensCanAdmin
, which would allow you to do things like (pseudo-code):
hook.add('TextscreensCanAdmin', "MyCustomAdminFunc", function(ply)
if ply:isMyCustomGroup() then
return true
end
return false
end)
Would this be something you're interested in?
That would be cool
I've now implemented this as described. 7b79133
The hook will need to exist both server and client side (server side for validation in the commands, client side for the context menu). For example:
hook.Add("TextscreensCanAdmin", "MyCustomAdminFunc", function(ply)
return ply:SteamID() == "STEAM_0:0:43716939"
end)
If the hook doesn't return anything, it will default to a IsSuperAdmin
check, so be sure to always return something if you want to always override the behaviour.