The general idea is to have a medic unit being able to "build" a MASH in Multiplayer.
However, as this is my first attemt to create in MP I'm having some difficulties.
As the script is now, it runs, but only the one playing the medic can see the MASH getting build. It seems like the createvehicle command isn't passed over the network.
I've been messing around witht hes for some days now, and I'd appreciate some help in finishing the script.
As said I'm a bit of a novice in making scripts run on server/local machines, so please explain it well to me, or even better, ajust and repost my code so that it may work.
I'd really appreciate the help.
setupmash.sqf
| Code: |
_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 2;
_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
| Code: |
_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];
|
medics INIT line:
| Code: |
this addAction ["Deploy MASH","setupmash.sqf","",1,false]
|