Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fn_houseCleanup.sqf #730

Open
wants to merge 4 commits into
base: v5.X.X
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion life_server/Functions/Housing/fn_houseCleanup.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
File: fn_houseCleanup.sqf
Author: NiiRoZz

Description:
Cleans up containers inside in house of player.
*/
Expand All @@ -15,7 +15,27 @@ private _containers = [_query,2,true] call DB_fnc_asyncCall;
{
_x params ["_pos"];
_pos = parseSimpleArray _pos;

{
_x setPos [8417.31,25137.8,0.000846863];
_x setVariable ["trunk_in_use",true,true];

_trunkData = _x getVariable ["Trunk",[[],0]];
_containerID = _x getVariable ["container_id",-1];
_trunkData = [_trunkData] call DB_fnc_mresArray;
_query = format ["UPDATE containers SET inventory='%1' WHERE id='%2'",_trunkData,_containerID];
[_query,1] call DB_fnc_asyncCall;

_containerID = _x getVariable ["container_id",-1];
_vehItems = getItemCargo _x;
_vehMags = getMagazineCargo _x;
_vehWeapons = getWeaponCargo _x;
_vehBackpacks = getBackpackCargo _x;
_cargo = [_vehItems,_vehMags,_vehWeapons,_vehBackpacks];
_cargo = [_cargo] call DB_fnc_mresArray;
_query = format ["UPDATE containers SET gear='%1' WHERE id='%2'",_cargo,_containerID];
[_query,1] call DB_fnc_asyncCall;

deleteVehicle _x;
} forEach (nearestObjects[_pos,["Box_IND_Grenades_F","B_supplyCrate_F"],12]);
} forEach _containers;