Jump to content

hard5c0p3k1ng

Member
  • Content Count

    16
  • Joined

  • Last visited

  • Medals

Posts posted by hard5c0p3k1ng


  1. _moni=_this select 0;
    _good=false;
    _max=true;
    {
        if(_x==0) or (_x==1) or (_x==2) or (_x==3) or (_x==4) or (_x==5) or (_x==6) or (_x==7) or (_x==8) or (_x==9) then
        {
        }
        else
        {
        _max=false;
        };

    }forEach _moni;

            if(_max)then
            {
                _good=true;
            }
            else
            {
                _good=false;
            };    

        if(_good)then
        {
                if (!isNil "life_no_injection") then {
                    life_no_injection = true;
                };
                life_cash = life_cash + _moni;
                if (!isNil "life_no_injection") then {
                    life_no_injection = false;
                };
            Hint format ["$%1 has been added to your inventory", (_moni)];
        }
        else
        {
            Hint format ["%1 is not valid", (_moni)];
        };
     

     

     

    Calling the code with this:

     

    //assume ctrlText 13 is valid (it is I tested it, the sqf calls the value perfectly fine

    class myClass: RscButton
    {
        idc = 1;
        action = "_nil=[ctrlText 13]ExecVM ""money.sqf""";

        text = "OK"; //--- ToDo: Localize;
        x = 0.402031 * safezoneW + safezoneX;
        y = 0.214017 * safezoneH + safezoneY;
        w = 0.04125 * safezoneW;
        h = 0.0549967 * safezoneH;
        colorBackground[] = {-1,-1,-1,0.3};
    };

     

    It has to be a simple mistake, I know c++ a form of this works (string is an array of chars) but idk if it is valid for arma 3.


  2. 6 hours ago, ACoolDuck said:

    You can use the command onMapSingleClick command to use your cursor position example : 

    
    openMap true; onMapSingleClick "'HandGrenade' createVehicle _pos; openMap false; true"; 

    this should open your map then wait for you to click then closes the map and spawns a grenade on the position.

    I have a feeling it is not possible but doing the same without using the map.


  3. I have been wanting to do this for a long time so I can add the option while at base to allow other players to easily get each other's load-outs (mil sim get the required loadout easy instead of someone yelling saying get the gear on NOW). I have no idea how to go about this but if you got the time to write this could you please set it up as a scroll option, I can do the rest.


  4. How would I edit this arma 3 life code to allow variables for the item name and the amount of the item given the variables are already called:

     

    [true,"cannabis",1] call life_fnc_handleInv;

     

    cannabis is the item and 1 is the amount. I know the amount will be easy but i'm unsure how to do the name. My guess would be something like this:

     

    [true,"%1",ItemType,amount] call life_fnc_handleInv;

    amount being the number of the item and ItemType being the item.

    • Like 1

  5. 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.


  6. 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.
     
     

     


  7. I'm working on an arma 3 life server. I'm trying to change the respawn time so when there is no ems the revive timer is 1min and if there is, its 10min.

    All i need to get this to work is the command to test for active players on independent.

     

    code for revive time: life_respawn_timer = 1;//number goes by min


  8. its just small something like: 

     

     

    Check_Me = [""];
    _Tell_Me = [""];
    publicVariable "_Check_Me";
    publicVariable "_Tell_Me";
    if (getplayerUID player in _Check_Me) then
    {
    waituntil {!isnull (finddisplay 46)};
     
    (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call MY_KEYDOWN_FNC;false;"];
     
    MY_KEYDOWN_FNC = {
    switch (_this) do {
     
                    //Key F12
    case 88: {
    if(getplayerUID player in _Tell_Me) then
    {
    player sideChat "TEST";
    };
    };  
    };
    };
     
    };
     
    Is what i tried to do, im learning C++ in school, thats all I know. I know how to edit files but cant make my own
    So it will be user ID
×