From b186778dfe80486e7a87f991ad79ab3a7915e0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brostr=C3=B6m=2EA=20=7C=20Evul?= Date: Wed, 17 Jul 2024 12:38:21 +0200 Subject: [PATCH] Changed so isCurator now also return true if your a curator and added a missionAdmin check that check if player is curator or admin (#1213) --- cScripts/CfgFunctions.hpp | 2 +- .../functions/players/fn_player_isCurator.sqf | 4 +++- .../players/fn_player_isMissionAdmin.sqf | 21 +++++++++++++++++++ .../functions/systems/fn_allowLoadout.sqf | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 cScripts/functions/players/fn_player_isMissionAdmin.sqf diff --git a/cScripts/CfgFunctions.hpp b/cScripts/CfgFunctions.hpp index da9d39b66..7fb540af2 100644 --- a/cScripts/CfgFunctions.hpp +++ b/cScripts/CfgFunctions.hpp @@ -68,7 +68,7 @@ class cScripts { class player_getRole {}; class player_isCurator {}; - + class player_isMissionAdmin {}; class unit_setTeamColor {}; class unit_getName {}; diff --git a/cScripts/functions/players/fn_player_isCurator.sqf b/cScripts/functions/players/fn_player_isCurator.sqf index 558331386..6edb4ef24 100644 --- a/cScripts/functions/players/fn_player_isCurator.sqf +++ b/cScripts/functions/players/fn_player_isCurator.sqf @@ -10,10 +10,12 @@ * true/False * * Example: - * call cScripts_fnc_unit_isCurator + * call cScripts_fnc_player_isCurator * */ +if (!isNull (getAssignedCuratorLogic player)) exitWith {true}; + private _curator = player getVariable [QEGVAR(Player,Unit), ""]; _curator = toLower _curator; if (_curator == "s3") exitWith {true}; diff --git a/cScripts/functions/players/fn_player_isMissionAdmin.sqf b/cScripts/functions/players/fn_player_isMissionAdmin.sqf new file mode 100644 index 000000000..523924839 --- /dev/null +++ b/cScripts/functions/players/fn_player_isMissionAdmin.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp"; +/* + * Author: SGT.Brostrom.A + * This function return true if a player is curator or admin + * + * Arguments: + * None + * + * Return Value: + * True/False + * + * Example: + * call cScripts_fnc_player_isMissionAdmin + * + */ + +if (!isNull (getAssignedCuratorLogic player)) exitWith {true}; +if (call BIS_fnc_admin > 1) exitWith {true}; +if (!isMultiplayer || {is3DENMultiplayer}) exitWith {true}; + +false \ No newline at end of file diff --git a/cScripts/functions/systems/fn_allowLoadout.sqf b/cScripts/functions/systems/fn_allowLoadout.sqf index aa518c7d9..849e34263 100644 --- a/cScripts/functions/systems/fn_allowLoadout.sqf +++ b/cScripts/functions/systems/fn_allowLoadout.sqf @@ -33,6 +33,7 @@ if (EGVAR(Staging,showAllLoadouts)) exitWith {true}; // Check if player is Zeus or Debug if (call EFUNC(player,isCurator)) exitWith {true}; +if (call EFUNC(player,isMissionAdmin)) exitWith {true}; // Check if does not have any company private _playerCompany = call EFUNC(player,getCompany);