-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Добавлен плагин priv_cc #123
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- if you need to set a special name for privilege, use "beerchat.name_priv_cc = spec_name" in minetest.conf | ||
local name_priv2cc = minetest.settings:get("beerchat.priv_cc.name") | ||
if name_priv2cc == '' then name_priv2cc = 'chat_creator' end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel |
||
minetest.log("info", "to create channel add new priv: " .. name_priv2cc) | ||
minetest.register_privilege(name_priv2cc, { | ||
description = "Allows you to create a channel (mod beerchat)", | ||
give_to_singleplayer = false | ||
}) | ||
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking that it might be worth checking for the priv existing so that people can use one that already exists? Would need to wrap the registration + check in an on mods loaded callback so that mod loading isn't an issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example check: -- Privilege registration (if needed)
core.register_on_mods_loaded(function()
if not core.registered_privileges[smartshop.report_priv] then
core.register_privilege(smartshop.report_priv, {
description = S("Allow the use of smreport command."),
give_to_singleplayer = false
})
end
end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setting name in comment is not updated