forked from LexTheGreat/TLX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drop.sqf
52 lines (43 loc) · 1.67 KB
/
drop.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
46
47
48
49
50
51
52
liafu = true;
_item = _this select 0;
_amount = _this select 1;
if ((!INV_CanUseInventory) or (!INV_CanDropItem)) exitWith {
player groupChat localize "STRS_inv_inventar_cannotdrop";
};
if(!isnull (nearestobjects[getpos player, droppableitems, 1] select 0)) exitWith {
player groupchat "You cannot drop items on top of each other. move and try again."
};
if (_amount <= 0) exitwith {
//format["hint ""%1 has dropped %2!"";", (name player), _amount] call broadcast;
};
if (_item == "MONEY") then {
["DROP MONEY LOGGER", str (name player), _amount] call fn_LogToServer;
};
//player commandChat format ["%1 and %2", _item, _amount];
if (_item == "MONEY" && _amount < 1000) exitWith {
player groupChat "You cant drop less than 1,000 dollars";
};
if (_item == "MONEY" && _amount > 500000) exitWith {
player groupChat "You cant drop more than 500,000 dollars";
};
if (_item call INV_GetItemDropable) then {
if ([player, _item, -(_amount)] call INV_AddInventoryItem) then {
player groupChat localize "STRS_inv_inventar_weggeworfen";
if(primaryweapon player == "" and secondaryweapon player == "")then{player playmove "AmovPercMstpSnonWnonDnon_AinvPknlMstpSnonWnonDnon"}else{player playmove "AinvPknlMstpSlayWrflDnon"};
sleep 1.5;
private "_class";
_class = [_item] call item2class;
_pos = getPosATL player;
_object = createVehicle [_class, _pos, [], 0, "NONE"];
liafu = true;
_object setposASL getposASL player;
_object setvariable ["droparray", [([_amount] call encode_number), _item], true];
}
else {
player groupChat localize "STRS_inv_inventar_drop_zuwenig";
};
}
else {
player groupChat localize "STRS_inv_inventar_ablege_verbot";
};
[] spawn { call onActionSaver;};