Okay - I'm having some trouble getting this to work.
I've made a addaction to the medics init linie calling a sqs file.
MakeMedicten.sqs:
tent = createVehicle MASH... bla bla..
My problem lies within deleting the MASH again.
Could anyone please write a working code which checks nearest building, checks if building is a MASH if it's a MASH or even the same MASH that the Medic has just setup, the Medic should get an action to delete/destroy it. It needs to be MP compatible.
I tried to get it to work for 4 hours last night, and it sort of did, but not every time.
Please help me with it.
Thank you so much in advange
----------------------------------------------------------------------------------------
THE SCRIPT.
----------------------------------------------------------------------------------------
setupmash.sqf
_unit = _this select 0;
_id = _this select 2;
_unit removeAction _id;
_unit playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 1;
_mash = createVehicle ["MASH",[0,0,0], [], 0, "NONE"];
_mash setDir ((direction _unit) -180);
_mash setdammage 0.8;
sleep 1;
_mash setPos (_unit modelToWorld [0,6,((position _unit) select 2)]);
_mash setdammage 0.5;
_unit playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 2;
_mash setdammage 0.2;
sleep 2;
_mash setdammage 0;
sleep 2;
_unit addAction ["Dismantle MASH","takedownmash.sqf",_mash,1,false];
takedownmash.sqf
if (!local server) exitWith {true};
_unit = _this select 0;
_id = _this select 2;
_mash = _this select 3;
_unit removeAction _id;
_unit playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 1;
_mash setdammage 0.2;
sleep 2;
_mash setdammage 0.5;
_unit playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 2;
_mash setdammage 0.8;
sleep 2;
_mash setdammage 1;
sleep 2;
deleteVehicle _mash;
sleep 2;
_unit addAction ["Deploy MASH", "setupmash.sqf","",1,false];
INIT line og My medic:
this addAction ["Deploy MASH", "setupmash.sqf","",1,false]