natürlich ich bin informatiker bei einem deutschen automobilhersteller
Beiträge von moeck
-
-
Moin,
da ich mich ja nun ein wenig aktiver an diversen Diskussionen beteilige, wollte ich mal die Gelegenheit nutzen mich kurz vorzustellen. Zu meiner Person ich gehöre schon zum älteren Semester. Zur Zeit bin ich auf Grund meiner beruflichen Aktivitäten im Ausland unterwegs.
Ansonsten habe ich vor ca. 4 Wochen angefangen die LoP Community bei der Weiterentwicklung des Altis Life Servers zu unterstützen. Ich hatte vorher keinerlei Erfahrung mit dem Scripten für Arma 3. Mittlerweile habe ich mich schon so halbwegs durch die Scripte durchgearbeitet und einige Sachen geändert. Ich fange gerade damit an ein wenig den Kram zu optimieren. Bei Fragen gern per PN melden.
Tschau,
moeck -
so ich habe jetzt schon mal angefangen das script zu vereinfachen. Leider habe ich es nicht mehr geschafft die vielen if Anweisungen im civ/med Bereich auseinander zu ziehen. Dies würde ich im laufe der nächsten woche machen sofern interesse besteht.
Code
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_vInteractionMenu.sqf Author: Bryan "Tonic" Boardwine Description: Replaces the mass add actions for various vehicle actions. */ #define Btn1 37450 #define Btn2 37451 #define Btn3 37452 #define Btn4 37453 #define Btn5 37454 #define Btn6 37455 #define Title 37401 private ["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_id"]; if (!dialog) then { createDialog "vInteraction_Menu"; }; disableSerialization; _curTarget = param [0,objNull,[objNull]]; if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target _isVehicle = if ((_curTarget isKindOf "landVehicle") || (_curTarget isKindOf "Ship") || (_curTarget isKindOf "Air")) then {true} else {false}; if (!_isVehicle) exitWith {closeDialog 0;}; _display = findDisplay 37400; _Btn1 = _display displayCtrl Btn1; _Btn2 = _display displayCtrl Btn2; _Btn3 = _display displayCtrl Btn3; _Btn4 = _display displayCtrl Btn4; _Btn5 = _display displayCtrl Btn5; _Btn6 = _display displayCtrl Btn6; life_vInact_curTarget = _curTarget; _id = getObjectDLC _curTarget; //Grundeinstellung der Buttons _Btn1 ctrlShow true; //_Btn1 soll immer angezeigt werden _Btn2 ctrlShow false; _Btn3 ctrlShow false; _Btn4 ctrlShow false; _Btn5 ctrlShow false; _Btn6 ctrlShow false; //Alle Buttons deaktiviert _Btn1 ctrlEnable false; _Btn2 ctrlEnable false; _Btn3 ctrlEnable false; _Btn4 ctrlEnable false; _Btn5 ctrlEnable false; _Btn6 ctrlEnable false; //Set Repair Action _Btn1 ctrlSetText localize "STR_vInAct_Repair"; _Btn1 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_repairTruck; closeDialog 0;"; if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn1 ctrlEnable true;} else {_Btn1 ctrlEnable false;}; if (playerSide isEqualTo west) then { _Btn2 ctrlShow true; _Btn3 ctrlShow true; _Btn4 ctrlShow true; _Btn5 ctrlShow true; _Btn6 ctrlShow true; //Registration Button2 _Btn2 ctrlSetText localize "STR_vInAct_Registration"; _Btn2 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_searchVehAction; closeDialog 0;"; _Btn2 ctrlEnable true; //Vehicle Search Button3 _Btn3 ctrlSetText localize "STR_vInAct_SearchVehicle"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_vehInvSearch; closeDialog 0;"; _Btn3 ctrlEnable true; //Pullout Button4 _Btn4 ctrlSetText localize "STR_vInAct_PullOut"; _Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction; closeDialog 0;"; if !(crew _curTarget isEqualTo []) then {_Btn4 ctrlEnable true;}; //Impound Button5 _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; _Btn3 ctrlEnable true; if (_curTarget isKindOf "Ship") then { _Btn6 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn6 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (_curTarget isKindOf "Ship" && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn6 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn6 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; }; } else { _Btn6 ctrlSetText localize "STR_vInAct_Unflip"; _Btn6 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;}; }; }; }; if ((playerSide isEqualTo civilian)|| (playerSide isEqualTo independent)) then { _Btn2 ctrlShow true; _Btn3 ctrlShow true; _Btn4 ctrlShow true; if (_curTarget isKindOf "Ship") then { _Btn2 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn2 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (alive _curTarget && {_curTarget isKindOf "Ship"} && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn2 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn2 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; }; } else { _Btn2 ctrlSetText localize "STR_vInAct_Unflip"; _Btn2 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn2 ctrlEnable false;} else {_Btn2 ctrlEnable true;}; }; }; if (typeOf _curTarget == "O_Truck_03_device_F") then { _Btn3 ctrlSetText localize "STR_vInAct_DeviceMine"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_deviceMine"; if (!isNil {(_curTarget getVariable "mining")} || !local _curTarget && {_curTarget in life_vehicles}) then { _Btn3 ctrlEnable false; } else { _Btn3 ctrlEnable true; }; } else { _Btn3 ctrlShow false; if (typeOf (_curTarget) in ["C_Van_01_fuel_F","I_Truck_02_fuel_F","B_Truck_01_fuel_F"] && _curTarget in life_vehicles) then { if (!isNil {_curTarget getVariable "fuelTankWork"}) then { _Btn3 ctrlSetText localize "STR_FuelTank_Stop"; _Btn3 buttonSetAction "life_vInact_curTarget setVariable [""fuelTankWork"",nil,true]; closeDialog 0;"; _Btn3 ctrlShow true; } else { if (count (nearestObjects [_curTarget, ["Land_FuelStation_Feed_F","Land_fs_feed_F"], 15]) > 0) then { _Btn3 ctrlSetText localize "STR_FuelTank_Supply"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelSupply"; _Btn3 ctrlShow true; }else{ { if (player distance (getMarkerPos _x) < 20) exitWith { _Btn3 ctrlSetText localize "STR_FuelTank_Store"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelStore"; _Btn3 ctrlShow true; }; } forEach ["fuel_storage_1","fuel_storage_2"]; }; }; }; }; _Btn4 ctrlShow false; if (playerSide isEqualTo independent) then { _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; _Btn5 ctrlShow true; } else {_Btn5 ctrlShow false}; _Btn6 ctrlShow false; };
Ich würde vorschlagen man vereinfacht mal das komplette Script und stellt dieses dann zu verfügung.
In diesem Sinne schönes WE
Gruß,
moeck -
so versucht es mal so
Code
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_vInteractionMenu.sqf Author: Bryan "Tonic" Boardwine Description: Replaces the mass add actions for various vehicle actions. */ #define Btn1 37450 #define Btn2 37451 #define Btn3 37452 #define Btn4 37453 #define Btn5 37454 #define Btn6 37455 #define Title 37401 private ["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_id"]; if (!dialog) then { createDialog "vInteraction_Menu"; }; disableSerialization; _curTarget = param [0,objNull,[objNull]]; if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target _isVehicle = if ((_curTarget isKindOf "landVehicle") || (_curTarget isKindOf "Ship") || (_curTarget isKindOf "Air")) then {true} else {false}; if (!_isVehicle) exitWith {closeDialog 0;}; _display = findDisplay 37400; _Btn1 = _display displayCtrl Btn1; _Btn2 = _display displayCtrl Btn2; _Btn3 = _display displayCtrl Btn3; _Btn4 = _display displayCtrl Btn4; _Btn5 = _display displayCtrl Btn5; _Btn6 = _display displayCtrl Btn6; life_vInact_curTarget = _curTarget; _id = getObjectDLC _curTarget; //Set Repair Action _Btn1 ctrlSetText localize "STR_vInAct_Repair"; _Btn1 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_repairTruck; closeDialog 0;"; if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn1 ctrlEnable true;} else {_Btn1 ctrlEnable false;}; if (playerSide isEqualTo west) then { _Btn2 ctrlSetText localize "STR_vInAct_Registration"; _Btn2 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_searchVehAction; closeDialog 0;"; _Btn3 ctrlSetText localize "STR_vInAct_SearchVehicle"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_vehInvSearch; closeDialog 0;"; _Btn4 ctrlSetText localize "STR_vInAct_PullOut"; _Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction; closeDialog 0;"; if (crew _curTarget isEqualTo []) then {_Btn4 ctrlEnable false;}; _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; if (_curTarget isKindOf "Ship") then { _Btn6 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn6 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (_curTarget isKindOf "Ship" && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn6 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn6 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; }; } else { _Btn6 ctrlSetText localize "STR_vInAct_Unflip"; _Btn6 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;}; }; }; } else { if (_curTarget isKindOf "Ship") then { _Btn2 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn2 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (alive _curTarget && {_curTarget isKindOf "Ship"} && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn2 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn2 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; }; } else { _Btn2 ctrlSetText localize "STR_vInAct_Unflip"; _Btn2 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn2 ctrlEnable false;} else {_Btn2 ctrlEnable true;}; }; }; if (typeOf _curTarget == "O_Truck_03_device_F") then { _Btn3 ctrlSetText localize "STR_vInAct_DeviceMine"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_deviceMine"; if (!isNil {(_curTarget getVariable "mining")} || !local _curTarget && {_curTarget in life_vehicles}) then { _Btn3 ctrlEnable false; } else { _Btn3 ctrlEnable true; }; } else { _Btn3 ctrlShow false; if (typeOf (_curTarget) in ["C_Van_01_fuel_F","I_Truck_02_fuel_F","B_Truck_01_fuel_F"] && _curTarget in life_vehicles) then { if (!isNil {_curTarget getVariable "fuelTankWork"}) then { _Btn3 ctrlSetText localize "STR_FuelTank_Stop"; _Btn3 buttonSetAction "life_vInact_curTarget setVariable [""fuelTankWork"",nil,true]; closeDialog 0;"; _Btn3 ctrlShow true; } else { if (count (nearestObjects [_curTarget, ["Land_FuelStation_Feed_F","Land_fs_feed_F"], 15]) > 0) then { _Btn3 ctrlSetText localize "STR_FuelTank_Supply"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelSupply"; _Btn3 ctrlShow true; }else{ { if (player distance (getMarkerPos _x) < 20) exitWith { _Btn3 ctrlSetText localize "STR_FuelTank_Store"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelStore"; _Btn3 ctrlShow true; }; } forEach ["fuel_storage_1","fuel_storage_2"]; }; }; }; }; _Btn4 ctrlShow false; if (playerSide isEqualTo independent) then { _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; _Btn5 ctrlShow true; } else {_Btn5 ctrlShow false}; _Btn6 ctrlShow false; };
-
Hiho,
Thema ist gelöst. Die Gruppenmitglieder werden auch automatisch der Variable life_known_Players beim öffnen des Menüs hinzugefügt.
Danke,
moeck -
alles klar, bin heute abend dann wieder online
-
%localappdata%\Arma3\*.rpt im Zweifelsfall koppiere eine aus meinem letzten post den code ;-). Ich kann es momentan nicht testen, da ich keinen Zugriff auf einen Server habe und das hier als trockenübung mache
-
hast du Dir mal dein Client log angeschaut ob dort ein Fehler kommt? Und ja da ist auch noch ein kleiner Fehler drin. da fehlt ein ;. Vergleiche mal Zeile 46 hier und oben
Code
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_vInteractionMenu.sqf Author: Bryan "Tonic" Boardwine Description: Replaces the mass add actions for various vehicle actions. */ #define Btn1 37450 #define Btn2 37451 #define Btn3 37452 #define Btn4 37453 #define Btn5 37454 #define Btn6 37455 #define Title 37401 private ["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_id"]; if (!dialog) then { createDialog "vInteraction_Menu"; }; disableSerialization; _curTarget = param [0,objNull,[objNull]]; if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target _isVehicle = if ((_curTarget isKindOf "landVehicle") || (_curTarget isKindOf "Ship") || (_curTarget isKindOf "Air")) then {true} else {false}; if (!_isVehicle) exitWith {closeDialog 0;}; _display = findDisplay 37400; _Btn1 = _display displayCtrl Btn1; _Btn2 = _display displayCtrl Btn2; _Btn3 = _display displayCtrl Btn3; _Btn4 = _display displayCtrl Btn4; _Btn5 = _display displayCtrl Btn5; _Btn6 = _display displayCtrl Btn6; life_vInact_curTarget = _curTarget; _id = getObjectDLC _curTarget; //Set Repair Action _Btn1 ctrlSetText localize "STR_vInAct_Repair"; _Btn1 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_repairTruck; closeDialog 0;"; if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn1 ctrlEnable true;} else {_Btn1 ctrlEnable false;}; if (playerSide isEqualTo independent) then { _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; }; if (playerSide isEqualTo west) then { _Btn2 ctrlSetText localize "STR_vInAct_Registration"; _Btn2 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_searchVehAction; closeDialog 0;"; _Btn3 ctrlSetText localize "STR_vInAct_SearchVehicle"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_vehInvSearch; closeDialog 0;"; _Btn4 ctrlSetText localize "STR_vInAct_PullOut"; _Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction; closeDialog 0;"; if (crew _curTarget isEqualTo []) then {_Btn4 ctrlEnable false;}; _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; if (_curTarget isKindOf "Ship") then { _Btn6 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn6 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (_curTarget isKindOf "Ship" && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn6 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn6 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; }; } else { _Btn6 ctrlSetText localize "STR_vInAct_Unflip"; _Btn6 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;}; }; }; } else { if (_curTarget isKindOf "Ship") then { _Btn2 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn2 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (alive _curTarget && {_curTarget isKindOf "Ship"} && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn2 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn2 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; }; } else { _Btn2 ctrlSetText localize "STR_vInAct_Unflip"; _Btn2 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn2 ctrlEnable false;} else {_Btn2 ctrlEnable true;}; }; }; if (typeOf _curTarget == "O_Truck_03_device_F") then { _Btn3 ctrlSetText localize "STR_vInAct_DeviceMine"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_deviceMine"; if (!isNil {(_curTarget getVariable "mining")} || !local _curTarget && {_curTarget in life_vehicles}) then { _Btn3 ctrlEnable false; } else { _Btn3 ctrlEnable true; }; } else { _Btn3 ctrlShow false; if (typeOf (_curTarget) in ["C_Van_01_fuel_F","I_Truck_02_fuel_F","B_Truck_01_fuel_F"] && _curTarget in life_vehicles) then { if (!isNil {_curTarget getVariable "fuelTankWork"}) then { _Btn3 ctrlSetText localize "STR_FuelTank_Stop"; _Btn3 buttonSetAction "life_vInact_curTarget setVariable [""fuelTankWork"",nil,true]; closeDialog 0;"; _Btn3 ctrlShow true; } else { if (count (nearestObjects [_curTarget, ["Land_FuelStation_Feed_F","Land_fs_feed_F"], 15]) > 0) then { _Btn3 ctrlSetText localize "STR_FuelTank_Supply"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelSupply"; _Btn3 ctrlShow true; }else{ { if (player distance (getMarkerPos _x) < 20) exitWith { _Btn3 ctrlSetText localize "STR_FuelTank_Store"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelStore"; _Btn3 ctrlShow true; }; } forEach ["fuel_storage_1","fuel_storage_2"]; }; }; }; }; _Btn4 ctrlShow false; if (playerSide isEqualTo independent) then {_Btn5 ctrlShow true;} else {_Btn5 ctrlShow false;}; _Btn6 ctrlShow false; };
-
ja sorry du musst ganz unten
mit folgendem ersetzen
Codeif (playerSide isEqualTo independent) then {_Btn5 ctrlShow true;} else {_Btn5 ctrlShow false;};
anschliessend sollte das so aussehen
Code
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_vInteractionMenu.sqf Author: Bryan "Tonic" Boardwine Description: Replaces the mass add actions for various vehicle actions. */ #define Btn1 37450 #define Btn2 37451 #define Btn3 37452 #define Btn4 37453 #define Btn5 37454 #define Btn6 37455 #define Title 37401 private ["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_id"]; if (!dialog) then { createDialog "vInteraction_Menu"; }; disableSerialization; _curTarget = param [0,objNull,[objNull]]; if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target _isVehicle = if ((_curTarget isKindOf "landVehicle") || (_curTarget isKindOf "Ship") || (_curTarget isKindOf "Air")) then {true} else {false}; if (!_isVehicle) exitWith {closeDialog 0;}; _display = findDisplay 37400; _Btn1 = _display displayCtrl Btn1; _Btn2 = _display displayCtrl Btn2; _Btn3 = _display displayCtrl Btn3; _Btn4 = _display displayCtrl Btn4; _Btn5 = _display displayCtrl Btn5; _Btn6 = _display displayCtrl Btn6; life_vInact_curTarget = _curTarget; _id = getObjectDLC _curTarget; //Set Repair Action _Btn1 ctrlSetText localize "STR_vInAct_Repair"; _Btn1 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_repairTruck; closeDialog 0;"; if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn1 ctrlEnable true;} else {_Btn1 ctrlEnable false;}; if (playerSide isEqualTo independent) then { _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; } if (playerSide isEqualTo west) then { _Btn2 ctrlSetText localize "STR_vInAct_Registration"; _Btn2 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_searchVehAction; closeDialog 0;"; _Btn3 ctrlSetText localize "STR_vInAct_SearchVehicle"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_vehInvSearch; closeDialog 0;"; _Btn4 ctrlSetText localize "STR_vInAct_PullOut"; _Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction; closeDialog 0;"; if (crew _curTarget isEqualTo []) then {_Btn4 ctrlEnable false;}; _Btn5 ctrlSetText localize "STR_vInAct_Impound"; _Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction; closeDialog 0;"; if (_curTarget isKindOf "Ship") then { _Btn6 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn6 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (_curTarget isKindOf "Ship" && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn6 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn6 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false}; }; } else { _Btn6 ctrlSetText localize "STR_vInAct_Unflip"; _Btn6 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;}; }; }; } else { if (_curTarget isKindOf "Ship") then { _Btn2 ctrlSetText localize "STR_vInAct_PushBoat"; _Btn2 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;"; if (alive _curTarget && {_curTarget isKindOf "Ship"} && {local _curTarget} && {crew _curTarget isEqualTo []}) then { _Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; } else { if (!isNil "_id") then { if !(_id in getDLCs 1) then { _Btn2 ctrlSetText localize "STR_vInAct_GetInVehicle"; _Btn2 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;"; if (crew _curTarget isEqualTo [] && {canMove _curTarget} && {locked _curTarget isEqualTo 0}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false}; }; } else { _Btn2 ctrlSetText localize "STR_vInAct_Unflip"; _Btn2 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;"; if (alive _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then { _Btn2 ctrlEnable false;} else {_Btn2 ctrlEnable true;}; }; }; if (typeOf _curTarget == "O_Truck_03_device_F") then { _Btn3 ctrlSetText localize "STR_vInAct_DeviceMine"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_deviceMine"; if (!isNil {(_curTarget getVariable "mining")} || !local _curTarget && {_curTarget in life_vehicles}) then { _Btn3 ctrlEnable false; } else { _Btn3 ctrlEnable true; }; } else { _Btn3 ctrlShow false; if (typeOf (_curTarget) in ["C_Van_01_fuel_F","I_Truck_02_fuel_F","B_Truck_01_fuel_F"] && _curTarget in life_vehicles) then { if (!isNil {_curTarget getVariable "fuelTankWork"}) then { _Btn3 ctrlSetText localize "STR_FuelTank_Stop"; _Btn3 buttonSetAction "life_vInact_curTarget setVariable [""fuelTankWork"",nil,true]; closeDialog 0;"; _Btn3 ctrlShow true; } else { if (count (nearestObjects [_curTarget, ["Land_FuelStation_Feed_F","Land_fs_feed_F"], 15]) > 0) then { _Btn3 ctrlSetText localize "STR_FuelTank_Supply"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelSupply"; _Btn3 ctrlShow true; }else{ { if (player distance (getMarkerPos _x) < 20) exitWith { _Btn3 ctrlSetText localize "STR_FuelTank_Store"; _Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_fuelStore"; _Btn3 ctrlShow true; }; } forEach ["fuel_storage_1","fuel_storage_2"]; }; }; }; }; _Btn4 ctrlShow false; if (playerSide isEqualTo independent) then {_Btn5 ctrlShow true;} else {_Btn5 ctrlShow false;}; _Btn6 ctrlShow false; };
Gruß,
moeck -
Moin,
ja ich war hier leicht auf dem falschem Dampfer unterwegs. Ich habe die Variable im "falschen" Client gesetzt gefüllt. Irgendwie hatte ich da einen Knoten im Hirn. Ich habe den eigenen Player Namen bei dem Spieler gespeichert. Das kann nicht funktionieren ;-). Danke für den Denkanstoss ich werde das mal testen und melde mich dann wieder.
Also hier mal meine angestrebte Lösung nur leider kann ich es momentan noch nicht testen, da ich aktuell keinen Zugriff auf den Server habe.
und auf der Gegenseite habe ich die Lizenzsehen um folgenden Eintrag erweitertCodeprivate["_msg","_unit"]; _unit = _this select 0; life_known_player pushBack _unit; _msg = _this select 1; hintSilent parseText _msg;
und zu guter Letzt wie vorgeschlagen in die pupdatemenu
_nearUnits = [];
{
if (player distance _x < 10) && {_x in life_knownPlayers}) then {
_nearUnits pushBack _x;
};
} forEach playableUnits;eingefügt. Leider kann ich es erst heute abend testen, allerdings bin ich zuversichtlich, dass es funktioniert.
Gruß,
moeck -
Moin,
ich stehe gerade etwas auf dem Schlauch was das Prüfen eines Arrays auf einen bestimmten Wert angeht. Zum Hintergrund ich versuche momentan das Player Menü davon zu überzeugen, dass nur Spieler angezeigt werden, die a) in der Nähe sind und b) mir bereits den Ausweis gezeigt haben.Dazu habe ich mir ein Array "life_known_Player" angelegt und fülle diese wie folgt.
In der fn_p_updateMenu.sqf versuche ich nun zu prüfen ob der Spieler mir den Ausweis bereits gezeigt hat.
Code: fn_p_updateMenu.sqf{ _name = name _x; if((player distance _x < 10) && (_name in life_known_Player)) then { _near_units pushBack _x}; } foreach playableUnits;
Leider hat das bisher nicht geklappt.
Gruß,
moeck -
-
Moin,
ist der Button schon verfügbar? Hast Du die Funktion schon hinterlegt?
Ein paar mehr Infos wären klasse.
Gruß,
moeck -
case "C_Van_01_box_F": { _attach = [[-0.75, 0.2, 1.55], [0.67, 0.2, 1.55]]; };
kannst du so einfügen