second_coming Posted April 15, 2015 Report Share Posted April 15, 2015 I am looking at adding RHS Escaltion to my Epoch server and am planning on adding only unarmed vehicles (except for the CH-47 Chinook which has 2 miniguns).I am looking at using the following script to remove ammo from random spawning vehicles:if(isServer) then { waitUntil {!isNil "EPOCH_StorageSlotsCount"}; { _veh = _x; if ((typeOf _x) == "rhs_ch_47f" || (typeOf _x) == "rhs_ch_47f_light") then { _x removeWeaponTurret ["rhs_weap_m134_minigun_1",[-1]]; _x removeWeaponTurret ["rhs_weap_m134_minigun_2",[-1]]; _x removeMagazine "5000rnd_762x51_belt"; _x setVehicleAmmo 0; _x setVehicleAmmoDef 0; }; } forEach (vehicles); }; This won't work for vehicles bought from traders though.What is the best way to trigger a script to remove the ammo when a player enters the gunners position? Link to comment Share on other sites More sharing options...
0 Darth_Rogue Posted April 15, 2015 Report Share Posted April 15, 2015 What I would try to do is just add a check right before that above 'if' code to do a check if a player does a "moveInturret" function. Armed vehicles are the only ones with "turrets", so that should work. second_coming 1 Link to comment Share on other sites More sharing options...
0 second_coming Posted April 15, 2015 Author Report Share Posted April 15, 2015 What I would try to do is just add a check right before that above 'if' code to do a check if a player does a "moveInturret" function. Armed vehicles are the only ones with "turrets", so that should work.good idea Batman :) Darth_Rogue 1 Link to comment Share on other sites More sharing options...
0 DirtySanchez Posted April 15, 2015 Report Share Posted April 15, 2015 Or try what we use for auto insert earplugs Link to comment Share on other sites More sharing options...
0 second_coming Posted April 22, 2015 Author Report Share Posted April 22, 2015 As I have it set up so players can buy and sell armed helis they find randomly spawned I needed to have it so the script didn't just run at server restart (selling an disarmed heli to a trader and buying it back again rearms it). I ended up using this, called from onPlayerRespawn.sqf: waitUntil {alive vehicle player}; waitUntil {typeOF player != "VirtualMan_EPOCH"}; while {true} do { if(vehicle player isKindOf "Air") then { // Delete Weapons from Armed Helicopters the player is in _vehicles = vehicle player; // UH-80 Ghost Hawk _vehicles removeWeaponTurret ["LMG_Minigun_Transport",[1]]; _vehicles removeWeaponTurret ["LMG_Minigun_Transport2",[2]]; // CH-47 Chinook & UH-60M Blackhawk _vehicles removeWeaponTurret ["rhs_weap_m134_minigun_1",[0]]; _vehicles removeWeaponTurret ["rhs_weap_m134_minigun_2",[1]]; // AH-99 Blackfoot _vehicles removeWeaponTurret ["gatling_20mm",[0]]; _vehicles removeWeaponTurret ["missiles_DAGR",[0]]; _vehicles removeWeaponTurret ["missiles_ASRAAM",[0]]; }; uiSleep 1; }; psychosis 1 Link to comment Share on other sites More sharing options...
Question
second_coming
I am looking at adding RHS Escaltion to my Epoch server and am planning on adding only unarmed vehicles (except for the CH-47 Chinook which has 2 miniguns).
I am looking at using the following script to remove ammo from random spawning vehicles:
This won't work for vehicles bought from traders though.What is the best way to trigger a script to remove the ammo when a player enters the gunners position?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now