Commit 1facc09d authored by Razer's avatar Razer
Browse files

Updated journal function

parent 2d715b0f
......@@ -100,24 +100,31 @@ switch _mode do {
// RANK
// Todo only allow owner to change owner
// If owner wants to change owner add BIS_fnc_guiMessage to confirm owner change
_ranks = [["Owner",0],["Admin",10],["Member",100]]; // TODO DEFINE SOMEWHERE ELSE
_comboRank = _display getVariable "ComboRank";
_currentRank = (_ranks findIf {_memberRank == _x select 1});
lbClear _comboRank;
_comboRank lbAdd ((_ranks select _currentRank) select 0);
_comboRank lbSetCurSel 0;
_ranks deleteAt _currentRank;
// If admin (Allow change)
if (_playerRank <= 10) then {
// Add ability to change owner for owner
_rankIndexOwner = _ranks findIf {_x select 1 == 0};
if (_playerRank == 0 && _rankIndexOwner != -1) then {
_comboRank lbAdd ((_ranks select _rankIndex) select 0);
};
if (_rankIndexOwner != -1) then {_ranks deleteAt _rankIndexOwner};
// Add remaining ranks
_ranks apply {
_index = _comboRank lbAdd (_x select 0);
_comboRank lbAdd (_x select 0);
};
};
// Select current
// Select current
_display setVariable ["TargetMemberData",_memberData];
// Update comment
......@@ -206,14 +213,19 @@ switch _mode do {
_targetRank = (_ranks select _currentSelected) select 1;
if (_targetRank != _memberRank) then {
// Ask from owner if that realy wants to change owner of clan
_confirm = if (_targetRank == 0) then {
_confirm = [format ["Are you sure you want to change clan owner? (%1)",_memberName],"Confirm owner change",true,true] call BIS_fnc_guiMessage;
} else {
true
};
if !(_confirm) exitWith {};
_clanUUID = player getVariable ["clanUUID",""];
// [[_memberUUID,_clanUUID],_targetRank] remoteExec ["DB_fnc_updateClanPlayer",2];
systemChat "Rank updated";
systemChat str(_targetRank);
};
// TODO Read current selected from cbList
// TODO if rank = 0 = owner (can change owner)
// if rank = 10 = admin, can demote admins and promote players
};
case "savecomment":{
// DONE + tested
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment