ACE3/addons/fortify/functions/fnc_handleChatCommand.sqf
Grim e06c6f7835
General - Replace toLower with toLowerANSI where applicable (#9790)
* General - Replace toLower with toLowerANSI where applicable

* whoops

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/repair/functions/fnc_setHitPointDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/repair/dev/draw_showRepairInfo.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/vehicle_damage/functions/fnc_handleCookoff.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* comparment -> compartment

* Update fnc_showHud.sqf

* Update fnc_registerObjects.sqf

* Update addons/common/functions/fnc_cbaSettings_settingChanged.sqf

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-03-07 22:08:13 +01:00

49 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: Kingsley
* Handles the chat command usage by admin.
*
* Arguments:
* 0: Chat Text <STRING>
*
* Return Value:
* None
*
* Example:
* [""] call ace_fortify_fnc_handleChatCommand
*
* Public: No
*/
params ["_args"];
TRACE_1("handleChatCommand",_args);
_args = _args splitString " ";
if (_args isEqualTo []) exitWith {ERROR("Bad command");};
private _command = toLowerANSI (_args select 0);
_args deleteAt 0;
switch (_command) do {
// Turns fortify mode on
case "on": {
missionNamespace setVariable [QGVAR(fortifyAllowed), true, true];
};
// Turns fortify mode off
case "off": {
missionNamespace setVariable [QGVAR(fortifyAllowed), false, true];
};
// Registers fortify presets for given side
default {
_args params [["_preset", "small"], ["_budget", "-1"]];
private _side = [_command] call FUNC(parseSide);
_budget = parseNumber _budget;
private _objects = [_preset] call FUNC(getPlaceableSet);
[QGVAR(registerObjects), [_side, _budget, _objects]] call CBA_fnc_serverEvent;
};
};