BEAKSBY 11 Posted May 15, 2014 When I test on LAN the joining player can create the tank, but when it calls the paradroptank function the parachute does not deploy like it is supposed to. It only deploys for the player hosting the game. This is the init.sqf that preloads a player addAction command to execute the ArmorDrop.sqf that then calls the the KK_fnc_paraDropTank at the top of the init. Createcenter EAST; Createcenter WEST; WEST setFriend [EAST,0]; EAST setFriend [WEST,0]; [west, "WEST1"] call BIS_fnc_addRespawnInventory; [west, "WEST2"] call BIS_fnc_addRespawnInventory; [west, "WEST3"] call BIS_fnc_addRespawnInventory; [east, "EAST1"] call BIS_fnc_addRespawnInventory; [east, "EAST2"] call BIS_fnc_addRespawnInventory; [east, "EAST3"] call BIS_fnc_addRespawnInventory; if (sector1 getVariable 'owner' == WEST) then {[west, "sector1"] call BIS_fnc_addRespawnPosition}; // [west, "Sector2"] call BIS_fnc_addRespawnPosition; [west,[1685,5640,50]] call BIS_fnc_addRespawnPosition; // [getPos player, WEST, 5] call BIS_fnc_spawnGroup; // To use the script you need to spawn a tank 150m or more above the ground and pass tank object reference to the script. // For example (should be executed on the server side): if (!isDedicated) then { KK_fnc_FX = { private "_veh"; _veh = _this select 0; _vel = _this select 1; for "_i" from 1 to 100 do { drop [ ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48], "", "Billboard", 0, 1 + random 0.5, [0, -2, 1.5], [-20 + random 40, -20 + random 40, -15 + _vel], 1, 0.05, 0.04, 0, [0.5, 10 + random 20], [ [0,0,0,1], [0,0,0,0.3], [1,1,1,0.1], [1,1,1,0.03], [1,1,1,0.01], [1,1,1,0.003], [1,1,1,0.001], [1,1,1,0] ], [1], 0.1, 0.1, "", "", _veh, random 360, true, 0.1 ]; }; }; "#FX" addPublicVariableEventHandler {_this select 1 spawn KK_fnc_FX}; }; if (isServer) then { KK_fnc_paraDropTank = { private ["_class","_para","_paras","_p","_veh","_vel","_time"]; _class = format [ "%1_parachute_02_F", toString [(toArray faction _this) select 0] ]; _para = createVehicle [_class, [0,0,0], [], 0, "FLY"]; _para setDir getDir _this; _para setPos getPos _this; _paras = [_para]; _this attachTo [_para, [0,2,0]]; _para setVectorUp [0,0,1]; { _p = createVehicle [_class, [0,0,0], [], 0, "FLY"]; _paras set [count _paras, _p]; _p attachTo [_para, [0,0,0]]; _p setVectorUp _x; } count [ [0.5,0.4,0.6],[-0.5,0.4,0.6],[0.5,-0.4,0.6],[-0.5,-0.4,0.6] ]; 0 = [_this, _paras] spawn { _veh = _this select 0; waitUntil {getPos _veh select 2 < 4}; _vel = velocity _veh; detach _veh; _veh setVelocity _vel; missionNamespace setVariable ["#FX", [_veh, _vel select 2]]; publicVariable "#FX"; playSound3D [ "a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _veh ]; { detach _x; _x disableCollisionWith _veh; } count (_this select 1); _time = time + 5; waitUntil {time > _time}; { if (!isNull _x) then {deleteVehicle _x}; } count (_this select 1); }; }; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// waitUntil {!isNull player}; //////////////////////////////////////////////////// If (side player == WEST) then {// for west units player addAction ["<t color='#FF0000'>M2A4 Slammer UP $1200</t>", "ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and vehicle _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"] ; player addEventHandler ["RESPAWN", { player addAction ["<t color='#FF0000'>M2A4 Slammer UP $1200</t>", "ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and vehicle _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"]; }]; } else {// change this for east units player addAction ["<t color='#FF0000'>T-100 Varsuk $1200</t>", "O_ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and vehicle _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"] ; player addEventHandler ["RESPAWN", { player addAction ["<t color='#FF0000'>T-100 Varsuk $1200</t>", "O_ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and vehicle _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"]; }]; }; This is the ArmorDrop.sqf that calls on the KK_fnc_paraDropTank from the top of the init.sqf: _tank = "B_MBT_01_TUSK_F" createVehicle [0,0,0]; _tank setDir random 360; _pos = screenToWorld [0.5,0.5];// land position if (!isnull cursortarget) then { _pos = getpos cursortarget};// building / object position //Drop smoke & Chemlight & Flare _smoke = "SmokeShellGreen" createVehicle [(_pos select 0), (_pos select 1), 0]; _chemlight = "Chemlight_green" createVehicle [(_pos select 0), (_pos select 1), 0]; _flare = "FlareGreen_F" createVehicle [(_pos select 0), (_pos select 1), 0]; _tank setPos [(_pos select 0), (_pos select 1), 150]; _tank call KK_fnc_paraDropTank; hint format["Incoming Armor at %1",(position _pos)]; // Delete smoke and light waitUntil {getPos _tank select 2 < 5}; deleteVehicle _smoke; deleteVehicle _chemlight; deleteVehicle _flare; Or is something wrong with the order? Should I be including all this in the init.sqf too or create separate .sqf scripts? These addActions will be called frequently in the MP game. Share this post Link to post Share on other sites