wjpenn 10 Posted July 25, 2009 Guys Ive been reading all day and put together a script from various sources to get this far. I have one problem though. I have Harriers (1 and 2 models), Cobras, and Blackhawks to Rearm/Refuel/Repair throughout the mission. Only problem is when i roll the vehicle over the trigger it arms the vehicle with every weapon from every vehicle in the script that it may reload at any given time! My script in my .sqs file is as follows..... _vehicle = _this select 0 _vehicle setfuel 0; _vehicle removemagazines "300Rnd_25mm_GAU12"; _vehicle removemagazines "6Rnd_mk82"; _vehicle removemagazines "2Rnd_Sidewinder_AH1Z"; _vehicle removemagazines "14Rnd_FFAR"; _vehicle removemagazines "6Rnd_GBU12_AV8B"; _vehicle removemagazines "750Rnd_M197_AH1"; _vehicle removemagazines "8Rnd_Hellfire"; _vehicle removemagazines "38Rnd_FFAR"; _vehicle removemagazines "2Rnd_Sidewinder_AH1Z"; _vehicle removemagazines "100Rnd_762x51_M240"; ~3 _vehicle addmagazine "300Rnd_25mm_GAU12"; ~3 _vehicle addmagazine "6Rnd_mk82"; ~3 _vehicle addmagazine "2Rnd_Sidewinder_AH1Z"; ~3 _vehicle addmagazine "14Rnd_FFAR"; ~3 _vehicle addmagazine "6Rnd_GBU12_AV8B"; ~3 _vehicle addmagazine "750Rnd_M197_AH1"; ~3 _vehicle addmagazine "8Rnd_Hellfire"; ~3 _vehicle addmagazine "38Rnd_FFAR"; ~3 _vehicle addmagazine "2Rnd_Sidewinder_AH1Z"; ~3 _vehicle addmagazine "100Rnd_762x51_M240"; ~3 _vehicle setdamage 0; ~3 _vehicle setfuel 1; ~3 How do i make the script recongnize what vehicle is what to load the correct ordinance only on the correct aircraft? Also can it be scripted that i have to sit completely still for 5 seconds in the trigger before it reloads any ordinance? If so may i get some guidance on how to do so. If you guys can point me in the right direction i would be very appreciative! Thanks Share this post Link to post Share on other sites
Ghost 39 Posted July 25, 2009 (edited) thats a complicated resupply. Do a search and you will find very simply yet effective scripts to resupply vehicles using setfuel, setvehicleammo, and setdamage commands. But if you want it to be a specific resupply script for a few name vehicles then you would need a switch case http://community.bistudio.com/wiki/SQS_to_SQF_conversion#Structured_conditional_command. before that structured command you will need to get the vehicle type, example: _aircraft = _this select 0; _type = typeof _aircraft; switch (_type) do { case "C130J": {_aircraft animate ["ramp_top", 1]; _aircraft animate ["ramp_bottom", 1]}; case "MV22": {_aircraft animate ["ramp_top", 1]; _aircraft animate ["ramp_bottom", 1]}; }; for the sit still part have something like this in beginning of script _unit = _this select 0; WaitUntil{_unit in list Rearmlist}; sleep 4; if(!(_unit in list Rearmlist)) exitWith {_unit vehiclechat "Repair Aborted"}; now the trigger that the vehicle has to drive in will be named rearmlist Edited July 25, 2009 by Ghost Share this post Link to post Share on other sites
--DST-- Anth 10 Posted July 29, 2009 Did you mange to do this or find one im trying to find a simple rearm/refuel/repair script on a trigger or go near a certain object on the map. Share this post Link to post Share on other sites