Moin Moin,
Ich würde gerne machen das man in jedes Auto und Flugzeug auch mit der Windows-Taste einsteigen kann.
Hat da vielleicht jemand ein Script für mich ?
Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.
Moin Moin,
Ich würde gerne machen das man in jedes Auto und Flugzeug auch mit der Windows-Taste einsteigen kann.
Hat da vielleicht jemand ein Script für mich ?
Moin,
ich gehe mal davon aus Du möchtest das dann auch über das VehicleInteractionMenu realisieren oder sehe ich das falsch?
Gruß,
moeck
Richtig fn_vInteractionMenu
Ein Script parat hab ich nicht. Aber man kann sich eins schnell basteln
Gebraucht werden dazu diese Funktionen:
Um eine Freie Position zu finden:
Und um die Person dort hinzusetzten:
So dann hier mal der Kram, keine Ahnung ob es geht aber testen schadet nicht
#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 Btn7 37456
#define Btn8 37458
#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;
_Btn7 = _display displayCtrl Btn7;
_Btn8 = _display displayCtrl Btn8;
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;};
};
};
_Btn7 ctrlSetText localize "STR_vInAct_GetInVehicleDriver";
_Btn7 buttonSetAction "player action [""getInDriver"", life_vInact_curTarget]; closeDialog 0;";
_Btn8 ctrlSetText localize "STR_vInAct_GetInVehiclePassanger";
_Btn8 buttonSetAction "player action [""getInCargo"", life_vInact_curTarget]; closeDialog 0;";
} 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 ctrlSetText localize "STR_vInAct_GetInVehicleDriver";
_Btn4 buttonSetAction "player action [""getInDriver"", life_vInact_curTarget]; closeDialog 0;";
_Btn5 ctrlSetText localize "STR_vInAct_GetInVehiclePassanger";
_Btn5 buttonSetAction "player action [""getInCargo"", life_vInact_curTarget]; closeDialog 0;";
if (locked(_curTarget) isEqualTo 0 ) then {
_Btn4 ctrlEnable true;
_Btn5 ctrlEnable true;
} else {
_Btn4 ctrlEnable false;
_Btn5 ctrlEnable false;
};
_Btn6 ctrlShow false;
_Btn7 ctrlShow false;
_Btn8 ctrlShow false;
};
Alles anzeigen
so und dann hier mal noch die Änderung im Dialog
#define BGX 0.35
#define BGY 0.2
#define BGW 0.46
class pInteraction_Menu {
idd = 37400;
movingEnable = 0;
enableSimulation = 1;
class controlsBackground {
class RscTitleBackground: life_RscText {
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
idc = -1;
x = BGX;
y = BGY;
w = BGW;
h = (1 / 25);
};
class MainBackground: life_RscText {
idc = -1;
colorBackground[] = {0,0,0,0.7};
x = BGX;
y = BGY + (11 / 250);
w = BGW;
h = 0.6 - (22 / 250) + 0.05;
};
class Title: life_RscTitle {
colorBackground[] = {0,0,0,0};
idc = 37401;
text = "$STR_pInAct_Title";
x = BGX;
y = BGY;
w = BGW;
h = (1 / 25);
};
};
class controls {
class ButtonClose: Life_RscButtonMenu {
idc = -1;
//shortcuts[] = {0x00050000 + 2};
text = "$STR_Global_Close";
onButtonClick = "closeDialog 0;";
x = BGX;
y = 0.8 - (1 / 25) + 0.05;
w = (6.25 / 40);
h = (1 / 25);
};
class ButtonOne: Life_RscButtonMenu {
idc = 37450;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.07;
w = 0.4;
h = 0.038;
};
class ButtonTwo: Life_RscButtonMenu {
idc = 37451;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.12;
w = 0.4;
h = 0.038;
};
class ButtonThree: Life_RscButtonMenu {
idc = 37452;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.17;
w = 0.4;
h = 0.038;
};
class ButtonFour: Life_RscButtonMenu {
idc = 37453;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.22;
w = 0.4;
h = 0.038;
};
class ButtonFive: Life_RscButtonMenu {
idc = 37454;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.27;
w = 0.4;
h = 0.038;
};
class ButtonSix: Life_RscButtonMenu {
idc = 37455;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.32;
w = 0.4;
h = 0.038;
};
class ButtonSeven: Life_RscButtonMenu {
idc = 37456;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.37;
w = 0.4;
h = 0.038;
};
class ButtonEight: Life_RscButtonMenu {
idc = 37457;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.42;
w = 0.4;
h = 0.038;
};
};
};
class vInteraction_Menu {
idd = 37400;
movingEnable = 0;
enableSimulation = 1;
class controlsBackground {
class RscTitleBackground: life_RscText {
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
idc = -1;
x = BGX;
y = BGY;
w = BGW;
h = (1 / 25);
};
class MainBackground: life_RscText {
idc = -1;
colorBackground[] = {0,0,0,0.7};
x = BGX;
y = BGY + (11 / 250);
w = BGW;
h = 0.6 - (22 / 250);
};
class Title: life_RscTitle {
colorBackground[] = {0,0,0,0};
idc = 37401;
text = "$STR_vInAct_Title";
x = BGX;
y = BGY;
w = BGW;
h = (1 / 25);
};
};
class controls {
class ButtonClose: Life_RscButtonMenu {
idc = -1;
//shortcuts[] = {0x00050000 + 2};
text = "$STR_Global_Close";
onButtonClick = "closeDialog 0;";
x = BGX;
y = 0.8 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
class ButtonOne: Life_RscButtonMenu {
idc = 37450;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.07;
w = 0.4;
h = 0.038;
};
class ButtonTwo: Life_RscButtonMenu {
idc = 37451;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.12;
w = 0.4;
h = 0.038;
};
class ButtonThree: Life_RscButtonMenu {
idc = 37452;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.17;
w = 0.4;
h = 0.038;
};
class ButtonFour: Life_RscButtonMenu {
idc = 37453;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.22;
w = 0.4;
h = 0.038;
};
class ButtonFive: Life_RscButtonMenu {
idc = 37454;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.27;
w = 0.4;
h = 0.038;
};
class ButtonSix: Life_RscButtonMenu {
idc = 37455;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.32;
w = 0.4;
h = 0.038;
};
class ButtonSeven: Life_RscButtonMenu {
idc = 37456;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.37;
w = 0.4;
h = 0.038;
};
class ButtonEight: Life_RscButtonMenu {
idc = 37457;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
text = "";
sizeEx = 0.025;
x = BGX + 0.03;
y = BGY + 0.42;
w = 0.4;
h = 0.038;
};
};
};
Alles anzeigen
eventuell musste den Rahmen noch anpassen
https://github.com/AsYetUntitled/…ractionMenu.sqf
Ist im standard framework drin
Ja geht leider bei mir nicht. Ich versuche mal das von moeck
Danke moeck es geht.
Moin,
ich habe mir das jetzt nochmal genauer angeschaut und getestet. Bei Qilin und Prowler hat das Script leider nicht funktioniert, so dass ich mal eine Alternative implementiert habe. Erstellt die Datei fn_copmedicEnter.sqf im Ordner core\functions\ und in der Functions.hpp definieren.
Dann noch die Buttons anpassen und schon geht es auch mit dem Quilin und Prowler
/*
File: fn_copmedicEnter.sqf
Author: moeck
Description:
Allows Cops and Medics to enter locked Vehicles
*/
if !(playerSide in [west,independent]) exitWith {};
private _position = _this select 0;
switch (_position) do {
case "driver": {
cursorTarget lock false;
player action ["getInDriver", cursorTarget];
cursorTarget lock true;
};
case "passenger": {
private _freeposition = 0;
{
if (cursorTarget isKindOf "Ship" || cursorTarget isKindOf "landVehicle" || cursorTarget isKindOf "Air") then {
_freeposition = cursorTarget emptyPositions _x;
if (_freeposition > 0) exitWith {
cursorTarget lock false;
if (_x isEqualTo "Commander") exitWith {player moveInCommander cursorTarget;};
if (_x isEqualTo "Gunner") exitWith {player moveInGunner cursorTarget;};
if (_x isEqualTo "Cargo") exitWith {player moveInCargo cursorTarget;};
cursorTarget lock true;
};
};
} foreach ["Commander", "Gunner", "Cargo"];
};
case "exit": {
_veh = vehicle player;
_veh lock false;
moveOut player;
_veh lock true;
};
};
Alles anzeigen
_Btn7 ctrlSetText localize "STR_vInAct_GetInVehicleDriver";
_Btn7 buttonSetAction "[""driver""] call life_fnc_copmedicEnter; closeDialog 0;";
_Btn8 ctrlSetText localize "STR_vInAct_GetInVehiclePassanger";
_Btn8 buttonSetAction "[""passenger""] call life_fnc_copmedicEnter;; closeDialog 0;";
und fertig .
Habe das mit Qilin, Prowler, Strider und ... getestet.
Gruß,
moeck
moeck funktioniert nur wenn du das dlc nicht hast über windows
Habe das gestern mit dem addActions probiert und da geht es auch wenn du die DLCs hast