Monkeynutz

Remove certain ammo from vehicles.

13 posts in this topic

The script is self explanatory. 
Ammo is removed and so are the weapons when you get in the vehicle, so when you buy it from trader, you don't even notice.

The Readme on GITHUB explains all. 

Thanks to those who helped:

@wombdilator for helping me with the jets configs.

and @eraser1 for the help with Event handler configs earlier on this year!

and @MGTDB for his work on this and @kuplion for the pointers!

 

Link: https://github.com/GamingAtDeathsDoor/Remove-Vehicle-Ammo

Edited by GamingAtDeathsDoor
2 people like this

Share this post


Link to post
Share on other sites

You'll probably find its better to do this when the vehicle is spawned, instead of EVERY TIME someone gets into it..

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

@MGTDB Interesting... and this would only apply to vehicles bought at traders or spawned in as persistent vehicles? Or does it work for non-persistent too?

I'm thinking of mission vehicles here ;) 

Thanks for the suggestion to both of you! Really appreciate it because i wanted the removal of weapons on here as i couldn't find one shared before :) 

 

Will definitely change this around a bit :) 

Share this post


Link to post
Share on other sites
59 minutes ago, GamingAtDeathsDoor said:

@MGTDB Interesting... and this would only apply to vehicles bought at traders or spawned in as persistent vehicles? Or does it work for non-persistent too?

I'm thinking of mission vehicles here ;) 

Thanks for the suggestion to both of you! Really appreciate it because i wanted the removal of weapons on here as i couldn't find one shared before :) 

 

Will definitely change this around a bit :) 

It works for everything. :)

1 person likes this

Share this post


Link to post
Share on other sites
1 hour ago, GamingAtDeathsDoor said:

@MGTDB Interesting... and this would only apply to vehicles bought at traders or spawned in as persistent vehicles? Or does it work for non-persistent too?

I'm thinking of mission vehicles here ;) 

Thanks for the suggestion to both of you! Really appreciate it because i wanted the removal of weapons on here as i couldn't find one shared before :) 

 

Will definitely change this around a bit :) 

Works for all vehicles in Exile, also works for DMS as it calls careful create vehicle as the spawner

1 person likes this

Share this post


Link to post
Share on other sites

@kuplion @MGTDB
Thanks guys! I just looked at the CreatePersistentVehicle and the CreateNonPersistentVehicle in the Exile code and saw it call to this file :P 

Already implimented! 
You mind if I update the GitHub repo and make the necessary commendations to you guys? I want this to be available for all ;) 

1 person likes this

Share this post


Link to post
Share on other sites
13 hours ago, GamingAtDeathsDoor said:

You mind if I update the GitHub repo and make the necessary commendations to you guys? I want this to be available for all ;) 

Be my guest buddy

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

Im not looking to clear the ammo from vehicles just cargo in the vehicles 
I removed all the remove turret ammo and night vision from this file .. does this look ok ? will it work as I have it edited ?
Im using infistars  new XM8 app, has spawn bike and cart ,, I changed it to rhs mud buggy atv .. it spawns with gear in it .. trying to just remove the gear

Spoiler

/**
 * ExileServer_object_vehicle_carefulCreateVehicle
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

private["_vehicleClassName", "_position", "_direction", "_usePositionATL", "_temporaryPositionInOuterSpace", "_vehicleObject"];
_vehicleClassName = _this select 0;
_position = _this select 1;
_direction = _this select 2;
_usePositionATL = _this select 3;
_temporaryPositionInOuterSpace = 
[
    (_position select 0) - 250 + (random 500),
    (_position select 1) - 250 + (random 500),
    1000 + (random 1000)
];
_vehicleObject = createVehicle [_vehicleClassName, _temporaryPositionInOuterSpace, [], 0, "CAN_COLLIDE"];
_vehicleObject allowDamage false;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject addEventHandler["HandleDamage", {false}];
_vehicleObject setVelocity [0, 0, 0];
if ((typeName _direction) isEqualTo "ARRAY") then 
{
    _vehicleObject setVectorDirAndUp _direction;
}
else 
{
    _vehicleObject setDir _direction;
};
if (_usePositionATL) then
{
    _vehicleObject setPosATL _position;
}
else 
{
    _vehicleObject setPosASL _position;
};
_vehicleObject setVelocity [0, 0, 0];
_vehicleObject allowDamage true;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject setDamage 0;
clearBackpackCargoGlobal _vehicleObject;
clearItemCargoGlobal _vehicleObject;
clearMagazineCargoGlobal _vehicleObject;
clearWeaponCargoGlobal _vehicleObject;
_vehicleObject

 

Edited by Chainsaw Squirrel

Share this post


Link to post
Share on other sites

@MGTDB this makes the  AH-99 Blackfoot spawn with no rockets, but it doesn't alter the gun or add the ammo, is there something wrong with the code? When you get in the vehicle the Hud selection for the weapon shows two names super imposed on each other. Any Ideas?

Spoiler

if(_vehicleClassName == "B_Heli_Attack_01_F") then
{
    _vehicleObject removeWeaponTurret  ["gatling_20mm",[0]];
    _vehicleObject removeWeaponTurret  ["missiles_DAGR",[0]];
    _vehicleObject removeWeaponTurret  ["missiles_ASRAAM",[0]];
    _vehicleObject addWeaponTurret     ["M134_minigun",[0]];
    _vehicleObject addWeaponTurret     ["M134_minigun",[-1]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[0]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[0]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[0]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[0]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[0]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[-1]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[-1]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[-1]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[-1]];
    _vehicleObject addMagazineTurret   ["2000Rnd_762x51_Belt",[-1]];
};

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.