Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions addons/recorder/fnc_adminUIcontrol.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ if (isNil "_adminUIDs") exitWith {

switch (_event) do {
case "connect": {
// A player just joined the mission and no admin list exists - skip
// A player just joined the mission and no admin list exists
// Still check if they are currently a server admin (e.g. mission loaded while already admin)
if (admin _owner > 0 && {!(_unit getVariable [QGVARMAIN(hasAdminControls), false])}) then {
[_owner, _unit] call _fnc_addControls;
if (GVARMAIN(isDebug)) then {
format["%1 was granted OCAP control by being a server admin", name _unit] SYSCHAT;
};
};
};
case "login": {
// A player just logged in so add controls if they don't already have them
Expand Down Expand Up @@ -134,11 +141,12 @@ private _inAdminList = _playerUID in _adminUIDs;
switch (_event) do {
case "connect": {
// A player just joined the mission
// if they are an admin, we add the diary entry
if (_inAdminList) then {
// if they are in the admin list OR already a server admin, add the diary entry
if ((_inAdminList || {admin _owner > 0}) && {!(_unit getVariable [QGVARMAIN(hasAdminControls), false])}) then {
[_owner, _unit] call _fnc_addControls;
if (GVARMAIN(isDebug)) then {
format["%1 was granted OCAP control due to being in the administratorList", name _unit] SYSCHAT;
private _reason = if (_inAdminList) then {"being in the administratorList"} else {"being a server admin"};
format["%1 was granted OCAP control due to %2", name _unit, _reason] SYSCHAT;
};
};
};
Expand Down