Hallo zusammen,
ich benötige Hilfe bei diesen Script.
Ich möchte ein Schließfach erstellen in Game funktioniert alles soweit Menue usw geht auf etc.
Mein Problem ist das einbinden in die Datenbank extDB2 brauche ich Hilfe bzw jemand die mir sagt wie.
Ich stelle die Scripte hier rein das ihr euch mal rein lesen könnt.
Ich bitte um Konstruktive Beiträge
Brainfuck: SchliessfachMenu.hpp
class SchliessfachMenu
{
idd = 40000;
name = "SchliessfachMenu";
movingEnable = false;
enableSimulation = true;
class controlsBackground
{
class RscTitleBackground : life_RscText
{
colorBackground[] = {0, 0, 0, 1};
idc = -1;
x = 0.05;
y = 0.2;
w = 0.86;
h = (1 / 25);
};
class RscBackground : life_RscText
{
colorBackground[] = {0, 0, 0, 0.7};
idc = -1;
x = 0.05;
y = 0.2 + (11 / 250);
w = 0.86;
h = 0.7 - (22 / 250);
};
class RscTitleText : life_RscTitle
{
colorBackground[] = {0, 0, 0, 0};
idc = 40001;
text = "";
x = 0.05;
y = 0.2;
w = 0.7;
h = (1 / 25);
};
class VehicleWeight : RscTitleText
{
idc = 40004;
style = 1;
text = "";
};
class RscTrunkText : life_RscText
{
idc = -1;
colorBackground[] = {0, 0, 0, 0.7};
text = "Schliessfach";
sizeEx = 0.04;
x = 0.07; y = 0.25;
w = 0.4; h = 0.04;
};
class RscPlayerText : life_RscText
{
idc = -1;
colorBackground[] = {0, 0, 0, 0.7};
text = "$STR_Trunk_PInventory";
sizeEx = 0.04;
x = 0.49; y = 0.25;
w = 0.4; h = 0.04;
};
};
class Controls
{
class TrunkGear : life_RscListBox
{
idc = 40002;
text = "";
sizeEx = 0.030;
x = 0.07; y = 0.29;
w = 0.4; h = 0.42;
};
class PlayerGear : life_RscListBox
{
idc = 40003;
text = "";
sizeEx = 0.030;
x = 0.49; y = 0.29;
w = 0.4; h = 0.42;
};
class TrunkEdit : life_RscEdit
{
idc = 40005;
text = "1";
sizeEx = 0.030;
x = 0.07; y = 0.72;
w = 0.4; h = 0.03;
};
class PlayerEdit : life_RscEdit
{
idc = 40006;
text = "1";
sizeEx = 0.030;
x = 0.49; y = 0.72;
w = 0.4; h = 0.03;
};
class TakeItem : life_RscButtonMenu
{
idc = -1;
text = "$STR_Trunk_Take";
colorBackground[] = {0, 0, 0, 0.7};
onButtonClick = "[] call life_fnc_schliessfach_TakeItem;";
x = 0.20; y = 0.78;
w = (6.25 / 40);
h = (1 / 25);
};
class StoreItem : life_RscButtonMenu
{
idc = -1;
text = "$STR_Trunk_Store";
colorBackground[] = {0, 0, 0, 0.7};
onButtonClick = "[] call life_fnc_schliessfach_StoreItem;";
x = 0.60; y = 0.78;
w = (6.25 / 40);
h = (1 / 25);
};
class ButtonClose : life_RscButtonMenu
{
idc = -1;
shortcuts[] = {0x00050000 + 2};
text = "$STR_Global_Close";
onButtonClick = "closeDialog 0;";
x = 0.05;
y = 0.9 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
class footer : life_RscText
{
idc = -1;
text = "Random Text";
x = 0.3;
y = 0.9 - (1 / 25);
w = (8.25 / 30);
h = (1 / 25);
};
class footer2 : life_RscText
{
idc = -1;
text = "Random Text";
x = 0.3;
y = 0.91;
w = (8.25 / 30);
h = (1 / 25);
};
};
};
Alles anzeigen
Brainfuck: fn_schliessfach_StoreItem.sqf
disableSerialization;
_ctrl = lbData[40003,(lbCurSel 40003)];
_num = ctrlText 40006;
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!";};
_totalWeight = [schliessfach] call life_fnc_vehicleWeight;
_itemWeight = ([_ctrl] call life_fnc_itemWeight) * _num;
_veh_data = schliessfach getVariable ["Trunk",[[],0]];
_inv = _veh_data select 0;
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]];
};
schliessfach setVariable["Trunk",[_inv,(_veh_data select 1) + _itemWeight],false];
[schliessfach] call life_fnc_schliessfachfenster;
Alles anzeigen
Brainfuck: fn_schliessfachfenster.sqf
/*
File: fn_vehInventory.sqf
Author: Bryan "Tonic" Boardwine
Description:
Used a refresher for the vehicle inventory / trunk menu items.
*/
#include <macro.h>
private["_veh","_tInv","_pInv","_veh_data"];
_veh = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
disableSerialization;
_tInv = (findDisplay 40000) displayCtrl 40002;
_pInv = (findDisplay 40000) displayCtrl 40003;
lbClear _tInv;
lbClear _pInv;
_mWeight = 500000;
_veh_data = [_mWeight,(schliessfach getVariable["Trunk",[[],0]]) select 1];
ctrlSetText[40004,format[(localize "STR_MISC_Weight")+ " %1/%2",_veh_data select 1,_veh_data select 0]];
_data = schliessfach getVariable ["Trunk",[]];
if(count _data == 0) then
{
schliessfach setVariable["Trunk",[[],0],false];
_data = [];
}
else
{
_data = _data select 0;
};
//Player Inventory Items
{
_val = ITEM_VALUE(configName _x);
if(_val > 0) then {
_pInv lbAdd format["[%1] - %2",_val,localize (getText(_x >> "displayName"))];
_pInv lbSetData [(lbSize _pInv)-1,configName _x];
_icon = M_CONFIG(getText,"VirtualItems",configName _x,"icon");
if(!(EQUAL(_icon,""))) then {
_pInv lbSetPicture [(lbSize _pInv)-1,_icon];
};
};
} foreach ("true" configClasses (missionConfigFile >> "VirtualItems"));
//Trunk Inventory Items
{
_name = M_CONFIG(getText,"VirtualItems",SEL(_x,0),"displayName");
_val = SEL(_x,1);
if(_val > 0) then {
_tInv lbAdd format["[%1] - %2",_val,localize _name];
_tInv lbSetData [(lbSize _tInv)-1,SEL(_x,0)];
_icon = M_CONFIG(getText,"VirtualItems",SEL(_x,0),"icon");
if(!(EQUAL(_icon,""))) then {
_tInv lbSetPicture [(lbSize _tInv)-1,_icon];
};
};
} foreach _data;
Alles anzeigen
Brainfuck: fn_schliessfach_TakeItem.sqf
/*
Chris
*/
private["_ctrl","_num","_index","_data","_old","_value","_weight","_diff"];
disableSerialization;
if(isNull schliessfach OR !alive schliessfach) exitWith {hint localize "STR_MISC_VehDoesntExist"};
if(!alive player) exitwith {closeDialog 0;};
if((lbCurSel 40002) == -1) exitWith {hint localize "STR_Global_NoSelection";};
_ctrl = lbData[40002,(lbCurSel 40002)];
_num = ctrlText 40005;
if(!([_num] call TON_fnc_isnumber)) exitWith {hint localize "STR_MISC_WrongNumFormat";};
_num = parseNumber(_num);
if(_num < 1) exitWith {hint localize "STR_MISC_Under1";};
_index = [_ctrl,((schliessfach getVariable "Trunk") select 0)] call TON_fnc_index;
_data = (schliessfach getVariable "Trunk") select 0;
_old = schliessfach getVariable "Trunk";
if(_index == -1) exitWith {};
_value = _data select _index select 1;
if(_num > _value) exitWith {hint localize "STR_MISC_NotEnough"};
_num = [_ctrl,_num,life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
if(_num == 0) exitWith {hint localize "STR_NOTF_InvFull"};
_weight = ([_ctrl] call life_fnc_itemWeight) * _num;
if([true,_ctrl,_num] call life_fnc_handleInv) then
{
if(_num == _value) then
{
_data set[_index,-1];
_data = _data - [-1];
}
else
{
_data set[_index,[_ctrl,(_value - _num)]];
};
schliessfach setVariable["Trunk",[_data,(_old select 1) - _weight],false];
[schliessfach] call life_fnc_schliessfachfenster;
}
else
{
hint localize "STR_NOTF_InvFull";
};
Alles anzeigen
Brainfuck: fn_schliessfachoeffnen.sqf
if(!createDialog "SchliessfachMenu") exitWith {hint localize "STR_MISC_DialogError";}; //Couldn't create the menu?
disableSerialization;
_mWeight = 500000;
_veh_data = [_mWeight,(schliessfach getVariable["Trunk",[[],0]]) select 1];
ctrlSetText[40004,format[(localize "STR_MISC_Weight")+ " %1/%2",_veh_data select 1,_veh_data select 0]];
[schliessfach] call life_fnc_schliessfachfenster;
Alles anzeigen