Help Thread for Epoch Remove Weapons

hey. thanks for sharing. one small problem i have. its only working for the vodnik, not the other one

//Remove Weapon by SiothieGaming start
if (_object isKindOf "GAZ_Vodnik_HMG") then {
_object removeWeapon "2A42";
_object removeMagazine "1500Rnd_762x54_PKT";
_object addWeapon "M2";
_object addMagazine "100Rnd_127x99_M2";
};

if (_object isKindOf "AH1Z") then {
_object removeWeapon "CMFlareLauncher";
_object removeWeapon "M197";
_object removeWeapon "HellfireLauncher";
_object removeWeapon "FFARLauncher";
_object removeWeapon "SidewinderLaucher_AH1Z";
_object removeMagazine "120Rnd_CMFlareMagazine";
_object removeMagazine "750Rnd_M197_AH1";
_object removeMagazine "8Rnd_Hellfire";
_object removeMagazine "38Rnd_FFAR";
_object removeMagazine "2Rnd_Sidewinder_AH1Z";
};

if (_object isKindOf "AH6X_EP1") then {
_object addWeapon "M240_veh";
_object addMagazine "100Rnd_762x51_M240";
};


i also tried to add some guns to narmal vehicles. different guns. different vehicles. no succes.
i hope u can help me. thanks
 
Ok I gave this a shot and I am still running into the problem that I had with the standard script. Vehicles purchased from the trader or spawned in by my admins still have the normal weapons and ammo. Once the server restarts the vehicles change. Any ideas?
 
Hello, can i remove Radar with this script? :)
Sadly you can't. But there are scripts outthere who puts a grey field about it. So i guess you shall try this out.

hey. thanks for sharing. one small problem i have. its only working for the vodnik, not the other one

//Remove Weapon by SiothieGaming start
if (_object isKindOf "GAZ_Vodnik_HMG") then {
_object removeWeapon "2A42";
_object removeMagazine "1500Rnd_762x54_PKT";
_object addWeapon "M2";
_object addMagazine "100Rnd_127x99_M2";
};

if (_object isKindOf "AH1Z") then {
_object removeWeapon "CMFlareLauncher";
_object removeWeapon "M197";
_object removeWeapon "HellfireLauncher";
_object removeWeapon "FFARLauncher";
_object removeWeapon "SidewinderLaucher_AH1Z";
_object removeMagazine "120Rnd_CMFlareMagazine";
_object removeMagazine "750Rnd_M197_AH1";
_object removeMagazine "8Rnd_Hellfire";
_object removeMagazine "38Rnd_FFAR";
_object removeMagazine "2Rnd_Sidewinder_AH1Z";
};

if (_object isKindOf "AH6X_EP1") then {
_object addWeapon "M240_veh";
_object addMagazine "100Rnd_762x51_M240";
};


i also tried to add some guns to narmal vehicles. different guns. different vehicles. no succes.
i hope u can help me. thanks


The Combat-Helicopter always runs in problems, i can't help you with that. It's an arma problem, what you can do is trying out the Mi-24. But i'm not sure about this one.

The problem with the Littlebird is interesting. I can't figure out why this shoulnd't be working.
For example here is one we are using on our server:
Code:
    if (_object isKindOf "MQ9PredatorB") then {
            _object removeWeapon "HellfireLauncher";
            _object removeWeapon "HellfireLauncher";
            _object removeMagazine "8Rnd_Hellfire";
            _object addWeapon "M240_veh";
            _object addMagazine "100Rnd_762x51_M240";
            _object addMagazine "100Rnd_762x51_M240";

This works just fine and i also can't see any typos in your script. Are you sure you posted everything where it belongs? And are you aware of the fact that it is not possible to edit Vehicles which are not spawned before a restart/spawned by the trader/spawned by the random spawn system.

Try going through the tutorial a second time.


Ok I gave this a shot and I am still running into the problem that I had with the standard script. Vehicles purchased from the trader or spawned in by my admins still have the normal weapons and ammo. Once the server restarts the vehicles change. Any ideas?


You definitly put it in the wrong places. Send me your server pbo and i get it sorted.


cheers SG
 
Here are the snippets from my files in regards to the installation instructions.

Server_Monitor
Code:
            _object setVariable ["CharacterID", _ownerID, true];
           
            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end
           
            clearWeaponCargoGlobal  _object;
            clearMagazineCargoGlobal  _object;
            // _object setVehicleAmmo DZE_vehicleAmmo;
           
            if ((typeOf _object) in dayz_allowedObjects) then {

Server_Functions
Code:
server_spawnEvents =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf";
//server_weather =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf";

fnc_plyrHit   =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";
//Fnc for removing weapon by SiothieGaming
fnc_remWepSG =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_remWepSG.sqf";
server_deaths =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";

server_publishvehicle2
Code:
    if(!_donotusekey) then {
        // Lock vehicle
        _object setvehiclelock "locked";
    };

            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end
   
    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;
    // _object setVehicleAmmo DZE_vehicleAmmo;

server_publishvehicle3
Code:
// add items from previous vehicle here
    _weapons =         getWeaponCargo _object;
    _magazines =     getMagazineCargo _object;
    _backpacks =     getBackpackCargo _object;

         //Remove Weapon by SiothieGaming start
         call fnc_remWepSG;
         //Remove Weapon by SiothieGaming end
   
    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;
    clearBackpackCargoGlobal _object;

Its working partially. Here is part of the fnc_WepSG.sqf
Code:
if (_object isKindOf "AH6J_EP1") then {
                     _object removeWeapon "TwinM134";
                     _object removeWeapon "FFARLauncher_14";
                     _object removeWeapon "M134_2";
                     };
           
            if (_object isKindOf "AH6J_EP1") then {
                     _object addWeapon "TwinVickers";
                     _object addWeapon "MK19";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "48Rnd_40mm_MK19";
                     };

When I purchase a AH6J it spawns with the TwinM134s and Hydras. But as soon as the server restarts the weapons switch to the Vickers and Mk19.
 
server_publishvehicle2
Code:
    if(!_donotusekey) then {
        // Lock vehicle
        _object setvehiclelock "locked";
    };

            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end
  
    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;
    // _object setVehicleAmmo DZE_vehicleAmmo;

Its working partially. Here is part of the fnc_WepSG.sqf
Code:
if (_object isKindOf "AH6J_EP1") then {
                     _object removeWeapon "TwinM134";
                     _object removeWeapon "FFARLauncher_14";
                     _object removeWeapon "M134_2";
                     };
          
            if (_object isKindOf "AH6J_EP1") then {
                     _object addWeapon "TwinVickers";
                     _object addWeapon "MK19";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "48Rnd_40mm_MK19";
                     };

When I purchase a AH6J it spawns with the TwinM134s and Hydras. But as soon as the server restarts the weapons switch to the Vickers and Mk19.

That means we can left out the part that you installed it wrong and that you put it right in the server_monitor.sqf.
And we can ignore the publishvehicle3 because that is for the random spawn.

Maybe try something like:
Code:
if (_object isKindOf "AH6J_EP1") then {
                     _object removeWeapon "TwinM134";
                     _object removeWeapon "FFARLauncher_14";
                     _object removeWeapon "M134_2";
                     _object addWeapon "TwinVickers";
                     _object addWeapon "MK19";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "500Rnd_TwinVickers";
                     _object addMagazine "48Rnd_40mm_MK19";
                     };

If it still don't work and it isn't your only vehicle you are removing weapons try to but a } else { between them.
 
I was wondering if there would be a way to remove ammo from armed vehicles like the salvage menu for removing vehicle parts? It's kinda a bummer to either spend gold to buy ammo for them or spend time searching just to lose them at server restart. This way players could remove any leftover ammo saving it before restarts!
 
I was wondering if there would be a way to remove ammo from armed vehicles like the salvage menu for removing vehicle parts? It's kinda a bummer to either spend gold to buy ammo for them or spend time searching just to lose them at server restart. This way players could remove any leftover ammo saving it before restarts!
Possible maybe, go to it when i got the time.

@The_Phone_Guy
Try this (works for me)
if (_object isKindof "AH6J_EP1") then {
_object magazinesTurret [-1];
_object removeMagazinesTurret ["14Rnd_FFAR",[-1]];
_object removeMagazinesTurret ["4000Rnd_762x51_M134",[-1]];
_object WeaponsTurret [-1];
_object removeWeapon "FFARLauncher_14";
_object removeWeapon "TwinM134";
};


*edit* going to update the mainthread to this as soon as i got time.
 
Could you upload your script to other place. This mega.co is S**t
Just download it. You don't have to like it. You also don't need anything to download it or something.
And i were a little confused (before you edited you post) because megaupload was the precursor of mega.co.
 
Just download it. You don't have to like it. You also don't need anything to download it or something.
And i were a little confused (before you edited you post) because megaupload was the precursor of mega.co.
I can't download, because in every browser that i have it says that i have old version of browser lol. Yea about megaupload i mistake, i try to say mediafire :p
 
Hi.

I've try and made a little upgrade to your script ^^

Here is what i do for now in the fnc_remWepSG.sqf:

Code:
if (_object isKindof "BRDM2_HQ_Gue") then {
        // List all mag of the gunner seat
         _mag = _object magazinesTurret [0];
        // Give me an array like ["100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK"]

              diag_log ("TEST 1 with BRDM2_HQ_Gue: " + str(_mag));
             cpt = 0;
             //Here, iterate on _mags and remove the mag !
             {
                _object removeMagazinesTurret [_mag select cpt,[0]];        
                cpt = cpt + 1;
             } forEach _mag;
    };

And it's work great, on server start, and when i buy the vehicle =)

BTW, about the seats, -1 is driver seat, 0 is gunner seat, 0,0 is commander seat, 0,1 is loader seat

Edit : Weird thing, my RPT got spammed with 1319 lines of
Code:
 1:56:47 "TEST 1 with BRDM2_HQ_Gue: []"
for 1 vehicle oO
 
Last edited:
Hey i am using your script for Dayz Epoch Cherna 1.0.4.2
Since the 1.0.4 update i am confronted with a new problem.
I want to add a m240 vehicle to the an2_dz


Code:
if (_object isKindof "AN2_dZ") then {
_object addWeapon "M240_vehicle";
};

But the rpt. log shows a lot of these errors:

"dublicated weapons detected"

The removing works without any problems.
 
Hi.

I've try and made a little upgrade to your script ^^

Here is what i do for now in the fnc_remWepSG.sqf:

Code:
if (_object isKindof "BRDM2_HQ_Gue") then {
        // List all mag of the gunner seat
         _mag = _object magazinesTurret [0];
        // Give me an array like ["100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK"]

              diag_log ("TEST 1 with BRDM2_HQ_Gue: " + str(_mag));
             cpt = 0;
             //Here, iterate on _mags and remove the mag !
             {
                _object removeMagazinesTurret [_mag select cpt,[0]];      
                cpt = cpt + 1;
             } forEach _mag;
    };

And it's work great, on server start, and when i buy the vehicle =)

BTW, about the seats, -1 is driver seat, 0 is gunner seat, 0,0 is commander seat, 0,1 is loader seat

Edit : Weird thing, my RPT got spammed with 1319 lines of
Code:
 1:56:47 "TEST 1 with BRDM2_HQ_Gue: []"
for 1 vehicle oO


going to test it out myself, thanks man :)

---

Guy above this:
getting to it when i got time. thinking thursday or friday
 
so,.. trying to use your script to just empty the ammo out of some added vehicles in my server,... doesn't appear to be working, at all. Here are snips of the relevant info:
Code:
server_spawnEvents =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf";
//server_weather =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf";
fnc_plyrHit   =                    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";
//Fnc for removing weapon by SiothieGaming
fnc_remWepSG =                  compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_remWepSG.sqf";
server_deaths =                 compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";

Code:
};

            _object setVariable ["CharacterID", _ownerID, true];
           
            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end
           
            clearWeaponCargoGlobal  _object;
            clearMagazineCargoGlobal  _object;
            // _object setVehicleAmmo DZE_vehicleAmmo;
           
            _object setdir _dir;

Code:
            _retry = 100;
};
   
            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end

    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;

Code:
// add items from previous vehicle here
    _weapons =         getWeaponCargo _object;
    _magazines =     getMagazineCargo _object;
    _backpacks =     getBackpackCargo _object;

            //Remove Weapon by SiothieGaming start
            call fnc_remWepSG;
            //Remove Weapon by SiothieGaming end
   
    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;
    clearBackpackCargoGlobal _object;

and here is the main sqf:

Code:
    //Remove Weapon SiothieGaming german Youtubechannel: http://www.youtube.com/user/SiothieGaming
    //Lines underneath are just a small tutorial
    // the Number in the Bracket is Important, -1  means Pilot seat
    //Try getting up with these numbers when you want to remove from another seat (e.g. gunner, front gunner, rear gunner etc. pp)
    // For every seat you have to do something like i did         
    //_object magazinesTurret [-1];
    //_object removeMagazinesTurret ["14Rnd_FFAR",[-1]]; If you want to remove something from another seat at the same time you need to do something like this:
    // _object magazinesTurret [1];
    //_object removeMagazinesTurret ["14Rnd_FFAR",[1]]; I'm not completly sure now which number is which seat. I only know that -1 is pilot seat.
{
    if (_object isKindof "UH1H_TK_EP1") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[0]];
         _object magazinesTurret [1];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[1]];
    };
   
    if (_object isKindof "MH60S") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[0]];
         _object magazinesTurret [1];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[1]];
    };
   
    if (_object isKindof "BAF_Jackal2_GMG_w") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["200Rnd_762x51_M240",[0]];
         _object magazinesTurret [1];
         _object removeMagazinesTurret ["48Rnd_40mm_MK19",[1]];
    };
   
    if (_object isKindof "BAF_Jackal2_L2A1_w") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["200Rnd_762x51_M240",[0]];
         _object magazinesTurret [1];
         _object removeMagazinesTurret ["100Rnd_127x99_M2",[1]];
    };
   
    if (_object isKindof "pook_H13_transport") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["pook_250Rnd_762x51",[0]];
    };
   
    if (_object isKindof "HMMWV_Armored") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[0]];
    };
   
    if (_object isKindof "M240Nest_DZ") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_762x51_M240",[0]];
    };
   
    if (_object isKindof "M2StaticMG_US_EP1") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_127x99_M2",[0]];
    };
   
    if (_object isKindof "DSHKM_TK_INS_EP1") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["50Rnd_127x107_DSHKM",[0]];
    };
   
    if (_object isKindof "UAZ_AGS30_TK_EP1") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["29Rnd_30mm_AGS30",[0]];
    };
   
    if (_object isKindof "BRDM2_HQ_Gue") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["100Rnd_762x54_PK",[0]];
    };
   
    if (_object isKindof "BTR40_MG_TK_INS_EP1") then {
         _object magazinesTurret [0];
         _object removeMagazinesTurret ["50Rnd_127x107_DSHKM",[0]];
    };
   
    //THIS IS STILL IN TESTING PHASE, IT COULD SCREW UP YOUR WHOLE SERVER
    //Just put the Classname of the Vehicle there and it should disable thear vision.
    // For example my server runs fine with it (Epoch Panthera) but a friend of mine screwed up his whole database
    //if (_object isKindof "AH64D") then {
    //     _object disableTIEquipment true;
    //};
    //TESTING STUFF END
} forEach vehicles; //Not completly necessary, it just makes sure no vehicle is left out during the process (e.g. high server load)



Any thoughts on why it would not be working?
 
Back
Top