618618
619619-- Should admin name be hidden from public chatbox message?
620620function isAnonAdmin4All ( admin )
621- return getElementData ( admin , " AnonAdmin " ) == true
621+ return aPlayers [ admin ] and aPlayers [ admin ][ " AnonymousAdmin " ] or false
622622end
623623
624624-- Should admin name be hidden from private chatbox message?
@@ -666,6 +666,7 @@ end )
666666local aAdminRights = {
667667 [" settings" ] = " general.tab_resources" ,
668668 [" resourcelist" ] = " general.tab_resources" ,
669+ [" adminpanel" ] = " general.adminpanel" ,
669670
670671 [" sync" ] = " command.aclmanager" ,
671672 [" aclcreate" ] = " command.aclcreate" ,
@@ -907,6 +908,13 @@ addEventHandler ( "aAdmin", root, function ( action, ... )
907908 end
908909 end
909910 end
911+ elseif ( action == " adminpanel" ) then
912+ local cmd = arg [1 ]
913+
914+ if cmd == " updateAnonymous" then
915+ local state = arg [2 ]
916+ aPlayers [client ][" AnonymousAdmin" ] = state
917+ end
910918 end
911919end )
912920
@@ -961,7 +969,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
961969 if ( action == " kick" ) then
962970 local reason = data or " "
963971 mdata = reason ~= " " and ( " (" .. reason .. " )" ) or " "
964- local isAnonAdmin = getElementData (source , " AnonAdmin " )
972+ local isAnonAdmin = isAnonAdmin4All (source )
965973 if isAnonAdmin then
966974 setTimer ( kickPlayer , 100 , 1 , player , " Anonymous admin" , reason )
967975 else
@@ -971,7 +979,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
971979 local reason = data or " "
972980 local seconds = tonumber (additional ) and tonumber (additional ) > 0 and tonumber (additional )
973981 local bUseSerial = additional2
974- local isAnonAdmin = getElementData (source , " AnonAdmin " )
982+ local isAnonAdmin = isAnonAdmin4All (source )
975983 mdata = reason ~= " " and ( " (" .. reason .. " )" ) or " "
976984 more = seconds and ( " (" .. secondsToTimeDesc (seconds ) .. " )" ) or " "
977985 if bUseSerial and getPlayerName ( player ) and not isAnonAdmin then
@@ -1034,7 +1042,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
10341042 elseif ( action == " shout" ) then
10351043 local textDisplay = textCreateDisplay ()
10361044 local textItem
1037- local anon = getElementData ( admin , " AnonAdmin " )
1045+ local anon = isAnonAdmin4All ( admin )
10381046 if (anon ) then
10391047 textItem = textCreateTextItem ( " ADMIN:\n\n " .. data , 0.5 , 0.5 , 2 , 255 , 100 , 50 , 255 , 4 , " center" , " center" )
10401048 else
0 commit comments