Page Menu
Home
1F616EMO Bugtracker
Search
Configure Global Search
Log In
Files
F156846
init.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
init.lua
View Options
-- twi_mods/additional_role/init.lua
-- Additional roles indicators
-- Copyright (C) 2024 1F616EMO
-- SPDX-License-Identifier: LGPL-3.0-or-later
local
S
=
core
.
get_translator
(
"additional_role"
)
core
.
register_privilege
(
"role_helper"
,
{
description
=
S
(
"Marked as helper in the chatroom"
),
give_to_singleplayer
=
false
,
})
beerchat_roles
.
register_role
({
name
=
S
(
"Helper"
),
color
=
"#20F99F"
,
func
=
function
(
name
)
return
core
.
check_player_privs
(
name
,
{
role_helper
=
true
})
end
,
sort
=
8900
,
})
local
auth
mail
.
register_recipient_handler
(
function
(
sender
,
name
)
if
name
~=
"additional_role:helper"
then
return
nil
end
auth
=
auth
or
core
.
get_auth_handler
()
local
list_dest
=
{}
for
i_name
in
auth
.
iterate
()
do
local
privs
=
core
.
get_player_privs
(
i_name
)
if
i_name
~=
sender
and
(
privs
.
server
or
privs
.
ban
or
privs
.
role_helper
)
then
list_dest
[
#
list_dest
+
1
]
=
i_name
end
end
return
true
,
list_dest
end
)
social_profile
.
register_role
(
"role_helper"
,
S
(
"Helper"
),
-
30
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 3, 9:04 AM (10 h, 36 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d1/3e/1ed5248ec9ac1ddb17afb361fb3c
Default Alt Text
init.lua (1 KB)
Attached To
Mode
rTWIMODS Survival Server Custom Modifications
Attached
Detach File
Event Timeline
Log In to Comment