Jump to content
artur_op

Unflip DLC vehicles - Problem

Recommended Posts

I'm having trouble untapping DLC vehicles.

As you can see the original script offers the option of getting into the DLC vehicle even without having it. But with that you do not intend to untap the overturned vehicle.

Do I need to create a new button in the interaction menu or can I do it with only one condition? Coiled vehicle, for example.

 

"...

#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;";

    _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;};
        };
    };

};

..."

 

Any help to solve this?

Share this post


Link to post
Share on other sites
51 minutes ago, artur_op said:

Any help to solve this?

You can remove the DLC check portion and just make the unflip the only option in the else of the Ship checking If. Otherwise, you could make a new button and put the unflip for dlc vehicles there.

Share this post


Link to post
Share on other sites
On 02/01/2019 at 16:29, imthatguyhere said:

Você pode remover a parte da verificação do DLC e apenas fazer a unflip a única opção no outro da verificação do navio se. Caso contrário, você poderia fazer um novo botão e colocar o unflip para veículos dlc lá.

Thanks for the feedback.

I need to keep checking for DLC for players who have not purchased the DLC to enter the vehicles.

To create a new button I just need to add below the others and specify the conditions?

Example:
"
#define Btn6 37455
          >>>    #define Btn7 37456    <<<
#define Heading 37401
private ["_display", "_ curTarget", "_ Btn1", "_ Btn2", "_Btn3", "_Btn4", "_Btn5", "_Btn6",    >>>    "_Btn7"  <<<      , "_ id"];
"
.....

"
_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;   <<<
life_vInact_curTarget = _curTarget;
_id = getObjectDLC _curTarget;
"

>>>>"_Btn7 ctrlSetText locate" STR_vInAct_Unflip ";
            _Btn7 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 (live _curTarget && {crew _curTarget isEqualTo []} && {canMove _curTarget}) then {_Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;};
        };  <<<<<
"

It is?

Share this post


Link to post
Share on other sites
13 hours ago, artur_op said:

Thanks for the feedback.

I need to keep checking for DLC for players who have not purchased the DLC to enter the vehicles.

To create a new button I just need to add below the others and specify the conditions?

You would add the button to the hpp: https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/dialog/pInteraction.hpp#L142

You need to set the location and whatnot as well.

Then you would edit that file with the define for the new IDC, display the button like the others, and then copy the buttonSetAction you want for that button.

Share this post


Link to post
Share on other sites
11 minutes ago, imthatguyhere said:

Você adicionaria o botão ao hpp:  https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/dialog/pInteraction.hpp#L142

Você precisa definir a localização e outras coisas também.

Em seguida, você editaria esse arquivo com o define para o novo IDC, exibiria o botão como os outros e depois copiaria o buttonSetAction desejado para esse botão.

I'll try, thanks for the help.

Share this post


Link to post
Share on other sites
On 04/01/2019 at 13:21, imthatguyhere said:

Você adicionaria o botão ao hpp:  https://github.com/AsYetUntitled/Framework/blob/master/Altis_Life.Altis/dialog/pInteraction.hpp#L142

Você precisa definir a localização e outras coisas também.

Em seguida, você editaria esse arquivo com o define para o novo IDC, exibiria o botão como os outros e depois copiaria o buttonSetAction desejado para esse botão.

I was able to solve it, just create a new button. Thanks a lot for the help!!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...