Moin,
ich war gestern die gesamte Zeit auf der Suche nach einer Lösung aber irgendwie habe ich es verpeilt eventuell habt ihr eine Idee wie ich an die Daten rankomme. Also ich habe eine Verwahrstelle mit Koppelung der WantedListe gebaut. Das Einfügen der Daten hat Problem los geklappt und ich habe auch das Auslesen hinbekommen. Ich habe nur an der Stelle mit dem Auslösen/ Ausparken ein Problem, dass ich in der fn_unimpound nicht mehr an die Daten komme. So hier mal der Code um den es geht.
C: fn_impoundMenu
#include "..\..\script_macros.hpp"
/*
File: fn_impoundMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Not actually a impound menu, may act as confusion to some but that is what I wanted.
The purpose of this menu is it is now called a 'Garage' where vehicles are stored (persistent ones).
*/
#define Button1 2812;
#define Title 2801;
private["_vehicles","_control","_type","_Button1","_title"];
disableSerialization;
_vehicles = [_this,0,[],[[]]] call BIS_fnc_param;
_type = [_this,1,"",[""]] call BIS_fnc_param;
_display = findDisplay 2800;
_Button1 = _display displayCtrl Button1;
_title = _display displayCtrl Title;
ctrlShow[2803,false];
ctrlShow[2830,false];
waitUntil {!isNull (findDisplay 2800)};
if(count _vehicles == 0) exitWith
{
ctrlSetText[2811,localize "STR_Garage_NoVehicles"];
};
_control = (_display displayCtrl 2802);
lbClear _control;
{
_vehicleInfo = [_x select 2] call life_fnc_fetchVehInfo;
_control lbAdd (_vehicleInfo select 3);
_tmp = [_x select 2,_x select 8,_type];
if (_type isEqualTo "jail") then { _tmp = [_x select 2,_x select 8,_type,_x select 10]}; //Felder: Classname, Color, Jail, Jail_Price (Kosten zum Ausparken)
_tmp = str(_tmp);
_control lbSetData [(lbSize _control)-1,_tmp];
_control lbSetPicture [(lbSize _control)-1,_vehicleInfo select 2];
_control lbSetValue [(lbSize _control)-1,_x select 0];
} foreach _vehicles;
lbSort _control;
ctrlShow[2810,false];
ctrlShow[2811,false];
if (_type isEqualTo "insure") then {
_Button1 ctrlSetText "Reparieren";
_Button1 buttonSetAction "[] call life_fnc_restoreVehicle; closeDialog 0;";
_title ctrlSetText "Versicherung";
} else {
_Button1 ctrlSetText localize "STR_Global_Retrieve";
if (_type isEqualTo "jail") then {_Button1 ctrlSetText "Auslösen"};
_Button1 buttonSetAction "[] call life_fnc_unimpound; closeDialog 0;";
_title ctrlSetText localize"STR_GUI_Garage";
};
Alles anzeigen
Soweit so gut hier stehen noch die richtigen Werte drin und auch im Dialog wird alles richtig angezeigt. Wenn ich nun die fn_unimpound aufrufen kann ich auf die Werte nicht mehr zugreifen.
C: fn_unimpound.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_unimpound.sqf
Author: Bryan "Tonic" Boardwine
Description:
Yeah... Gets the vehicle from the garage.
*/
private["_vehicle","_vid","_pid","_unit","_price","_texture","_type","_dataArr"];
disableSerialization;
if(lbCurSel 2802 == -1) exitWith {hint localize "STR_Global_NoSelection"};
_vehicle = lbData[2802,(lbCurSel 2802)];
_vehicle = (call compile format["%1",_vehicle]) select 0;
_vid = lbValue[2802,(lbCurSel 2802)];
_type = (call compile format["%1",_vehicle]) select 2;
_pid = getPlayerUID player;
_unit = player;
_texture = [_vehicle] call life_fnc_vehicleColorCfg;
if(isNil "_vehicle") exitWith {hint localize "STR_Garage_Selection_Error"};
_price = [_vehicle,__GETC__(life_garage_prices)] call TON_fnc_index;
if(_price == -1) then {_price = 1000;} else {_price = (__GETC__(life_garage_prices) select _price) select 1;};
if (_type isEqualTo "jail") then {
_price = (call compile format["%1",_vehicle]) select 0;
};
if(life_atm5cash < _price) exitWith {hint format[(localize "STR_Garage_CashError"),[_price] call life_fnc_numberText];};
if(typeName life_garage_sp == "ARRAY") then {
[[_vid,_pid,life_garage_sp select 0,_unit,_price,life_garage_sp select 1],"TON_fnc_spawnVehicle",false,false] spawn life_fnc_MP;
} else {
if(life_garage_sp in ["medic_spawn_1","medic_spawn_2","medic_spawn_3"]) then {
[[_vid,_pid,life_garage_sp,_unit,_price,_texture,_type],"TON_fnc_spawnVehicle",false,false] spawn life_fnc_MP;
} else {
_pos = getMarkerPos life_garage_sp;
//SSG Spawnpunkt
if (life_garage_sp == "air_g_144") then {
_pos = [_pos select 0,_pos select 1,5.46];
};
//Kartell
if (life_garage_sp == "air_g_2") then {
_pos = [_pos select 0,_pos select 1,2.12];
};
//COP Kavala Heliport
if (life_garage_sp == "cop_air_1") then {
_pos = [_pos select 0,_pos select 1,3.96];
};
//COP Kavala Garage
if (life_garage_sp == "cop_car_1") then {
_pos = [_pos select 0,_pos select 1,3];
};
[[_vid,_pid,_pos,_unit,_price,markerDir life_garage_sp,_texture,_type],"TON_fnc_spawnVehicle",false,false] spawn life_fnc_MP;
};
};
hint localize "STR_Garage_SpawningVeh";
life_atm5cash = life_atm5cash - _price;
Alles anzeigen
Kann mir einer verraten wie ich an den _type komme?
Danke,
moeck