FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
createvehicle command in MP (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: createvehicle command in MP
#1051
Speeder (Admin)
Admin
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
createvehicle command in MP 3 Years, 5 Months ago Karma: 3  
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]
 
Report to moderator   Logged Logged  
  The topic has been locked.
      Topics Author Date
  Topic is locked thread link
createvehicle command in MP
Speeder 2007/04/05 22:49
Go to top Post Reply
Powered by FireBoardFireBoardget the latest posts directly to your desktop