/
givePlayer.sqf
30 lines (25 loc) · 978 Bytes
/
givePlayer.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
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
disableSerialization;
private ["_display","_isBusy"];
_isBusy = true;
player setVariable["isBusy",true,true];
if (isPlayer cursorTarget) then {
ZSC_GiveMoneyTarget = cursorTarget;
_isBusy = ZSC_GiveMoneyTarget getVariable["isBusy",false];
if (_isBusy) exitWith {
player setVariable ["isBusy",false,true];
format[localize "STR_CL_ZSC_ALREADY_TRADING",name ZSC_GiveMoneyTarget] call dayz_rollingMessages;
};
if (!_isBusy) then {
player setVariable["isBusy",true,true];
createDialog "GivePlayerDialog";
_display = uiNamespace getVariable["zsc_dialogs", displayNull];
_display displayCtrl 14002 ctrlSetText(format[localize "STR_CL_ZSC_TRANSFER_COINS",CurrencyName]);
call GivePlayerDialogAmounts;
};
} else {
localize "STR_CL_ZSC_NOT_PLAYER" call dayz_rollingMessages;
};
waitUntil {!dialog};
dayz_actionInProgress = false;