Guten Abend Native Network.
Ich habe ein Problem mit meinem Kofferraum damals auf der Altis Version 3.1.4.8 ging dieser Code problemlos nur seid der 4.4 Version nicht mehr
Ich würde es gerne so haben das wenn man den Kofferraum öffnet und Doppelklick aufs Item macht soviel nimmt bis Inventar voll ist beim Auslagern vom Fahrzeug Inventar geht mein alter
Code nur der einlagern Code funktioniert wie gesagt seid der 4.4 Version nicht mehr kann mal ein Profi hier im Forum drüber schauen?
Es erscheint immer dieser Fehler:
Code
if(!([false,_ctrl,_num] call life_fnc_handleInv)) exitWith {hint "Couldn't remove the items from your inventory to put in the vehicle.";};
In der trunk.hpp:
Code
class PlayerGear : Life_RscListBox
{
idc = 3503;
text = "";
sizeEx = 0.030;
onMouseButtonDblClick = "[0] call life_fnc_vehStoreItem;";
x = 22 * GUI_GRID_W + GUI_GRID_X;
y = 15 * GUI_GRID_H + GUI_GRID_Y;
w = 20 * GUI_GRID_W;
h = 8 * GUI_GRID_H;
};
Alles anzeigen
in der fn_vehStoreItem.sqf:
Code
#define ctrlSelData(ctrl) (lbData[##ctrl,(lbCurSel ##ctrl)])
/*
File: fn_vehStoreItem.sqf
Author: Bryan "Tonic" Boardwine
Description:
Used in the vehicle trunk menu, stores the selected item and puts it in the vehicles virtual inventory
if the vehicle has room for the item.
*/
private["_ctrl","_num","_totalWeight","_itemWeight","_veh_data","_inv","_index","_val","_dubbl"];
disableSerialization;
_dubbl = [_this,0,1,[0]] call BIS_fnc_param;
_ctrl = ctrlSelData(3503);
_num = ctrlText 3506;
if(!([_num] call TON_fnc_isnumber)) exitWith {hint "Invalid Number format";};
_num = parseNumber(_num);
if(_num < 1) exitWith {hint "You can't enter anything below 1!";};
if(life_trunk_vehicle isKindOf "House_F") then {
_mWeight = 0;
{_mWeight = _mWeight + ([(typeOf _x)] call life_fnc_vehicleWeightCfg);} foreach (life_trunk_vehicle getVariable["containers",[]]);
_totalWeight = [_mWeight,(life_trunk_vehicle getVariable["Trunk",[[],0]]) select 1];
} else {
_totalWeight = [life_trunk_vehicle] call life_fnc_vehicleWeight;
};
if(_dubbl == 0) then {
_num = missionNameSpace getVariable ([_ctrl,0] call life_fnc_varHandle);
_itemWeight = ([_ctrl] call life_fnc_itemWeight) * _num;
while {_itemWeight > ((_totalWeight select 0) - (_totalWeight select 1))} do {_num = _num -1; _itemWeight = ([_ctrl] call life_fnc_itemWeight) * _num;};
_veh_data = life_trunk_vehicle getVariable ["Trunk",[[],0]];
_inv = _veh_data select 0;
} else {
_itemWeight = ([_ctrl] call life_fnc_itemWeight) * _num;
_veh_data = life_trunk_vehicle getVariable ["Trunk",[[],0]];
_inv = _veh_data select 0;
};
if(_ctrl == "goldbar" && {!(life_trunk_vehicle isKindOf "LandVehicle")}) exitWith {hint "Du kannst Goldbarren nur in einem Landfahrzeug einlagern!"};
if(_ctrl == "money") then
{
_index = [_ctrl,_inv] call TON_fnc_index;
if(life_cash < _num) exitWith {hint "You don't have that much cash on you to store in the vehicle!"};
if(_index == -1) then
{
_inv pushBack [_ctrl,_num];
}
else
{
_val = _inv select _index select 1;
_inv set[_index,[_ctrl,_val + _num]];
};
life_cash = life_cash - _num;
life_trunk_vehicle setVariable["Trunk",[_inv,(_veh_data select 1) + _itemWeight],true];
[life_trunk_vehicle] call life_fnc_vehInventory;
}
else
{
if(((_totalWeight select 1) + _itemWeight) > (_totalWeight select 0)) exitWith {hint "The vehicle is either full or cannot hold that much."};
if(!([false,_ctrl,_num] call life_fnc_handleInv)) exitWith {hint "Couldn't remove the items from your inventory to put in the vehicle.";};
_index = [_ctrl,_inv] call TON_fnc_index;
if(_index == -1) then
{
_inv pushBack [_ctrl,_num];
}
else
{
_val = _inv select _index select 1;
_inv set[_index,[_ctrl,_val + _num]];
};
life_trunk_vehicle setVariable["Trunk",[_inv,(_veh_data select 1) + _itemWeight],true];
[life_trunk_vehicle] call life_fnc_vehInventory;
};
Alles anzeigen
Würde mich freuen wenn mir jemand dort helfen könnte
Lieben Gruß und einen schönen Abend.