-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnc_changeFIAmoney.sqf
45 lines (36 loc) · 1.57 KB
/
fnc_changeFIAmoney.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "macros.hpp"
AS_SERVER_ONLY("AS_fnc_changeFIAmoney.sqf");
if (not isNil "AS_LOCK_changeFIAmoney") then {
waitUntil {sleep 1; isNil "AS_LOCK_changeFIAmoney"};
};
AS_LOCK_changeFIAmoney = true;
params [["_hr", 0], ["_resourcesFIA", 0]];
private _hrT = AS_P("hr");
private _resourcesFIAT = AS_P("resourcesFIA");
_hrT = _hrT + _hr;
_resourcesFIAT = round (_resourcesFIAT + _resourcesFIA);
if (_hrT > 0) then {
_hrT = _hrT min (["HR"] call fnc_BE_permission);
};
//_hrT = _hrT max 0; //HR can go to negative upon player death (for balance, player death deducts HR but players must be spawned regardelss -> HR debt)
_resourcesFIAT = _resourcesFIAT max 0;
AS_Pset("hr", _hrT);
AS_Pset("resourcesFIA", _resourcesFIAT);
AS_LOCK_changeFIAmoney = nil;
private _texto = "";
private _hrSim = "";
if (_hr > 0) then {_hrSim = "+"};
private _resourcesFIASim = "";
if (_resourcesFIA > 0) then {_resourcesFIASim = "+"};
if ((_hr != 0) and (_resourcesFIA != 0)) then {
_texto = format ["<t size='0.6' color='#C1C0BB'>FIA Resources.<br/> <t size='0.5' color='#C1C0BB'><br/>HR: %3%1<br/>Money: %4%2 €",_hr,_resourcesFIA,_hrSim,_resourcesFIASim]
} else {
if (_hr != 0) then {
_texto = format ["<t size='0.6' color='#C1C0BB'>FIA Resources.<br/> <t size='0.5' color='#C1C0BB'><br/>HR: %3%1",_hr,_resourcesFIA,_hrSim]
} else {
_texto = format ["<t size='0.6' color='#C1C0BB'>FIA Resources.<br/> <t size='0.5' color='#C1C0BB'><br/>Money: %4%2 €",_hr,_resourcesFIA,_hrSim,_resourcesFIASim]
};
};
if (_texto != "") then {
[petros,"income",_texto] remoteExec ["AS_fnc_localCommunication", AS_CLIENTS];
};