Skip to content

Commit

Permalink
Changed so isCurator now also return true if your a curator and added…
Browse files Browse the repository at this point in the history
… a missionAdmin check that check if player is curator or admin (#1213)
  • Loading branch information
AndreasBrostrom authored Jul 17, 2024
1 parent 48c87eb commit b186778
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cScripts/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class cScripts {
class player_getRole {};

class player_isCurator {};

class player_isMissionAdmin {};
class unit_setTeamColor {};

class unit_getName {};
Expand Down
4 changes: 3 additions & 1 deletion cScripts/functions/players/fn_player_isCurator.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
* true/False <BOOLEAN>
*
* 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};
Expand Down
21 changes: 21 additions & 0 deletions cScripts/functions/players/fn_player_isMissionAdmin.sqf
Original file line number Diff line number Diff line change
@@ -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 <BOOLEAN>
*
* 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
1 change: 1 addition & 0 deletions cScripts/functions/systems/fn_allowLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b186778

Please sign in to comment.