Jump to content

Chuc

Member
  • Content Count

    202
  • Joined

  • Last visited

  • Medals

Posts posted by Chuc


  1. @GEORGE FLOROS GR You seem to know what you on about. Did you see my vehicle loot script? It loads a vehicle up with random loot from a list of loot. Now it works perfect for your random vehicle spawn script out of your Salvation mission. But the oddest thing is going on with the ravage vehicle module. What is happening is this. 

     

    The module is set to wrecks only, doesnt really matter which it does the same for all of them, cache at 750 and no burning car. My vehicle loot script is fired form my initServer.sqf. A placed car next to my test spawn is getting the right loot but ravage vehicles are only getting the backpacks. Backpacks being the last in the script to be placed in a vehicle. Even if i fire the script directly into the modules init (first time i thought of that) the same result is happening. Ill post the script here. Someone may want it aswell.

     

    VehicleLoot.sqf

    Spoiler

    /*
        author:
               Chuc

        description:
                     Spawn random custom loot into any vehicle on the map.
                     Works for editor placed vehicles or scripted spawned vehicles
                     on mission start. Havnt tested for spawned vehicles after mission start.

                     Anyone is welcome to use/edit/share anything form the script. If you
                     make it better please let me know because this was the only way i could figure
                     it out.

                     Requires the CBA Mod to work.
                     https://steamcommunity.com/sharedfiles/filedetails/?id=450814997

                     Activate with this execVM "VehicleLoot.sqf"; I put it in initServer.sqf
    */
    //sleep 10; // I tried to add a sleep here to see if it would make the rest spawn for the rvg vehicle module but didnt help

    if (isServer) then {
        // Set items: Pistols
        pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "bnae_l35_c_virtual",
                            //RHS Pistols
                            "rhsusf_weap_m9",
                            "rhsusf_weap_glock17g4",
                            //CUP Pistols
                            "CUP_hgun_Colt1911",
                            "CUP_hgun_TaurusTracker455"
                        ];
        // Set items: Shotguns
        ShotGunLoot =
                        [
                            //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_m97_s_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual"
                        ];
        // Set items: Food and Water
        foodLoot =
                        [
                            //Ravage Food and Water
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];
        // Set items: Weapon attachments, first-aid, Binoculars
        itemsLoot =
                        [
                            //Ryans Items
                            "ryan_ruger77_optic_SOS",
                            //Dagger Items
                            "Dagger_10x_Round_Dot",
                            "Dagger_12x_Round_Dot_Gen2",
                            "Dagger_16x_Round_Dot",
                            //Bnae Items
                            "bnae_scope_blk_virtual",
                            "bnae_bipod_blk_virtual",
                            //Vanilla items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                            "acc_flashlight",
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                               "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];
        // Set Clothing: Hats, Helmets, Uniforms
        clothesLoot =
                        [
                            //Vanilla Clothing
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                            "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1",
                               //RHS Clothing
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green"
                        ];

        // Set Vests: Any vests
        vestsLoot =
                        [
                            //Vanilla Vests
                            "V_Rangemaster_belt",
                            "Vest_V_Press_F",
                            //RHS Vests
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "rhs_6sh46",
                            //Dagger Vests
                            "dgr_coat5",
                            "dgr_coat6",
                            "dgr_coat7",
                            "dgr_coat8"
                        ];

        // Set Backpacks: Any packpacks
        backpacksLoot =
                        [
                            //Vanilla Bags
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            //RHS Bags
                            "rhs_sidor",
                            //Vanilla Respawn Camps
                            "B_Carryall_cbr",
                             "B_Carryall_khk",
                             "B_Carryall_mcamo",
                             "B_Carryall_ocamo",
                             "B_Carryall_oli",
                             "B_Carryall_oucamo"
                        ];

        // Set items: Rifles
         RifleLoot =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_srifle_M14",
                             //Dagger Rifles
                             "dgr_22",
                             "dgr_220",
                             "dgr_223",
                             //Ryans Rifles
                             "ryan_ruger77"
                         ];

        // Set items: Snipers
         SniperLoot =   [
                            //CUP Rifles
                            "CUP_srifle_CZ550",
                            "CUP_smg_MP5A5",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT",
                            "bnae_falkor_blk_virtual",
                            //Dagger Rifles
                            "dgr_3006",
                            "dgr_257",
                            "dgr_270",
                            "dgr_300blk",
                            "dgr_308_m40_3",
                            //Ryans Sniper
                            "ryan_ruger77scope"
                        ];

              ////////////// Magazines //////////////
         // Set items: Rifle Mags
         Mag_Rifle =    [
                            //RHS Rifle Mags
                            "20Rnd_762x51_Mag",
                            "rhsusf_20Rnd_762x51_m993_Mag",
                            //Ryan Rifle Mags
                            "ryan_ruger77magazine",
                            //Bnae Rifle Mags
                            "10Rnd_303_Magazine",
                            //CUP Rifle Mags
                            "CUP_20Rnd_762x51_DMR",
                            //Dagger Rifle Mags
                            "DGR_22_Match_20Rnd",
                            "DGR_220_20Rnd",
                            "DGR_224_M193_10Rnd"
                        ];

         // Set items: Sniper Mags
         Mag_Sniper =   [
                            //Ryan Rifle Mags
                            "ryan_ruger77magazine",
                            //Bnae Rifle Mags
                            "10Rnd_300WM_Magazine",
                            //CUP Rifle Mags
                            "CUP_5x_22_LR_17_HMR_M",
                            "CUP_5Rnd_762x51_M24",
                            "CUP_30Rnd_9x19_MP5",
                            //Dagger Rifle Mags
                            "DGR_257_10Rnd",
                            "DGR_270_10Rnd",
                            "DGR_300BLK_F_10Rnd",
                            "DGR_308_M80_10Rnd",
                            "DGR_3006M72_10Rnd"
                        ];

         // Set items: Rare or Random Mags
         Mag_Rare =    [
                            //RHS Mags
                            "rhsusf_mag_15Rnd_9x19_FMJ",
                            "rhsusf_mag_17Rnd_9x19_FMJ",
                            "rhsusf_20Rnd_762x51_m118_special_Mag",
                            "rhsusf_20Rnd_762x51_m62_Mag",
                            //Bnae Mags
                            "8Rnd_45ACP_Magazine",
                            "8Rnd_45Super_Magazine",
                            //Dagger Mags
                            "DGR_3006M22_10Rnd",
                            "DGR_3006M2_10Rnd",
                            "DGR_308_B416_10Rnd",
                            "DGR_308_M993_10Rnd",
                            "DGR_300BLK_S_10Rnd",
                            "DGR_300BLK_HP_10Rnd",
                            "DGR_224_SS109_10Rnd",
                            "DGR_224_MK318_10Rnd",
                            "DGR_224_MK262_10Rnd",
                            "DGR_224_M995_10Rnd",
                            "DGR_22_Subsonic_20Rnd",
                            "DGR_22_Stinger_20Rnd",
                            "DGR_224_VLD_10Rnd"
                        ];
         // Set items: Pistol Mags
         Mag_Pistol =   [
                            //Bnae Pistol Mags
                            "8Rnd_45GAP_Magazine",
                            "6Rnd_357M_Magazine",
                            "8Rnd_9x19_Magazine",
                            //CUP Pistol Mags
                            "CUP_7Rnd_45ACP_1911",
                            "CUP_6Rnd_45ACP_M",
                            //RHS Pistol Mags
                            "rhsusf_mag_15Rnd_9x19_JHP",
                            "rhsusf_mag_17Rnd_9x19_JHP"
                        ];

         // Set items: ShotGun Mags
         Mag_Shotgun =  [
                            //Bnae ShotGun Mags
                            "6Rnd_00_Buckshot_Magazine",
                            "6Rnd_Slug_Magazine",
                            "2Rnd_00_Buckshot_Magazine",
                            "2Rnd_Slug_Magazine",
                            "5Rnd_00_Buckshot_Magazine",
                            "5Rnd_Slug_Magazine"
                        ];

    ["Car", "init",
        {
             (_this select 0) addWeaponCargoGlobal [selectRandom ShotGunLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Shotgun, round(random 2)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom pistolLoot, round(random 2)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Pistol, round(random 3)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom RifleLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rifle, round(random 1)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom SniperLoot, 0 + (random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Sniper, 0 + (random 1)];

     

             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rare, 0 + (random 1)];

     

             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 0 + (random 2)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)]; // Only this is spawning\working for the ravage vehicle module
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };
     

     

    • Like 2

  2. So going to bring up the radiation question again because it hasn't been answered yet, as far as i can tell. I would like to know 2 things about the radiation.

     

     First. How would i go about making a radiation zone spawn from a script?

     

    Second. I have a radiation script that was modified last year some time by me and some others on these forums. I cant remember who. Was wondering if anyone would know how to add ravage radiation to it so you get the ravage rad poisoning and how to make it                   so you take damage over time not just dead after a set time in the zone. Also how to add the other 2 gas masks to it, so far i only have the one working with it. 

     

    radiation.sqf

    Spoiler

    //  place a trigger (none none) just for area
    //      condition: true
    //      on activation:

     

    {
      [_x,thisTrigger] spawn {
        _unit =_this select 0;
        _trg = _this select 1;
        private "_timer";
        while {alive _unit && local _unit} do {
          waitUntil {sleep 0.5; _unit inArea _trg && {goggles _unit != "Mask_M50"}};
          if (isPlayer _unit) then {
            hint parseText format["<t size='1.10' font='PuristaMedium' color='#F0133C'>Radiation hazard! Check your equipment</t>"];
            _unit setVariable ["radiat", ppEffectCreate ["DynamicBlur",450]];
            (_unit getVariable "radiat") ppEffectEnable true;
            (_unit getVariable "radiat") ppEffectAdjust [4];
            (_unit getVariable "radiat") ppEffectCommit 10;
          };
          _timer = diag_tickTime;
          waitUntil {sleep 0.5; !(_unit inArea _trg) or diag_tickTime > _timer + 30 or {goggles _unit == "Mask_M50"}};
          if ( diag_tickTime > _timer + 30) exitWith {_unit setDamage 1};
          if (isPlayer _unit) then {
            hint parseText format["<t size='1.10' font='PuristaMedium' color='#13F03C'>You are out of contamination</t>"];
            _unit setVariable ["noradiat", ppEffectCreate ["DynamicBlur",450]];
            (_unit getVariable "noradiat") ppEffectEnable true;
            (_unit getVariable "noradiat") ppEffectAdjust [0];
            (_unit getVariable "noradiat") ppEffectCommit 10;
          };
       }
      }
    } forEach allUnits;

     

    //  you can change the classes as you like.
    //  Example: Remove vest _unit == "V_RebreatherB" and replace "H_PilotHelmetFighter_B"  for  "AAF_pilot_headhelmet"

     

    • Like 1

  3. 3 hours ago, Grumpy Old Man said:

     

    That's why you need to tie the magazines to their compatible weapons, like this:

    
    _weapons = ["arifle_MXC_F","arifle_AK12_F","arifle_TRG20_F"];
    
    //add random weapon to vehicle cargo
    _vehicle = cursorobject;
    _rndWeapon = selectRandom _weapons;
    _mags = getArray (configfile >> "CfgWeapons" >> _rndWeapon >> "magazines");
    _rndMag = selectRandom _mags;
    
    _weapAmount = round (1 + random 3);
    _magAmount = round ((4 + random 4) * _weapAmount);//so you'll get enough mags for each weapon added
    
    _vehicle addWeaponCargo [_rndWeapon,_weapAmount];
    _vehicle addMagazineCargo [_rndMag,_magAmount];

    This will add at least one random weapon with at least 4-8 magazines into the cursor target.

    Multiply the magazine amount with the amount of weapons added so you'll end up with plenty of useable magazines for each weapon added.

     

    Cheers

     

    So i tried to implement your code into mine and i got it to spawn the ammo for the guns in car. Guns where random between the 2 editor placed cars i had and all guns had the right ammo. I couldnt seem to spawn in random ammo at all, ammo not for the guns spawned. That wasnt really a problem as a bit more tweaking could add that. The biggest problem was the code wasnt working for vehicles spawned by a script. Not sure what caused that to happen but its okay.

     

    What i have done is added the magazines into there own loot list and just have them spawn in with the guns. Sometimes you will not get any ammo for the guns in car but sometimes you do. It works well and is random, random is what i was after.

     

    VehicleLoot.sqf

     

    Spoiler

    //////////////// Created by Chuc ////////////////////

     

    // execVM "VehicleLoot.sqf"


    if (isServer) then {
        pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "rhsusf_weap_m9",
                            "bnae_l35_c_virtual",
                            "CUP_hgun_Colt1911",
                            "rhsusf_weap_glock17g4",
                            "CUP_hgun_TaurusTracker455"
                        ];


        ShotGunLoot =
                        [
                              //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_m97_s_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual"
                        ];

        foodLoot =
                        [
                            //Ravage Items
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];


        itemsLoot =
                        [
                            "ryan_ruger77_optic_SOS",
                            "acc_flashlight",
                            //Dagger Items
                            "Dagger_10x_Round_Dot",
                            "Dagger_12x_Round_Dot_Gen2",
                            "Dagger_16x_Round_Dot",
                            //Bnae Items
                            "bnae_scope_blk_virtual",
                            "bnae_bipod_blk_virtual",
                            //Vanilla items
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                             "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];

        clothesLoot =
                        [
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green",
                               "U_B_T_FullGhillie_tna_F",
                               "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1"
                        ];


        vestsLoot =
                        [
                            "V_Rangemaster_belt",
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "Vest_V_Press_F",
                            "rhs_6sh46",
                            "dgr_coat5",
                            "dgr_coat6",
                            "dgr_coat7",
                            "dgr_coat8"
                        ];


        backpacksLoot =
                        [
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            "rhs_sidor",
                            "B_Carryall_cbr",
                            "B_Carryall_khk",
                            "B_Carryall_mcamo",
                            "B_Carryall_ocamo",
                            "B_Carryall_oli",
                            "B_Carryall_oucamo"
                        ];

     

         RifleLoot =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_srifle_M14",
                             "dgr_22",
                             "dgr_220",
                             "dgr_223",
                             "ryan_ruger77"
                         ];

     

         SniperLoot =   [
                            //CUP Weapons
                            "CUP_srifle_CZ550",
                            "CUP_smg_MP5A5",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT",
                            "bnae_falkor_blk_virtual",
                            "dgr_3006",
                            "dgr_257",
                            "dgr_270",
                            "dgr_300blk",
                            "dgr_308_m40_3",
                            "ryan_ruger77scope"
                        ];

     

              ////////////// Magazines //////////////
         Mag_Rifle =    [
                            "rhsusf_20Rnd_762x51_m993_Mag",
                            "ryan_ruger77magazine",
                            "10Rnd_303_Magazine",
                            "CUP_20Rnd_762x51_DMR",
                            "20Rnd_762x51_Mag",

                            "DGR_22_Match_20Rnd",
                            "DGR_220_20Rnd",
                            "DGR_224_M193_10Rnd"
                        ];

     

         Mag_Sniper =   [
                            "ryan_ruger77magazine",
                            "10Rnd_300WM_Magazine",
                            "CUP_5x_22_LR_17_HMR_M",
                            "CUP_5Rnd_762x51_M24",
                            "CUP_30Rnd_9x19_MP5",
                            "DGR_257_10Rnd",
                            "DGR_270_10Rnd",
                            "DGR_300BLK_F_10Rnd",
                            "DGR_308_M80_10Rnd",
                            "DGR_3006M72_10Rnd"
                        ];

     

         Mag_Rare =    [
                            "rhsusf_mag_15Rnd_9x19_FMJ",
                            "8Rnd_45ACP_Magazine",
                            "8Rnd_45Super_Magazine",
                            "rhsusf_mag_17Rnd_9x19_FMJ",
                            "DGR_3006M22_10Rnd",
                            "DGR_3006M2_10Rnd",
                            "DGR_308_B416_10Rnd",
                            "DGR_308_M993_10Rnd",
                            "DGR_300BLK_S_10Rnd",
                            "DGR_300BLK_HP_10Rnd",
                            "DGR_224_SS109_10Rnd",
                            "DGR_224_MK318_10Rnd",
                            "DGR_224_MK262_10Rnd",
                            "DGR_224_M995_10Rnd",
                            "DGR_22_Subsonic_20Rnd",
                            "rhsusf_20Rnd_762x51_m118_special_Mag",
                            "rhsusf_20Rnd_762x51_m62_Mag",
                            "DGR_22_Stinger_20Rnd",
                            "DGR_224_VLD_10Rnd"
                        ];

     

         Mag_Pistol =   [
                            "8Rnd_45GAP_Magazine",
                            "6Rnd_357M_Magazine",
                            "8Rnd_9x19_Magazine",
                            "CUP_7Rnd_45ACP_1911",
                            "CUP_6Rnd_45ACP_M",
                            "rhsusf_mag_15Rnd_9x19_JHP",
                            "rhsusf_mag_17Rnd_9x19_JHP"
                        ];

     

         Mag_Shotgun =  [
                            "6Rnd_00_Buckshot_Magazine",
                            "6Rnd_Slug_Magazine",
                            "2Rnd_00_Buckshot_Magazine",
                            "2Rnd_Slug_Magazine",
                            "5Rnd_00_Buckshot_Magazine",
                            "5Rnd_Slug_Magazine"
                        ];

     

    ["Car", "init",
        {
             (_this select 0) addWeaponCargoGlobal [selectRandom ShotGunLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Shotgun, round(random 2)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom pistolLoot, round(random 2)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Pistol, round(random 3)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom RifleLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rifle, round(random 1)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom SniperLoot, 0 + (random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Sniper, 0 + (random 1)];

     

             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rare, 0 + (random 1)];

     

             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 0 + (random 2)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)];
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };

     

     

    There is the Code if anyone would like it. Thanks for your help guys.

    • Like 1

  4. so awesome thank you @Grumpy Old Man that works a treat. But now my ammo isn't random. Changed it around heaps but still ammo is the same in all cars, some have different type i.e tracer versions. And none of the ammo fits in any of the spawned guns. My list isnt that long im sure eventually ill find a gun to fit the ammo i have. 

     

    Spoiler

    if (isServer) then {
        pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "rhsusf_weap_m9",
                            "bnae_l35_c_virtual",
                            "rhsusf_weap_m1911a1",
                            "CUP_hgun_Colt1911",
                            "rhsusf_weap_glock17g4",
                            "rhsusf_weap_m1911a1",
     //                       "KICKASS_Sawed_Off_Shotgun",
                            "CUP_hgun_TaurusTracker455"
     //                       "Hatchet",
     //                       "KA_knife",
     //                       "KA_dagger"
                        ];


        ShotGunLoot =
                        [
                              //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_m97_s_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual",
                            "rhs_weap_M590_8RD",
                            "rhs_weap_M590_5RD",
                            "CUP_sgun_M1014"
    //                        "KICKASS_Sawed_Off_Shotgun"
                        ];

        foodLoot =
                        [
                            //Ravage Items
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];


        itemsLoot =
                        [
                            "ryan_ruger77_optic_SOS",
                            "acc_flashlight",
                            //Dagger Items
                            "Dagger_10x_Round_Dot",
                            "Dagger_12x_Round_Dot_Gen2",
                            "Dagger_16x_Round_Dot",
                            //Bnae Items
                            "bnae_scope_blk_virtual",
                            "bnae_bipod_blk_virtual",
                            //Vanilla items
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                               "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];

        clothesLoot =
                        [
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green",
                               "U_B_T_FullGhillie_tna_F",
                            "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1"
     //                          "HITMAN_47_SUIT"
                        ];


        vestsLoot =
                        [
                            "V_Rangemaster_belt",
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "Vest_V_Press_F",
                            "rhs_6sh46",
    //                        "HITMAN_47_Hidden_Vest",
                            "dgr_coat5",
                            "dgr_coat6",
                            "dgr_coat7",
                            "dgr_coat8"
                        ];


        backpacksLoot =
                        [
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            "rhs_sidor",
                            "B_Carryall_cbr",
                             "B_Carryall_khk",
                             "B_Carryall_mcamo",
                             "B_Carryall_ocamo",
                             "B_Carryall_oli",
                             "B_Carryall_oucamo"
                        ];

     

         RifleLoot =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_srifle_LeeEnfield",
                             "CUP_srifle_M14",
                             "CUP_srifle_LeeEnfield_rail",
                             "dgr_22",
                             "dgr_220",
                             "dgr_223",
                             "ryan_ruger77"
                         ];

     

         SniperLoot =   [
                            //CUP Weapons
                            "CUP_srifle_CZ550",
                            "CUP_smg_MP5A5",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT",
                            "bnae_falkor_blk_virtual",
     //                       "KA_crossbow_black",
     //                       "KA_crossbow_wood",
                            "dgr_3006",
                            "dgr_257",
                            "dgr_270",
                            "dgr_300blk",
                            "dgr_308_m40_3",
                            "ryan_ruger77scope"
                        ];

     

    //////////////// Shotguns //////////////////////////////
            private _ShotGun = selectRandom ShotGunLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _ShotGun));

            private _ShotGun_magazines = [
                configFile >> _config >> _ShotGun >> "magazines",
                configFile >> _config >> _ShotGun
            ] select (_config isEqualTo "cfgMagazines");

     

    ////////////// Pistols /////////////////
            private _pistol = selectRandom pistolLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _pistol));

            private _pistol_magazines = [
                configFile >> _config >> _pistol >> "magazines",
                configFile >> _config >> _pistol
            ] select (_config isEqualTo "cfgMagazines");

     

    ////////////////// Rifles ////////////////////////////
               private _Rifles = selectRandom RifleLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _Rifles));

            private _Rifle_magazines = [
                configFile >> _config >> _Rifles >> "magazines",
                configFile >> _config >> _Rifles
            ] select (_config isEqualTo "cfgMagazines");

     

    /////////////////// Snipers ////////////////////////////
            private _Snipers = selectRandom SniperLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _Snipers));

            private _Sniper_magazines = [
                configFile >> _config >> _Snipers >> "magazines",
                configFile >> _config >> _Snipers
            ] select (_config isEqualTo "cfgMagazines");


    ["Car", "init",
        {
             (_this select 0) addWeaponCargoGlobal [selectRandom ShotGunLoot, 1];
              private _arr1 = getArray _ShotGun_magazines; // ShotGun Mags
             (_this select 0) addMagazineCargoGlobal [selectRandom _arr1, 1];

     

    //          private _arr2 = getArray _ShotGun_magazines; // ShotGun Mags
    //         (_this select 0) addMagazineCargoGlobal [selectRandom _arr2, 1]; // ShotGunLootround(random 1)

     

             (_this select 0) addWeaponCargoGlobal [selectRandom pistolLoot, 1];
              private _arr3 = getArray _pistol_magazines; // Pistol Mags round(random 2)
             (_this select 0) addMagazineCargoGlobal [selectRandom _arr3, 1];

     

    //          private _arr4 = getArray _pistol_magazines; // Pistol Mags
    //         (_this select 0) addMagazineCargoGlobal [selectRandom _arr4, 1];  // pistolLoot round(random 2)

     

             (_this select 0) addWeaponCargoGlobal [selectRandom RifleLoot, 1];
              private _arr5 = getArray _Rifle_magazines; // Rifle Mags
             (_this select 0) addMagazineCargoGlobal [[selectRandom _arr5, _Rifles] select (_arr5 isEqualTo []), 1];

     

    //          private _arr6 = getArray _Rifle_magazines; // Rifle Mags
    //         (_this select 0) addMagazineCargoGlobal [selectRandom _arr6, 1];  // RifleLootround(random 1)

     

             (_this select 0) addWeaponCargoGlobal [selectRandom SniperLoot, 1];
              private _arr7 = getArray _Sniper_magazines; // Sniper Mags
             (_this select 0) addMagazineCargoGlobal [[selectRandom _arr7, _Snipers] select (_arr7 isEqualTo []), 1];

     

    //          private _arr8 = getArray _Sniper_magazines; // Sniper Mags
    //         (_this select 0) addMagazineCargoGlobal [selectRandom _arr8, 1];  // SniperLoot round(random 1)


             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)];
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };

    /* You randomize too early:

    private _ShotGun = selectRandom ShotGunLoot;
    //later in the CBA EH init:
    (_this select 0) addWeaponCargoGlobal [_ShotGun, 1];//will always be the same _ShotGun for every spawned car

    //do this instead:
    (_this select 0) addWeaponCargoGlobal [selectRandom ShotGunLoot, 1];
    */

     

    So i got rid of the arrays i had in my op and made them like the rest. But now the ammo is the same type in all vehicles. The only other way i could think of it is make a loot list for the ammo types i want to spawn in but i was hoping i didnt have to do that.

     

    I made them all give me one so i could test what i was getting. The mission is a wasteland that has been that way for years and every car you come across is either a wreck or a survivors car. Being a survivors car there should be gear in it and if there are guns its understandable that there would be ammo for at least one gun in the car.


  5. Here you go @GEORGE FLOROS GR i uploaded a vanilla version of my random drop script to the workshop.

     

    https://steamcommunity.com/sharedfiles/filedetails/?id=1389027958

     

    They are pretty basic compared to the one im working on now. but it gives a good idea on what i am doing with them. The one im working on now adds about 30 more lines of code to my air_1 script. Once i get it better ill upload that for you as well. 

     

     

    Apparently my picture on the work shop is really blury

    • Like 1

  6. So i have made a half arsed script to spawn loot into vehicles. It works quite well. Any vehicle on the map that defines as a "car" will have my random array of loot spawn into it. You get 4 guns with random amount of ammo, sometimes not for the guns in the car. You get some clothes, vests, food, items and backpacks all random amounts. The problem i have it that each car will have the exact same Guns in them but everything else will be different. I have another script that spawns random cars all over, i went to a few of them each time i ran a test and they all had the same guns but everything else was different. I edited the loot script alot but still cant seem to figure out why the guns are all the same. So im here to see if anyone can help me.

     

    Original Script. Didnt work to good

    Spoiler

    here is my script. Its not very good and could probably have been done better but i did it most of it my self. Basically butchered 2 loot scripts i had found to spawn loot on the ground to make my vehicle loot but theres not much left of them. 

    Well here you go my script, after a few hours i rewrote the thing from scratch and cant figure out why all cars get the same guns and only the guns.

     

    if (isServer) then {
        pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "rhsusf_weap_m9",
                            "bnae_l35_c_virtual",
                            "rhsusf_weap_m1911a1",
                            "CUP_hgun_Colt1911",
                            "rhsusf_weap_glock17g4",
                            "rhsusf_weap_m1911a1"
                        ];


        ShotGunLoot =
                        [
                              //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual",
                            "rhs_weap_M590_8RD",
                            "rhs_weap_M590_5RD",
                            "CUP_sgun_M1014"
                        ];

        foodLoot =
                        [
                            //Ravage Items
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];


        itemsLoot =
                        [
                            //Vanilla items
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                               "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];

        clothesLoot =
                        [
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green",
                               "U_B_T_FullGhillie_tna_F",
                            "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1"
                        ];


        vestsLoot =
                        [
                            "V_Rangemaster_belt",
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "Vest_V_Press_F",
                            "rhs_6sh46"
                        ];


        backpacksLoot =
                        [
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            "rhs_sidor",
                            "B_Carryall_cbr",
                             "B_Carryall_khk",
                             "B_Carryall_mcamo",
                             "B_Carryall_ocamo",
                             "B_Carryall_oli",
                             "B_Carryall_oucamo"
                        ];

         _Rifle_Array =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_rifle_LeeEnfield",
                             "CUP_srifle_M14",
                             "CUP_smg_MP5A5",
                             "CUP_srifle_LeeEnfield_rail"
                     ]call BIS_fnc_selectRandom;

     

         _Sniper_Array = [
                            //CUP Weapons
                            "CUP_srifle_CZ550",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT"
                         ]call BIS_fnc_selectRandom;

     

            private _ShotGun = selectRandom ShotGunLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _ShotGun));

          

          private _ShotGun_magazines = [
                configFile >> _config >> _ShotGun >> "magazines",
                configFile >> _config >> _ShotGun
            ] select (_config isEqualTo "cfgMagazines");

         

       private _pistol = selectRandom pistolLoot;
            private _config = [
                "cfgMagazines",
                "cfgWeapons"
                ] select (isClass (configFile >> "cfgWeapons" >> _pistol));

       

        private _pistol_magazines = [
                configFile >> _config >> _pistol >> "magazines",
                configFile >> _config >> _pistol
            ] select (_config isEqualTo "cfgMagazines");

     

          _Rifle_magazines = getArray (configFile / "CfgWeapons" / _Rifle_Array / "magazines");
            _magazineClass_Rifle = _Rifle_magazines call Bis_fnc_selectRandom;

       

        _Sniper_magazines = getArray (configFile / "CfgWeapons" / _Sniper_Array / "magazines");
            _magazineClass_Sniper = _Sniper_magazines call Bis_fnc_selectRandom;

     

    ["Car", "init",
        {
             (_this select 0) addWeaponCargoGlobal [_ShotGun, 1];
              private _arr = getArray _ShotGun_magazines; // ShotGun Mags
             (_this select 0) addMagazineCargoGlobal [selectRandom _arr, round(random 2)];

     

           (_this select 0) addWeaponCargoGlobal [_pistol, 1];
              private _arr2 = getArray _pistol_magazines; // Pistol Mags
             (_this select 0) addMagazineCargoGlobal [selectRandom _arr2, round(random 2)];

      

           private _arr = getArray _pistol_magazines; // Pistol Mags
             (_this select 0) addMagazineCargoGlobal [[selectRandom _arr, _pistol] select (_arr isEqualTo []), round(random 1)];  // pistolLoot

            

           private _arr = getArray _ShotGun_magazines; // ShotGun Mags
             (_this select 0) addMagazineCargoGlobal [[selectRandom _arr, _ShotGun] select (_arr isEqualTo []), round(random 1)]; // ShotGunLoot

     

             (_this select 0) addWeaponCargoGlobal [_Sniper_Array, round(random 1)];
             (_this select 0) addWeaponCargoGlobal [_Rifle_Array, 1];

     

    //       (_this select 0) addMagazineCargoGlobal [_magazineClass_Rifle, round(random 2)];  //_Rifle_magazines _Rifle_Array


             (_this select 0) addMagazineCargoGlobal [_magazineClass_Rifle, round(random 2)]; //_Rifle_magazines _Rifle_Array
             (_this select 0) addMagazineCargoGlobal [_magazineClass_Sniper, round(random 2)]; //_Sniper_magazines _Sniper_Array

     

             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)];
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };

     

     

    Any help would be great. Really dont want every car to have the same guns, that wouldn't be very fun. 

     

    Anyone can feel free to use this if they would like, doesn't worry me at all. I searched high and low and couldn't find any script that gave vehicles loot.

     

    THis is an edited one that will weapons form there arrays at random and add ammo for them. Should be random for each car.

    Spoiler

    if (isServer) then {
        _pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "rhsusf_weap_m9",
                            "bnae_l35_c_virtual",
                            "CUP_hgun_Colt1911",
                            "rhsusf_weap_glock17g4",
                            "CUP_hgun_TaurusTracker455"
                        ];


        _ShotGunLoot =
                        [
                              //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_m97_s_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual",
                            "bnae_spr220_so_virtual"
                        ];

        foodLoot =
                        [
                            //Ravage Items
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];


        itemsLoot =
                        [
                            "ryan_ruger77_optic_SOS",
                            "acc_flashlight",
                            //Dagger Items
                            "Dagger_10x_Round_Dot",
                            "Dagger_12x_Round_Dot_Gen2",
                            "Dagger_16x_Round_Dot",
                            //Bnae Items
                            "bnae_scope_blk_virtual",
                            "bnae_bipod_blk_virtual",
                            //Vanilla items
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                               "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];

        clothesLoot =
                        [
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green",
                               "U_B_T_FullGhillie_tna_F",
                               "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1"
                        ];


        vestsLoot =
                        [
                            "V_Rangemaster_belt",
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "Vest_V_Press_F",
                            "rhs_6sh46",
                            "dgr_coat5",
                            "dgr_coat6",
                            "dgr_coat7",
                            "dgr_coat8"
                        ];


        backpacksLoot =
                        [
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            "rhs_sidor",
                            "B_Carryall_cbr",
                             "B_Carryall_khk",
                             "B_Carryall_mcamo",
                             "B_Carryall_ocamo",
                             "B_Carryall_oli",
                             "B_Carryall_oucamo"
                        ];

         _Rifle_Array =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_srifle_M14",
                             "dgr_22",
                             "dgr_220",
                             "dgr_223",
                             "ryan_ruger77"
                     ];

         _Sniper_Array = [
                            //CUP Weapons
                            "CUP_srifle_CZ550",
                            "CUP_smg_MP5A5",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT",
                            "bnae_falkor_blk_virtual",
                            "dgr_3006",
                            "dgr_257",
                            "dgr_270",
                            "dgr_300blk",
                            "dgr_308_m40_3",
                            "ryan_ruger77scope"
                         ];


    ["Car", "init",
        {
            _RndPistol = selectRandom _PistolLoot;
            _Pistol_Magazines = getArray (configFile / "CfgWeapons" / _RndPistol / "magazines");
            _MagazineClass_Pistol = _Pistol_Magazines call Bis_fnc_selectRandom;

     

            _RndShotGun = selectRandom _ShotGunLoot;
            _ShotGun_Magazines = getArray (configFile / "CfgWeapons" / _RndShotGun / "magazines");
            _MagazineClass_ShotGun = _ShotGun_Magazines call Bis_fnc_selectRandom;


            _RndRifle = selectRandom _Rifle_Array;
            _Rifle_Magazines = getArray (configFile / "CfgWeapons" / _RndRifle / "magazines");
            _MagazineClass_Rifle = _Rifle_Magazines call Bis_fnc_selectRandom;

     

            _RndSniper = selectRandom _Sniper_Array;
            _Sniper_Magazines = getArray (configFile / "CfgWeapons" / _RndSniper / "magazines");
            _MagazineClass_Sniper = _Sniper_Magazines call Bis_fnc_selectRandom;


             (_this select 0) addWeaponCargo [_RndPistol, 1];
             (_this select 0) addWeaponCargo [_RndShotGun, 1];
             (_this select 0) addWeaponCargo [_RndRifle, 1];
             (_this select 0) addWeaponCargo [_RndSniper, 1];

             (_this select 0) addMagazineCargoGlobal [_MagazineClass_Pistol, 1];
             (_this select 0) addMagazineCargoGlobal [_MagazineClass_ShotGun, 1];
             (_this select 0) addMagazineCargoGlobal [_MagazineClass_Rifle, 1];
             (_this select 0) addMagazineCargoGlobal [_MagazineClass_Sniper, 1];

             (_this select 0) addMagazineCargoGlobal [selectRandom _Sniper_Magazines, 1];

             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)];
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };

     

     

    This is my finished script that will spawn guns and ammo at random. Luck of the draw if you happen to get ammo with the guns in the car. Should be random for every car spawned or placed in editor

    Spoiler


    if (isServer) then {
        pistolLoot =
                        [
                             //Bnae Pistols
                            "bnae_r1_virtual",
                            "bnae_r1_e_virtual",
                            "bnae_r1_t_virtual",
                            "bnae_saa_virtual",
                            "rhsusf_weap_m9",
                            "bnae_l35_c_virtual",
                            "CUP_hgun_Colt1911",
                            "rhsusf_weap_glock17g4",
                            "CUP_hgun_TaurusTracker455"
     //                       "Hatchet",
     //                       "KA_knife",
     //                       "KA_dagger"
                        ];
        ShotGunLoot =
                        [
                              //Bnae shotguns
                            "bnae_m97_virtual",
                            "bnae_m97_camo1_virtual",
                            "bnae_m97_s_virtual",
                            "bnae_spr220_virtual",
                            "bnae_spr220_camo1_virtual",
                            "bnae_spr220_so_virtual",
                            "bnae_spr220_so_camo1_virtual"
                        ];
        // Set items: Weapon attachments, first-aid, Binoculars
        foodLoot =
                        [
                            //Ravage Items
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_canOpener",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_plasticBottleEmpty",
                            "rvg_canteenEmpty",
                            "rvg_plasticBottle",
                            "rvg_plasticBottlePurified",
                            "rvg_spirit",
                            "rvg_franta",
                            "rvg_beans",
                            "rvg_bacon",
                            "rvg_milk",
                            "rvg_rice",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money",
                            "rvg_money"
                        ];
        itemsLoot =
                        [
                            "ryan_ruger77_optic_SOS",
                            "acc_flashlight",
                            //Dagger Items
                            "Dagger_10x_Round_Dot",
                            "Dagger_12x_Round_Dot_Gen2",
                            "Dagger_16x_Round_Dot",
                            //Bnae Items
                            "bnae_scope_blk_virtual",
                            "bnae_bipod_blk_virtual",
                            //Vanilla items
                            "Item_optic_LRPS",
                            "Item_bipod_01_F_khk",
                            //RHS Items
                            "rhsusf_acc_M8541",
                            "rhsusf_acc_premier",
                            "rhsusf_acc_LEUPOLDMK4",
                            "rhsusf_acc_LEUPOLDMK4_2",
                            "rhsusf_acc_harris_bipod",
                            //CUP Items
                            "CUP_optic_LeupoldMk4",
                            "CUP_optic_Leupold_VX3",
                            "CUP_bipod_Harris_1A2_L",
                            "CUP_bipod_VLTOR_Modpod",
                            //Ravage Items
                            "Binocular",
                            "FirstAidKit",
                            "Medikit",
                            "ItemMap",
                               "rvg_canisterFuel_Empty",
                            "rvg_toolkit",
                            "rvg_tire",
                            "rvg_money",
                            "rvg_docFolder",
                            "rvg_money",
                            "rvg_hose",
                            "rvg_guttingKnife",
                            "rvg_foldedTent",
                            "rvg_matches",
                            "rvg_foldedTent"
                        ];
        // Set Clothing: Hats, Helmets, Uniforms
        clothesLoot =
                        [
                               "U_C_Journalist",
                               "U_C_Poloshirt_blue",
                               "U_C_Poloshirt_burgundy",
                               "U_C_Poloshirt_salmon",
                               "U_C_Poloshirt_stripped",
                               "U_C_Poloshirt_tricolour",
                               "U_C_Poor_1",
                               "U_C_Poor_2",
                               "U_C_Poor_shorts_1",
                               "U_C_Scientist",
                               "U_OrestesBody",
                               "U_Rangemaster",
                               "U_NikosAgedBody",
                               "U_NikosBody",
                               "U_Competitor",
                               "U_I_G_resistanceLeader_F",
                               "U_C_man_sport_1_F",
                               "U_C_man_sport_2_F",
                               "U_C_man_sport_3_F",
                               "U_C_Man_casual_1_F",
                               "U_C_Man_casual_2_F",
                               "U_C_Man_casual_3_F",
                               "U_C_Man_casual_4_F",
                               "U_C_Man_casual_5_F",
                               "U_C_Man_casual_6_F",
                               "H_Helmet_Skate",
                               "H_Hat_brown",
                               "rhs_Booniehat_ocp",
                               "rhs_beanie_green",
                               "U_B_T_FullGhillie_tna_F",
                            "U_IG_Guerilla1_1",
                               "U_IG_Guerilla2_1",
                               "U_IG_Guerilla2_2",
                               "U_IG_Guerilla2_3",
                               "U_IG_Guerilla3_1",
                               "U_BG_Guerilla2_1",
                               "U_IG_Guerilla3_2",
                               "U_BG_Guerrilla_6_1",
                               "U_BG_Guerilla1_1",
                               "U_BG_Guerilla2_2",
                               "U_BG_Guerilla2_3",
                               "U_BG_Guerilla3_1"
     //                          "HITMAN_47_SUIT"
                        ];

        // Set Vests: Any vests
        vestsLoot =
                        [
                            "V_Rangemaster_belt",
                            "rhs_vest_commander",
                            "rhs_vest_pistol_holster",
                            "Vest_V_Press_F",
                            "rhs_6sh46",
    //                        "HITMAN_47_Hidden_Vest",
                            "dgr_coat5",
                            "dgr_coat6",
                            "dgr_coat7",
                            "dgr_coat8"
                        ];

        // Set Backpacks: Any packpacks
        backpacksLoot =
                        [
                            "B_AssaultPack_rgr",
                            "B_Kitbag_rgr",
                            "B_TacticalPack_rgr",
                            "B_Respawn_Sleeping_bag_blue_F",
                            "B_Respawn_Sleeping_bag_brown_F",
                            "B_Respawn_TentDome_F",
                            "B_Respawn_Sleeping_bag_F",
                            "B_Respawn_TentA_F",
                            "rhs_sidor",
                            "B_Carryall_cbr",
                             "B_Carryall_khk",
                             "B_Carryall_mcamo",
                             "B_Carryall_ocamo",
                             "B_Carryall_oli",
                             "B_Carryall_oucamo"
                        ];

         RifleLoot =    [
                             //RHS Weapons
                             "rhs_weap_m14ebrri",
                             //Bnae Snipers
                             "bnae_mk1_virtual",
                             //CUP Rifles
                             "CUP_srifle_M14",
                             "dgr_22",
                             "dgr_220",
                             "dgr_223",
                             "ryan_ruger77"
                         ];

         SniperLoot =   [
                            //CUP Weapons
                            "CUP_srifle_CZ550",
                            "CUP_smg_MP5A5",
                            "CUP_srifle_M24_des_LeupoldMk4LRT",
                            "CUP_srifle_M24_wdl_LeupoldMk4LRT",
                            "bnae_falkor_blk_virtual",
     //                       "KA_crossbow_black",
     //                       "KA_crossbow_wood",
                            "dgr_3006",
                            "dgr_257",
                            "dgr_270",
                            "dgr_300blk",
                            "dgr_308_m40_3",
                            "ryan_ruger77scope"
                        ];

              ////////////// Magazines //////////////
         Mag_Rifle =    [
                            "rhsusf_20Rnd_762x51_m993_Mag",
                            "ryan_ruger77magazine",
                            "10Rnd_303_Magazine",
                            "CUP_20Rnd_762x51_DMR",
                            "20Rnd_762x51_Mag",

                            "DGR_22_Match_20Rnd",
                            "DGR_220_20Rnd",
                            "DGR_224_M193_10Rnd"
                        ];

         Mag_Sniper =   [
                            "ryan_ruger77magazine",
                            "10Rnd_300WM_Magazine",
                            "CUP_5x_22_LR_17_HMR_M",
                            "CUP_5Rnd_762x51_M24",
                            "CUP_30Rnd_9x19_MP5",
                            "DGR_257_10Rnd",
                            "DGR_270_10Rnd",
                            "DGR_300BLK_F_10Rnd",
                            "DGR_308_M80_10Rnd",
                            "DGR_3006M72_10Rnd"
                        ];

         Mag_Rare =    [
                            "rhsusf_mag_15Rnd_9x19_FMJ",
                            "8Rnd_45ACP_Magazine",
                            "8Rnd_45Super_Magazine",
                            "rhsusf_mag_17Rnd_9x19_FMJ",
                            "DGR_3006M22_10Rnd",
                            "DGR_3006M2_10Rnd",
                            "DGR_308_B416_10Rnd",
                            "DGR_308_M993_10Rnd",
                            "DGR_300BLK_S_10Rnd",
                            "DGR_300BLK_HP_10Rnd",
                            "DGR_224_SS109_10Rnd",
                            "DGR_224_MK318_10Rnd",
                            "DGR_224_MK262_10Rnd",
                            "DGR_224_M995_10Rnd",
                            "DGR_22_Subsonic_20Rnd",
                            "rhsusf_20Rnd_762x51_m118_special_Mag",
                            "rhsusf_20Rnd_762x51_m62_Mag",
                            "DGR_22_Stinger_20Rnd",
                            "DGR_224_VLD_10Rnd"
                        ];

         Mag_Pistol =   [
                            "8Rnd_45GAP_Magazine",
                            "6Rnd_357M_Magazine",
                            "8Rnd_9x19_Magazine",
                            "CUP_7Rnd_45ACP_1911",
                            "CUP_6Rnd_45ACP_M",
                            "rhsusf_mag_15Rnd_9x19_JHP",
                            "rhsusf_mag_17Rnd_9x19_JHP"
                        ];

         Mag_Shotgun =  [
                            "6Rnd_00_Buckshot_Magazine",
                            "6Rnd_Slug_Magazine",
                            "2Rnd_00_Buckshot_Magazine",
                            "2Rnd_Slug_Magazine",
                            "5Rnd_00_Buckshot_Magazine",
                            "5Rnd_Slug_Magazine"
                        ];

    ["Car", "init",
        {
             (_this select 0) addWeaponCargoGlobal [selectRandom ShotGunLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Shotgun, round(random 2)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom pistolLoot, round(random 2)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Pistol, round(random 3)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom RifleLoot, round(random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rifle, round(random 1)];

     

             (_this select 0) addWeaponCargoGlobal [selectRandom SniperLoot, 0 + (random 1)];
             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Sniper, 0 + (random 1)];

     

             (_this select 0) addMagazineCargoGlobal [selectRandom Mag_Rare, 0 + (random 1)];

     

             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, ceil(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom foodLoot, round(random 3)];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom itemsLoot, 0 + (random 2)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, round(random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom clothesLoot, 1];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 0 + (random 1)];
             (_this select 0) addItemCargoGlobal [selectRandom vestsLoot, 1];
             (_this select 0) addBackpackCargoGlobal [selectRandom backpacksLoot, round(random 2)];
        }, true, [], true] call CBA_fnc_addClassEventHandler;
    };

     

     

    Feel free to use these scripts as you see fit, just change the loot to what you want spawned. 

     

    Thanks to everyone who gave me advise on this

    • Like 1
    • Thanks 1

  7. @GEORGE FLOROS GR Awesome mission. Me and my 4 year old gave it ago. Found my first npc after about 20min walking only to have him throw a grenade at me and kill both of us.

     

    I decided to take a page out of your book and try and make a mission with scripts. I read that you didnt mind if we pull your mission apart. My missions are for personal use and i never upload them.

     

    You have opened my eyes to scripting in a different way than i had been doing. Thank you for that. 

     

    I really liked your random trader spawning. I also like your supply drop script your have. Using your random trader script as a template i managed to get camps to spawn randomly with a radio and add the airdrop as an add action. Even got squads of friendlies to guard the radio. Mixed with Eden Composition Spawning i have now managed to spawn full camps around the airdrops.

     

    i have only used your traders stuff and the random structure spawn out of your mission.

     

    Thank you again for your great work

    • Thanks 1

  8. if anyone is still looking for this type of thing heres one i made with the help of someone here. Cant remember who but she was nice. Made me make most of it she just got it working for me.

     

    PromoteUnit = {
        private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
        private _old = rankId _this;
        if (count _rks - _old > 1) then {
            _this setRank (_rks select _old + 1);
            systemChat format ["Unit %1 promoted to %2", _this, rank _this];
        }
    };
     

    I was calling it with an addaction. Was gonna implement it into my mission but my mission files got corrupted, 12 months gone in seconds. 

     

    heres the one to demote

     

    DemoteUnit = {
        private _rks = ["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"];
        private _old = rankId _this;
        if (count _rks - _old > 1) then {
            _this setRank (_rks select _old - 1);
            systemChat format ["Unit %2 demoted to %1", _this, rank _this];
        }
    };

     

    there were errors but i cant remember them. Pretty sure you coudnt be demoted from Colonel or something like that

    • Like 2
    • Thanks 1

  9. i found this in a mission by [GR]GEORGE F.

     

    ; No Kill Zone - v1.16
    ; (c)2016 By SuperChicken Productions - Atlanta GA., USA

     

    NoKillZone.Sqs Note that this is a SQS file not a SQF file


    ; usage = [MARKER,DISTANCE,TEXT-IN,TEXT-OUT,PROTECTION] exec "NoKillZone.Sqs"; - MARKER = a marker that is the CENTER of the zone - DISTANCE = how from out from the MARKER to 'protect' - TEXT-IN = text to show via HINT if inside zone - TEXT-OUT = text to show via HINT if outside zone - PROTECTION = if players vehicle is also protected
    ; example:  ["CentralSZ",500,"You Have Entered The Central Safe Zone!","You Have Left The Central Safe Zone!",0] exec "NoKillZone.Sqs"; - this would protect any player and not his vehicle within 500m of the marker called 'CentralSZ'

    ; run for every marker you have set
    ; example, for epoch you have 3:
    ; ["CentralSZ",500] exec "NoKillZone.Sqs";
    ; ["WesternSZ",500] exec "NoKillZone.Sqs";
    ; ["EasternSZ",500] exec "NoKillZone.Sqs";

    ; Also could be:
    ; #1 - ["CentralSZ",500,"You Have Entered The Central Safe Zone","You Have Left The Central Safe Zone"] exec "NoKillZone.Sqs";
    ; #2 - ["CentralSZ",500,"You Have Entered The Central Safe Zone",""] exec "NoKillZone.Sqs";
    ; #3 - ["CentralSZ",500,"","You Have Left The Central Safe Zone"] exec "NoKillZone.Sqs";
    ; #4 - ["CentralSZ",500,"","You Have Left The Central Safe Zone"] exec "NoKillZone.Sqs"; - this would disable vechicle protection
    ; #5 - ["CentralSZ",500,"","You Have Left The Central Safe Zone",0] exec "NoKillZone.Sqs"; - this would disable vechicle protection
    ; #6 - ["CentralSZ",500,"","You Have Left The Central Safe Zone",1] exec "NoKillZone.Sqs"; - this would enable vechicle protection

    ; TEXT-IN and TEXT-OUT are OPTIONAL - if not supplied, no hint will be shown for that section (in/out)
    ; if you wished to use ONLY 'OUT' text and NO 'IN' text, you MUST include a empty quote for the 'IN' entry - see #3 above!  Missing quote(s) = fails to run!
    ; text may also use the '\n\ command to allow for multiple lines of text in hint!

    ; PROTECTION (vechicle protection) is also OPTIONAL.  if set to ZERO (0) or left out, it defaults to no protection.
    ; to enable protection, use a ONE (1) as a paramenter - see #6 above

    ; marker name and text ALL must be in quotes! 

    ; marker name is the name you gave the marker in the editor - NOT 'text' field, rather the 'NAME' field

    ; put script call into your server "INIT.Sqf" file to be run at startup and in the "OnPlayerRespawn.Sqf" file so that it may start again at respawn

    ; for those that may not know, the INIT.Sqf and the "OnPlayerRespawn.Sqf" are where your 'Mission.SQM' reside!  Not there?  CREATE THEM!  ;)


    ; this runs 100% on the client and NOT on the server!  ZERO performence hit on the server side and ZERO interference with most other scrips in use!


    ; can be used in MP or SP!


    ; ********************************************************************************

    ; make sure script only runs on clients
    if (isDedicated) then {goto "ExitHere"};


    #StartLoop
    ; set varis to be used by script
    _NKZver = "1.16"
    _getdistance = 0;
    _NKZflag=9;
    _vp="";

    ; text in use flags
    _inflag = 9;
    _outflag = 9;

    ; get params
    _NKZmarker = _this select 0;
    _NKZdistance = _this select 1;
    _NKZTextIn = _this select 2;
    _NKZTextOut = _this select 3;
    _NKZvech = _this select 4;


    ; checks to ensure both parameters (#1 & #2) have been set
    if ((isNil "_NKZmarker") or(isNil "_NKZdistance")) then {goto "ParaError"};


    ; checks to see if text exist, if not flag as such so no hint will show

    ; checks for inside zone text
    if (isNil "_NKZTextIn") then {_inflag = 0};
    if (!isNil "_NKZTextIn") then {_inflag = 1};

    ; checks for outside zone text
    if (isNil "_NKZTextOut") then {_outflag = 0};
    if (!isNil "_NKZTextOut") then {_outflag = 1};


    ; check for vechile protection here - if missing, set to 'off'
    if (isNil "_NKZvech") then {_NKZvech = 0};
    if (_NKZvech == 0) then {_vp="Vehicle Protection Is:  *Off*"};
    if (_NKZvech == 1) then {_vp="Vehicle Protection Is:  *On*"};

    ; startup notice
    ;systemchat format ["No Kill Zone Script v%2 Active For '%1'",_NKZmarker, _NKZver];
    ;systemchat format ["---  %1  ---",_vp];

    ; start the checking here
    #LoopHere

    _objcoords = getMarkerPos _NKZmarker;
    _getdistance = player distance _objcoords;

    if (_getdistance <= _NKZdistance) then {goto "InsideTheZone"};
    if (_getdistance > _NKZdistance) then {goto "OutsideTheZone"};
    goto "LoopHere";


    ; comes here if player is inside the set zone
    #InsideTheZone
    if (_NKZflag == 9) then {_NKZflag = 0};
    if (_NKZflag == 0) then {player allowdamage false};
    if ((_NKZflag == 0) && (_NKZvech == 1)) then {vehicle player allowdamage false};
    if ((_NKZflag == 0) && (_inflag == 1)) then {hint _NKZTextIn};
    _NKZflag = 1;
    goto "LoopHere";


    ; comes here if player is outside the set zone
    #OutsideTheZone
    if (_NKZflag == 9) then {goto "LoopHere"};
    if (_NKZflag == 1) then {player allowdamage true};
    if ((_NKZflag == 1) && (_NKZvech == 1)) then {vehicle player allowdamage true};
    if ((_NKZflag == 1) && (_outflag == 1)) then {hint _NKZTextOut};
    _NKZflag = 0;
    goto "LoopHere";

    ; comes here if the params are not set
    #ParaError
    hint format ["You Did Not Use Correct Parameters!\n\n\nMarker Name:  %1\n\nDistance:  %2\n\nPlease Correct And Try Again!\n",_NKZmarker, _NKZdistance];
    goto "ExitHere";

    ; master exit point
    #ExitHere

    ; ********************************************************************************
     

    [GR]GEORGE F. was using it to make safety around traders in his mission. He executed it at the bottom of the init.sqf with 

    ["Trader1",400,"You Have Entered a Trader Safe Zone!","You Have Left The Safe Zone!",1] exec "scripts\NoKillZone.Sqs";
     

     

    I  havent tried to use this yet as my missions rely on you stopping hostiles from getting near trader zones. If you let a trader die then thats on you.

    • Like 1

  10. I've been using this  Eden Composition Spawning for the last couple of days and it seems to working quite well mixed in with a random spawn script i use.

     

    Did you save the composition with a name then copy it into your mission folder? 

    Did you add the name of your composition into the composition.cfg file that came with  Eden Composition Spawning?

     

    ill copy one of mine here.

    composition.cfg

     

    LARs_spawnComp_debug = 1;

     

    class CfgCompositions

    {

            class Ant { #include "ant.sqe" };

            class Mort_1 { #include "Mort_1.sqe" };

            class Bandit_Camp_1 { #include "Bandit_Camp_1.sqe" };

            class Civilian_Camp_1 { #include "Civilian_Camp_1.sqe" };

    };

     

    I also removed all of his compositions and addActions. Then i used this code in sqf to spawn it

     

    Civilian_Camp_1.sqf

     

    pos = [] call BIS_fnc_randomPos;

     

    _Civilian_Camp_1 = "Land_HelipadEmpty_F" createVehicle pos;

    _randPos = _Civilian_Camp_1 getRelPos [0,0];

    ["Civilian_Camp_1", _randPos, [0,0,0], random 360, true] call LARs_fnc_spawnComp;

     

    _marker = createMarker ["Civilian_Camp_1",getPos _Civilian_Camp_1];

    _marker setMarkerType "mil_dot"; _marker setMarkerSize [1,1];

    _marker setMarkerColor "ColorBlack";

    _marker setMarkerText "Civilian Camp 1";

     

    Added 

    execVM "Scripts\RndComps\Civilian_Camp_1.sqf";

    into my initServer.sqf to spawn it.

     

    The Eden Composition Spawning will only work on a server. It will not work in singleplayer.

    I only make mission for myself to play and make them mp for respawning. I just set them to 1 player.

     

    My Civ Camp is a shanty town with alot in it. How are you doing it? maybe you have missed something


  11. 6 hours ago, MisterOth said:

    Hi ! you can add this to the init of the Unit placed.

      Reveal hidden contents

    this addaction ["Recruit Unit", "\ravage\actions\recruit.sqf","", 1, false, true, "", "alive _target && {group _target != group _this}"];  this addaction ["Dismiss Unit", "\ravage\actions\dismiss.sqf","", 1, false, true, "", "alive _target && {group _target == group _this}"];

     

    You can also learn some other small script here: http://ravage.wikia.com/wiki/Tools_for_Mission_Makers

     

    About the dismiss action, I don't know how this work...

    Edit: Maybe try only the first addaction about recruit and not the second one ??

    Edit 2: Sorry I tought you were asking about a unit placed in editor or asking about spawned one ?

     

    i was just sharing how i got spawned npc's to have the recruit option. With what i posted any spawned friendly, not placed in the editor, will have the recruit option there. Was gonna do more testing with it today

    • Like 1

  12. i looked every where trying to find a way to make any friendly on the map be recruit able. I tried the script code on the wiki and it didnt work, i kept getting errors. So i mixed a couple of other codes i had and came up with this

     

    Recruit.sqf

     

    ["man", "init", {

        _unit addAction ["Recruit Unit", "\ravage\actions\recruit.sqf",[_unit], 1, false, true, "", "alive _target && {group _target != group _this}"];

    // _unit addAction ["Dismiss Unit", "\ravage\actions\dismiss.sqf",[_unit], 1, false, true, "", "alive _target && {group _target == group _this}"];

    }, true, [], true] call CBA_fnc_addClassEventHandler;

     

    this will make any friendly on the map be recruit able. The only problem i had was i had dismiss on my action menu all the time. So once you recruited someone you would get 2 dismiss options but only one would work. So i just commented that line out.

     

    I put it in its own Recruit.sqf file and run it form my initServer.sqf with this command  execVM "Scripts\Recruit.sqf";

     

    If there is a better way to do please let me know. This took me all night to get to work. its just gone past 1am so im off to bed. Hope otheres find this useful.

     

    The Script Recruit code on the wiki doesnt work. well i couldnt get it to.

    • Like 2

  13. nice to see the mod on the workshop, well done.

     

    Was wondering if there was a way to exclude a building from the loot list so furniture dosent spawn in side. I know you can do it by class name but i dont want them all to be empty just one of them.

     

    thank you and Great mod


  14. 9 hours ago, lv1234 said:

    HI does anyone know how to make respawn camps work in SP for ravage?

     

    Since I want to make it so that when our player dies, he spawns with a civilian loadout and looses everything else

     

    and for "sp" multiplayer mission, does anyone know how to make the server restart or the mission restart after the player dies and doesn't have a respawn camp down?

     

    No respawning in sp. I searched for ever and the game just can't do it. Just set up a mp mission with only one player slot. 

     

    A script should be able to restart the mission once you die and can't spawn. I am looking for 


  15. 2 hours ago, R0adki11 said:

     

    It wouldn't as ACE is not a supported mod, the current mods supported can be found on the opening post of this thread.

     

    Ace does work with ravage but it takes abit to get it right. I only stopped using it because of another mod I have. 

     

    You do get two ways to repair cars and recruit people. You can't use all of aces modules because you will get errors with zombie damage. 

     

    It's possible but you need to do some work to make it flow right. You don't get any ace stuff in the loot but you still get the first aid kit and when you transfer it into your inventory it just separates into bandages and morphine. 


  16. 9 hours ago, haleks said:

    Hi guys!

     

    Quick update on the work being done for the next release : while working on a sideproject I found out that the caching system for spawned wrecks and vics is totally broken (nothing was being cached - at all). :/

    Already fixed on my end, here's the current changelog - to be released this week-end if I can :

     

    Awesome work. Can't wait for the zombies damage editing.

     

    I let a zombie attack me last night and they only do about 2 damage per hit. So they really are only a problem in a group. I also only have walkers. 

     

     


  17. 20 hours ago, haleks said:

    Hi Chuc, thanks for the report!

     

     

    I had similar reports, although yours indicates something might be going wrong with CBA... I'll see if I can find the exact problem, if not I guess I'll have to find another way to manage those vehicle actions.

     

    Regarding your recruited survivors : are you playing as a civilian? If you do, don't : in the Armaverse civilians silently panick while staying still instead of fighting for their lives. :)

     

    So I think I figured it out. The scavenge and repair are not working for vehicles spawned in by the module. Vehicles I place in editor work fine. 

×