Hay, ich habe hier eine Anleitung gefunden, hab es so gemacht, kann trotzdem Öl in normale Fahrzeuge packe
hat jemand eine lössung das mal Öl/Benzien nur in Tanklasster einfügen kann
Öl nur in Tanklasster
-
Hartixd55 -
22. Dezember 2016 um 19:30 -
Geschlossen -
Erledigt
-
-
-
ja habe ich danach gemacht
-
ja habe ich danach gemacht
Ja dann hast du was falsch gemacht. Dann Logs bitte.
-
ja, leider steht kein fehler in den Logs
-
Ich mach mir sorgen , das ich es hier falsch gemacht habe
Spoiler anzeigen
#include "..\..\script_macros.hpp"
#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","_Truck","_FuelTrucks","_FuelStuff"];
disableSerialization;
if ((life_trunk_vehicle getVariable ["trunk_in_use_by",player]) != player) exitWith { closeDialog 0; hint localize "STR_MISC_VehInvUse"; };
_ctrl = ctrlSelData(3503);
_num = ctrlText 3506;
if (!([_num] call TON_fnc_isnumber)) exitWith {hint localize "STR_MISC_WrongNumFormat";};
_num = parseNumber(_num);
if (_num < 1) exitWith {hint localize "STR_MISC_Under1";};
_totalWeight = [life_trunk_vehicle] call life_fnc_vehicleWeight;
_itemWeight = ([_ctrl] call life_fnc_itemWeight) * _num;
_veh_data = life_trunk_vehicle getVariable ["Trunk",@@c5832c867c29e0f7e36d81cac3623f935bf1e058@@;
_inv = _veh_data select 0;
if (_ctrl == "goldbar" && {!(life_trunk_vehicle isKindOf "LandVehicle")}) exitWith {hint localize "STR_NOTF_canOnlyStoreInLandVeh";};
_Truck = TypeOf life_trunk_vehicle;
_FuelStuff = ["oilu","oilp"]; //Wich Items can be stored in?
_FuelTrucks = ["C_Van_01_fuel_F","B_Truck_01_fuel_F","O_Truck_02_fuel_F","O_Truck_03_fuel_F"]; //Fuel Trucks, who are allowed to carry fuel
switch (true) do
{
case ((_ctrl in _FuelStuff) && (_Truck in _FuelTrucks)): {life_TankLaster = 1}; //Fuel in FuelTruck -> Allowed
case (!(_ctrl in _FuelStuff) && !(_Truck in _FuelTrucks)): {life_TankLaster = 2}; //NonFuel in NonFuelTruck -> Allowed
case (!(_ctrl in _FuelStuff) && (_Truck in _FuelTrucks)): {life_TankLaster = 3}; //NonFuel in FuelTruck -> Nope
case ((_ctrl in _FuelStuff) && !(_Truck in _FuelTrucks)): {life_TankLaster = 4}; //Fuel in NonFuelTruck -> Nope!
};
if (life_TankLaster == 3) exitWith {hint "Du kannst nur Öl oder Kerosin in einen Tanklaster füllen!)"};
if (life_TankLaster == 4) exitWith {hint "Du kannst Öl oder Kerosin NUR in einen Tanklaster füllen!)";};if (_ctrl == "money") then {
_index = [_ctrl,_inv] call TON_fnc_index;
if (CASH < _num) exitWith {hint localize "STR_NOTF_notEnoughCashToStoreInVeh";};
if (_index isEqualTo -1) then {
_inv pushBack [_ctrl,_num];
} else {
_val = _inv select _index select 1;
_inv set[_index,[_ctrl,_val + _num]];
};
CASH = CASH - _num;
[0] call SOCK_fnc_updatePartial;
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 localize "STR_NOTF_VehicleFullOrInsufCap";};
if (!([false,_ctrl,_num] call life_fnc_handleInv)) exitWith {hint localize "STR_CouldNotRemoveItemsToPutInVeh";};
_index = [_ctrl,_inv] call TON_fnc_index;
if (_index isEqualTo -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;
}; -
Einmal bitte die Logs da man dir sonst nur sehr schwer helfen kann.
-
-
ja, hab es vor 5 min auch einfach getestet und hat geklappt
Beitrag kann als beendet an gesehen werden