// client_v.sqf
if (isServer) exitWith {};
for [{_i=0},{_i<1},{_i=_i+1}] do
{
dcv_deployed = Var1;
dcv_tent_ac = Var2;
dcv_un_tent_ac = Var3;
Sleep 1;
};
// dcv_client_actions.sqf
dcv_deployed = false;
dcv_tent_ac = 0;
dcv_un_tent_ac = 0;
while {alive player} do
{
if (vehicle player == player) then
{
if (dcv_deployed) then
{
if (dcv_un_tent_ac == 0) then
{
un_dep = Truck1 addAction ["Un-Deploy Tent", "DCV\C_M113\dcv_tent.sqf", [1]];
dcv_un_tent_ac = 1;
};
}
else
{
if (dcv_tent_ac == 0) then
{
tent_ac = Truck1 addAction ["Deploy Tent", "DCV\C_M113\dcv_tent.sqf", [0]];
dcv_tent_ac = 1;
};
};
}
else
{
Truck1 removeAction tent_ac;
Truck1 removeAction un_dep;
dcv_tent_ac = 0;
dcv_un_tent_ac = 0;
};
Sleep 0.5;
};
waitUntil {alive player};
[] execVM "DCV\C_M113\dcv_client_actions.sqf";
// dcv_tent.sqf
_case = ((_this select 3) select 0);
_vehicle = _this select 0;
_user = _this select 1;
if (vehicle _user != _user) exitWith {};
_wait = 20;
switch (_case) do
{
CASE 0:
{
dcv_action = [_vehicle, true];
publicVariable "dcv_action";
_vehicle lock TRUE;
_pos = _vehicle modeltoWorld [0,-8.5,0];
_vehicle removeAction (_this select 2);
dcv_deployed = true;
dcv_tent_ac = 0;
publicVariable "dcv_deployed";
publicVariable "dcv_tent_ac";
_user switchMove "AinvPknlMstpSlayWrflDnon_medic";
dcv_public_playMove = [_user];
publicVariable "dcv_public_playMove";
_tent = "CampEast" createVehicle (_pos);
_tent setPos [(getPos _tent select 0), (getPos _tent select 1), (getPos _tent select 2)-1.5];
for [{_i=0}, {_i < _wait}, {_i=_i+1}] do
{
if (animationState player == "AinvPknlMstpSlayWrflDnon_medic") then
{
}
else
{
player switchmove "AinvPknlMstpSlayWrflDnon_medic";
dcv_public_playMove = [_user];
publicVariable "dcv_public_playMove";
_tent setPos [(getPos _tent select 0),(getPos _tent select 1),(getPos _tent select 2)+0.5];
};
Sleep 1;
};
_tent setPos [(getPos _tent select 0),(getPos _tent select 1),(getPos _tent select 2)+0.03];
dcv_action = [_vehicle, false];
publicVariable "dcv_action";
_vehicle lock FALSE;
};
CASE 1:
{
dcv_action = [_vehicle, true];
publicVariable "dcv_action";
_vehicle lock TRUE;
player switchmove "AinvPknlMstpSlayWrflDnon_medic";
dcv_public_playMove = [_user];
publicVariable "dcv_public_playMove";
_tent = nearestObject [(_this select 0), "CampEast"];
Sleep 5;
deleteVehicle _tent;
(_this select 0) removeAction (_this select 2);
dcv_deployed = false;
dcv_un_tent_ac = 0;
publicVariable "dcv_deployed";
publicVariable "dcv_un_tent_ac";
dcv_action = [_vehicle, false];
publicVariable "dcv_action";
_vehicle lock FALSE;
};
};
// server_v.sqf
if (!isServer) exitWith {};
for [{_i=0},{_i < 1},{_i=_i}] do
{
Var1 = dcv_deployed;
Var2 = dcv_tent_ac;
Var3 = dcv_un_tent_ac;
publicVariable "Var1";
publicVariable "Var2";
publicVariable "Var3";
Sleep 1;
};
So far DaChevs has made this. What it does it simulate a command tent being deployed out of the back of a M113. In order to deploy this, you must be outside of the vehicle. A few problems though.
Once the vehicle deploys the tent, the vehicle needs to lock. This should stop any problems with removing other tents. Next, the tent should deploy -8.5 back if deployed from an M113 or -8 back if deployed from a BMP. The last thing I would like to see is tables with radios pop up as well as a map board. Later on, i can add actions to this like BLUFOR tacker as well as ordering menus.
DaChevs said he needed some help at this point. So if anyone could help that would be great.
Edit:
Oh I forgot the steps to deploy the tent need to be the same to un-deploy the tent. Right now the tent disappears after one "medic" animation.