mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-22 20:12:20 +03:00
Add group system
Initial commit, not tested in multiplayer yet. Some revisions still left to do.
This commit is contained in:
23
SQF/dayz_code/groups/promotePlayer.sqf
Normal file
23
SQF/dayz_code/groups/promotePlayer.sqf
Normal file
@@ -0,0 +1,23 @@
|
||||
private ["_disbandButton","_display","_group","_myGroup","_target","_uid"];
|
||||
|
||||
disableSerialization;
|
||||
_display = findDisplay 80000;
|
||||
_myGroup = _display displayCtrl 2;
|
||||
_disbandButton = _display displayCtrl 5;
|
||||
_promoteButton = _this;
|
||||
_uid = _myGroup lbData (lbCurSel _myGroup);
|
||||
|
||||
_group = group player;
|
||||
_target = _uid call dayz_getPlayer;
|
||||
|
||||
if (player == leader _group && {!isNull _target} && {_target != player}) then {
|
||||
if (local _group) then {
|
||||
_group selectLeader _target; //group must be local
|
||||
_promoteButton ctrlShow false;
|
||||
_disbandButton ctrlShow false;
|
||||
} else {
|
||||
systemChat "Failed: Group must be local to do this";
|
||||
};
|
||||
} else {
|
||||
_promoteButton ctrlShow false;
|
||||
};
|
||||
Reference in New Issue
Block a user