Jump to content
  • 0

Custom vehicles - removing ammo same as new patch.


GingerNinja

Question

hey guys,

on my server i'm running a few extra vehicles like the BTR-40 "BTR40_MG_TK_GUE_EP1"...
Is there a way to have its ammo removed the same as all the other standard vehicles in epoch?
I cant just let people still have this vehicle if its going to spawn in with ammo every restart, and i kind of dont want to just remove the vehicle.

there has to be some sort of simple script i can use to reset ammo / spawn vehicles with out ammo...

Cheers,
Ginger

Link to comment
Share on other sites

Recommended Posts

  • 0

... ay of course you have to add them... What dou you think was it going to do? Autodetect every non epoch and removed the things you want?

 

 

and you also have to get your weapon/ammo classnames for the things you want to remove and also the seat. it's not esay to use but it's working like a charm.

 

I'm using both of these scripts as one is good for removing ammo with little drama and the other is nice for adding differnt guns to stuff or removing them all together.

 

You really come off like a smug asshole in the 2 posts you've made by the way.

Link to comment
Share on other sites

  • 0

Excuse my rude expressions, dont get me wrong i dont have anything against questions. I just hate questions which are more or less oblivious. Everyday ppl join our teamspeak and ask questions which are so esay (and i mean it like this) even someone who dont know anything about arma 2 scripting but scripting in general would be able to solve it. I think such ppl shouldn't have an dayz server. 

 

I mean look at the script. Even without any scripting language knowlegde you would be able to tell that you have to add something here for making it work the way you want it.

Link to comment
Share on other sites

  • 0

J3T - you obviously do not understand or appreicate the idea of open forums.  This is EXCATLY the place to post such questions.  I looked many ways for the answer to this question.  Google is only as good as your search.  If you are not quite sure what you are searching for, you many not come to the solution/answer/topic/forum/chat that you are looking for.  For example, the link you provided NEVER came up in a search. 

 

Now, as you  say, don't get me wrong.  Appreciate your direction and help, but like Loading said up there, you do come off like a prick.  Take away the attitude and your posts would not just be helpful and informative, but people will appreciate it more.

 

BTW - you may get more friends being a little less smug, too ;-)

 

Cheers,

Link to comment
Share on other sites

  • 0

The method mentioned in this thread, is still working for us on our server. For both vehicles spawned at the trader and vehicles spawned by the server/after restarts etc.

 

I needed to add the lines to both server_monitor.sqf and the server_publishVehicle2. Works fine for us on 1.0.5.1.

Link to comment
Share on other sites

  • 0

Hi 

 

i started my onw overpoch server for 3 months ago 

 

and i am looking for a guy that i can hire and knows alot about coding and scripting and custom maps

i will pay the guy with co-owner on my server forever

 

(i dont know if i uploaded this the right place)

Link to comment
Share on other sites

  • 0

OK, had a chance to test it, it appears the above solution does work - removes all ammo from all guns on a vehicle.

 

EDIT: Oops, as someone gracefully reminded me - we also need to strip ammo from dynamically spawned vehicles:

 

 

Firstly, in your mission file, lets create an array of vehicles we want to strip ammo from - this way we can always just edit the mission file if we decide to add new armed vehicles. Inside init.sqf, simply add a new variable called "DZE_StripAmmo" near the others at the top of the file, e.g. here is what I have (not the full file, just the custom variables):

dayz_fullMoonNights = true;
DZE_BuildingLimit = 500;
DZE_StripAmmo = ["BAF_Jackal2_L2A1_D", "HMMWV_MK19", "HMMWV_Armored", "HMMWV_M2", "BRDM2_HQ_Gue", "BTR40_MG_TK_INS_EP1"];

You may add any armed vehicle to this array, to have it's weapons stripped of ammo.

 

 

 

Secondly, you want to edit the dayz_server code (extract the pbo), and jump into dayz_server/init/server_functions.sqf, and around line 260 we have the following:

_veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];

Update this, to include the ammo removal:

_veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];
if(_vehicle in DZE_StripAmmo) then { _veh setVehicleAmmo 0 }; 
Done, save the file.
 

 

 

And finally, you want to edit the server monitor which is in dayz_server/system/server_monitor.sqf - open up the file and jump down to around line 130, we have:

_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];

Update this to also include the ammo removal:

_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
if(_type in DZE_StripAmmo) then { _object setVehicleAmmo 0 };

Save the file, repack your server pbo, and your mission file if you choose to pack it - and give it a run!

 

You can find the class names for vehicles from A2 AND A2:OA here:

http://community.bistudio.com/wiki/ArmA_2:_Vehicles

http://community.bistudio.com/wiki/ArmA_2_OA:_Vehicles

Used this method yet some vehicles still have ammo on some guns, for example the "BAF_Jackal2_L2A1_W" has ammo on the 50 cal and the "UH1Y" has ammo on the right door gun but none of the others and no rockets, can't work out why, anyone else had this issue?

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...