Français Solved Comment planter des graines avec une touche prédéfinie en utilisant ACE?

  • Auteur de la discussion Auteur de la discussion JordanBruneau
  • Date de début Date de début
10/5/20
36
2
300
Bonjour je voudrai faire en sorte de planter les graine avec un touche prédéfini ou dans l interaction de ace
si c est possible
pour ace j ai essayé ceci
[CODE title="code ace"]class ACE_plante
{
displayName="planter";
distance=4;
condition="([] call life_fnc_p_updateMenu) && playerSide isEqualTo civilian";
statement="[_item] spawn max_plants_fnc_plantPlante";
exceptions[]=
{
"isNotSwimming"
};
showDisabled=0;
priority=2.7;
};[/CODE]

mais cela ne fonctione pas
 
Solution
Salut !

Dans ton bouton la variable _item n'est pas définie.

Si tu veux planter avec une touche, dans ton fn_keyHandler.sqf, ici j'ai mis la touche CTRL + T, il faut remplacer ce bout de code :
Code:
case 20: {
    if (!_alt && {!_ctrlKey} && {!dialog} && {!life_action_inUse} && {!(player getVariable ["playerSurrender",false])} && {!(player getVariable ["restrained",false])} && {!life_isknocked} && {!life_istazed}) then {
        if (!(isNull objectParent player) && alive vehicle player) then {
            if ((vehicle player) in life_vehicles) then {
                [vehicle player] spawn life_fnc_openInventory;
            };
        } else {
            private "_list";
            _list = ((ASLtoATL (getPosASL player))...
Salut !

Dans ton bouton la variable _item n'est pas définie.

Si tu veux planter avec une touche, dans ton fn_keyHandler.sqf, ici j'ai mis la touche CTRL + T, il faut remplacer ce bout de code :
Code:
case 20: {
    if (!_alt && {!_ctrlKey} && {!dialog} && {!life_action_inUse} && {!(player getVariable ["playerSurrender",false])} && {!(player getVariable ["restrained",false])} && {!life_isknocked} && {!life_istazed}) then {
        if (!(isNull objectParent player) && alive vehicle player) then {
            if ((vehicle player) in life_vehicles) then {
                [vehicle player] spawn life_fnc_openInventory;
            };
        } else {
            private "_list";
            _list = ((ASLtoATL (getPosASL player)) nearEntities [["Box_IND_Grenades_F","B_supplyCrate_F"], 2.5]) select 0;
            if (!(isNil "_list")) then {
                _house = nearestObject [(ASLtoATL (getPosASL _list)), "House"];
                if (_house getVariable ["locked", false]) then {
                    hint localize "STR_House_ContainerDeny";
                } else {
                    [_list] spawn life_fnc_openInventory;
                };
            } else {
                _list = ["landVehicle","Air","Ship"];
                if (KINDOF_ARRAY(cursorObject,_list) && {player distance cursorObject < 7} && {isNull objectParent player} && {alive cursorObject} && {!life_action_inUse}) then {
                    if (cursorObject in life_vehicles || {locked cursorObject isEqualTo 0}) then {
                        [cursorObject] spawn life_fnc_openInventory;
                    };
                };
            };
        };
    };
};
par celui-ci :
Code:
case 20: {
    if (_ctrlKey) then {
        for "_i" from 0 to count(missionConfigFile >> "Max_Settings_Plants" >> "Plants")-1 do {
            _curConfig = (missionConfigFile >> "Max_Settings_Plants" >> "Plants") select _i;
            _item = getText (_curConfig >> "itemNeeded");

            _valItem = missionNamespace getVariable [format["life_inv_%1",_item],0];

            if (_valItem > 0) exitWith {
                [_item] spawn max_plants_fnc_plantPlante;
            };
        };
    } else {
        if (!_alt && {!dialog} && {!life_action_inUse} && {!(player getVariable ["playerSurrender",false])} && {!(player getVariable ["restrained",false])} && {!life_isknocked} && {!life_istazed}) then {
            if (!(isNull objectParent player) && alive vehicle player) then {
                if ((vehicle player) in life_vehicles) then {
                    [vehicle player] spawn life_fnc_openInventory;
                };
            } else {
                private "_list";
                _list = ((ASLtoATL (getPosASL player)) nearEntities [["Box_IND_Grenades_F","B_supplyCrate_F"], 2.5]) select 0;
                if (!(isNil "_list")) then {
                    _house = nearestObject [(ASLtoATL (getPosASL _list)), "House"];
                    if (_house getVariable ["locked", false]) then {
                        hint localize "STR_House_ContainerDeny";
                    } else {
                        [_list] spawn life_fnc_openInventory;
                    };
                } else {
                    _list = ["landVehicle","Air","Ship"];
                    if (KINDOF_ARRAY(cursorObject,_list) && {player distance cursorObject < 7} && {isNull objectParent player} && {alive cursorObject} && {!life_action_inUse}) then {
                        if (cursorObject in life_vehicles || {locked cursorObject isEqualTo 0}) then {
                            [cursorObject] spawn life_fnc_openInventory;
                        };
                    };
                };
            };
        };
    };
};


Pour avoir la liste des numéros des touches tu peux regarder ce site : https://community.bistudio.com/wiki/DIK_KeyCodes
 
Dernière édition:
Solution