client/addons/store/functions/fnc_handleDelivery.sqf
Jacob Schmidt 55f60dc71f feat: Revamp admin panel, store, and arsenal systems
This commit introduces significant changes to the admin panel, store, and arsenal systems, focusing on improved functionality, UI enhancements, and code optimization.

**Admin Panel:**
- Migrated to a web-based UI for improved user experience and maintainability.
- Implemented dynamic player listing with filtering and search capabilities.
- Added functionality for managing player paygrades, sending messages, and transferring funds.
- Integrated server-side events for handling admin actions.

**Store:**
- Added `handleDelivery` event handler.
- Streamlined product selection and purchase processes.
- Improved handling of organization funds and player balances.
- Refactored code for better readability and maintainability.

**Arsenal:**
- Enhanced initialization process with improved data validation.
- Optimized item unlocking logic.

These changes aim to provide a more robust, user-friendly, and efficient experience for both administrators and players.
2025-05-03 19:33:10 -05:00

66 lines
1.5 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_store_fnc_handleDelivery
* Description:
* Handles the delivery timer and locker updates for purchased items
*
* Parameters:
* 0: New Locker Contents <ARRAY>
*
* Returns:
* None
*
* Example:
* [_newLocker] spawn forge_store_fnc_handleDelivery
*/
params [["_newLocker", [], [[]]]];
private _deliveryTime = ["DT", 0] call BIS_fnc_getParamValue;
if (_newLocker isEqualTo []) exitWith {};
if (_deliveryTime > 0) then {
[
format [
"<t align='left'>Order Processing</t><br/><t size='0.8' align='left'>Estimated delivery: %1</t>",
[_deliveryTime, "MM:SS"] call BIS_fnc_secondsToString
],
"info",
3,
"right"
] call EFUNC(misc,notify);
uiSleep (_deliveryTime / 2);
[
"<t align='left'>Package in transit</t>",
"warning",
2,
"left"
] call EFUNC(misc,notify);
uiSleep (_deliveryTime / 2);
SETPVAR(player,FORGE_Locker,_newLocker);
[
"<t align='left'>Order Delivered!</t><br/><t size='0.8' align='left'>Check your locker</t>",
"success",
5,
"left"
] call EFUNC(misc,notify);
if (hasInterface) then { playSound "FD_Finish_F"; };
} else {
SETPVAR(player,FORGE_Locker,_newLocker);
[
"<t align='left'>Order Complete!</t><br/><t size='0.8' align='left'>Items added to locker</t>",
"success",
5,
"left"
] call EFUNC(misc,notify);
if (hasInterface) then { playSound "FD_Finish_F"; };
};