client/addons/bank/functions/fnc_submit.sqf
Jacob Schmidt f8391463b2
All checks were successful
Build / Build (push) Successful in 28s
feat: Implement timesheets and pending payments in bank UI
This commit introduces the timesheet submission feature and displays pending payments in the bank UI.

The following changes were made:

- Added a "Submit Timesheet" action tile to the bank UI.
- Implemented the `handleTimesheet` function in `script.js` to handle timesheet submissions.
- Updated the UI to display pending payments based on player rating and a server-side multiplier.
- Modified server-side event handling to process timesheet submissions and calculate payments.
- Added a refresh timer to update player data every 30 seconds.
- Updated the player load event to include the player's rating.
2025-05-11 01:19:44 -05:00

42 lines
1.0 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_client_bank_fnc_submit
* Author: IDSolutions
*
* [Description]
* Submits the timesheet
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* None
*
* Public: Yes
*/
private _payMultiplyer = "MULTIPLYR" call BFUNC(getParamValue);
private _plyscore = rating player; //TODO: Implement rating from server
private _multiplyer = _plyscore * _payMultiplyer;
_bank = _bank + _multiplyer;
private _formattedRating = _bank call EFUNC(misc,formatNumber);
private _messageData = createHashMapFromArray [
["event", "SUBMIT::TIMESHEET"],
["data", []]
];
private _response = ["forge_client_bank_handleEvents", (toJSON _messageData)] call CFUNC(localEvent);
if (_response) then {
[format ["Submitted timesheet! Received $%1 based on rating of %2", _formattedRating, _plyscore], "info", 3, "right"] call EFUNC(misc,notify);
} else {
[format ["Timesheet submission failed"], "warning", 3, "right"] call EFUNC(misc,notify);
};
[] call FUNC(refresh);