I'm have trouble trying to fix a problem that I'm encountering when I am using this helicast script below. Armed Assualt states that I am missing a ";" somewhere near Line 70 of the code listed below. But everything around it and near it has a ";" after each line. This error occurs once I have use the Action menu command "Deploy Boat." Any help would be greatly appreciated, Thanks in advance!
// Script can be run on several helicopters at the same time, as well as dealing with actions internally.
// Put: nil=[this,0,0,"Init"] execVM "bboat.sqf"; in each chopper line, or from other script by changing
// "this" to the chopper name. Remember to modify the following line to fit the helicopter array:
if (isNil "HULK_BoatCarriers") then {HULK_BoatCarriers = [bird,bird2,bird3];};
_bird = _this select 0;
_user = _this select 1;
_id = _this select 2;
_mode = _this select 3;
scopeName "Root";
// Public code section:
call compile format
['
HULK_BoatCarrier_%1 = [];
"HULK_BoatCarrier_%1" addPublicVariableEventHandler
{
_arr = _this select 1;
_c = _arr select 0;
switch (_c) do
{
case 0 :
{
_p = _arr select 1;
_p sideChat "Deploying the zodiac now!";
};
default {hint "Error in Boat script: Unexpected value in EH";};
};
};
', _bird];
// End public section
switch (_mode) do
{
case "Init" :
{
// running on all clients
scopeName "Init";
_act = 0;
_set = 0;
_r = 10; //variable sleep depending on if there is a pilot and whether the action is available - independant on all choppers
while {alive _bird} do
{
scopeName "loop01";
_posh = getPos _bird select 2;
if (isNull (driver _bird)) then {_r = 15;} else {_r = 2;};
if ( (_posh > 2 && _posh < 20) && (damage _bird < 0.5) && (_bird in HULK_BoatCarriers) && (local (driver _bird)) ) then
{
if (_set == 0) then
{
_act = _bird addAction ["Deploy boat", "bboat.sqf","Drop", 100, false, false, ""];
_set = 1;
};
_r = 0.2;
} else
{
if (_set == 1) then
{
_bird removeAction _act;
_set = 0;
_act = 0;
};
};
sleep _r;
};
};
case "Drop" :
{
// running on client using action added in Init section
scopeName "Drop";
call compile format
['
%1_CRRC = createVehicle ["Zodiac",%1 modelToWorld [0,0,-.2],[],0,""];
%2 sideChat "Deploying the zodiac now!";
HULK_BoatCarriers = HULK_BoatCarriers - [%1];
publicVariable "HULK_BoatCarriers";
//trigger public EH:
HULK_BoatCarrier_%1 = [0,%2];
publicVariable "HULK_BoatCarrier_%1";
', _bird, _user];
};
case "Add" :
{
// placeholder for way of adding boat back to heli
};
default {hint "Error in boat script: wrong parameter given";};
};