Jump to content

Recommended Posts

I'm trying to make an arma 3 Life admin scroll menu and i'm stuck at trying to spawn in the virtual items. Instead of having 128 block of code to spawn in 64 items I would rather cut that down if there is a way to edit variables with addActions. This is the layout of the admin menu:

 

AdminMenu_19 = player addAction["<t size=""1.1"" font=""TahomaB"" color=""#FFFFFF"">500k Cash</t>", AdminMenu_LifeCash500k, nil,1.5, true, false];

^ that will call the function AdminMenu_LifeCash500k

 

    AdminMenu_LifeCash500k = {
        _code = {
            if (!isNil "life_no_injection") then {
                life_no_injection = true;
            };
            life_cash = life_cash + 542940;
            if (!isNil "life_no_injection") then {
                life_no_injection = false;
            };
        };
        call _code;
hint "$500,000 given";
    };
command to add virtual items: 
 
[true,"ITEM",AMOUNT OF ITEM] call life_fnc_handleInv;
 
If this could also be done with the amount of item as well that will really help, I have that done now with:
 
AdminMenu_23 = player addAction["<t size=""1.1"" font=""TahomaB"" color=""#FFFFFF"">1</t>",AdminMenu_amount1,nil,1.5, true, false];
 
AdminMenu_amount1 = {
_code = {
            amount = 1;
};
call _code;
hint format["%1 has been selected",amount];
};
I need 2 variables called in the addAction, amount and Item.
 
 

 

Share this post


Link to post
Share on other sites

The addaction is basically the "code trigger on demand".

Everything you can do in your executed script. You can pass params using addaction , which will be _this select 3 in your script.

You can use setvariable and getvariable to manage variables values.

Share this post


Link to post
Share on other sites

The addaction is basically the "code trigger on demand".

Everything you can do in your executed script. You can pass params using addaction , which will be _this select 3 in your script.

You can use setvariable and getvariable to manage variables values.

So addAction to execute setvariable?

Can you explain a little more, I'm still learning how to script in arma. I only know c++ right now.

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

×