ACE3/addons/markers/functions/fnc_canMove.sqf
McDiod fcfe278f7f markers - add setting allowing only marker creator to move (#6734)
* markers - add setting allowing only marker creator to move

* shorten setting display names

* delete some whitespace, superfluous command

* single arg needs no array

* delete some whitespace

* don't save directPlayID default value

* Save array of user placed markers
2019-01-03 13:31:21 -06:00

35 lines
796 B
Plaintext

#include "script_component.hpp"
/*
* Author: chris579
* Checks whether the player can move markers.
*
* Arguments:
* 0: Marker Name <STRING>
*
* Return Value:
* Whether the player can move markers <BOOL>
*
* Example:
* ["X"] call ace_markers_fnc_canMove
*
* Public: No
*/
params [["_marker",""]];
switch (GVAR(moveRestriction)) do {
case MOVE_RESTRICTION_NOBODY: {false};
case MOVE_RESTRICTION_ALL: {true};
case MOVE_RESTRICTION_ADMINS: {IS_ADMIN};
case MOVE_RESTRICTION_GROUP_LEADERS: {
leader ACE_player == ACE_player
};
case MOVE_RESTRICTION_GROUP_LEADERS_ADMINS: {
(leader ACE_player == ACE_player) || IS_ADMIN
};
case MOVE_RESTRICTION_OWNER: {
_marker in GVAR(userPlacedMarkers)
};
default {true};
}; // return