Jump to content

Recommended Posts

Hello, I have a problem with which I have been agonizing for a long time, but nothing works, please help.
 

_unit = cursorTarget;
Deistvie = true;
civHintShown = false;

while {Deistvie} do {
    if (_unit isKindOf "CAManBase" && side _unit == civilian) then {
        civHintShown = true;
    } else {
        civHintShown = false;
    };

    if (civHintShown) then {
        Type_cvest = [1,2,3] call BIS_fnc_selectRandom;
        if (Type_cvest == 1) then {
            Deistvie = false;
            hint "Гражданин";
            _unit addAction ["Приказать остановиться", {
                _unit = _this select 0;
                cutText ["<t color='#00bfff' size='1.4'>Клон: </t> <t size='1.4'>Гражданин, остановитесь!</t>", "PLAIN DOWN", -1, true, true];
                _unit disableAI "PATH";
                removeAllActions _unit;
                _unit addAction ["Приказать сдаться!", {
                    _unit = _this select 0;
                    [_unit, true] call ACE_captives_fnc_setSurrendered;
                    removeAllActions _unit;
                    Deistvie = true;
                }, nil, 1.5, true, false, "", "", 3];
            }, nil, 1.5, true, false, "", "", 20];
        } else {
            if (Type_cvest == 2) then {
                hint "Мб гражданин";
                Deistvie = true;
            } else {
                if (Type_cvest == 3) then {
                    hint "Не гражданин";
                    Deistvie = true;
                };
            };
        };
    } else {
        hint "Гражданина нет";
        removeAllActions _unit;
        Deistvie = true;
    };
    sleep 0.1;
};

My idea was that the loop should make a constant check for a civilian slot and when it finds it activates the main script with different actions, the problem is that the actions are activated, but after the end of the one with action it does not start again, I assumed that this is because of the fact that Deistvie = true is written in the action, but I do not know how to make it so that only after the activation of the action activate and Deistvie.

Share this post


Link to post
Share on other sites

hay there,
please explain further what you are trying to achieve.

Are you trying to consistently check if a civilian is in front of you?

And if you've found one, then there should be a 33% probability of creating a 'stay in place' action for them?

And once you've activated the 'stay in place' action, another 'surrender' action should be created for that civilian?

And if you've activated the 'surrender' action, should they surrender through ACE?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×