Jump to content

Recommended Posts

B2 Weapon Restriction Script NEW!

no_bullshit.jpg

Tired of diver-sniper-antitank-Rambos ruining your server realistic gameplay? Here's simple solution.

This script allows to restrict weapons to certain soldier classes.

It also restricts 2 levels down the classtree, so you don't have to add all the scope variants to the list.

Be careful with the classnames, they are case sensitive.

Works with units and weapons added with mods.

Example (put in mission's init.sqf):

0 = [["B_soldier_AT_F","B_soldier_LAT_F"],["launch_NLAW_F","launch_RPG32_F","launch_Titan_base","launch_Titan_short_base"]] execVM "scripts\b2_restrictions.sqf";
0 = [["B_recon_M_F","B_sniper_F"],["srifle_GM6_F","srifle_LRR_F"]] execVM "scripts\b2_restrictions.sqf";
0 = [["B_recon_M_F","B_recon_JTAC_F","B_soldier_M_F","B_sniper_F"],["srifle_EBR_F","arifle_MXM_F"]] execVM "scripts\b2_restrictions.sqf";
0 = [["B_soldier_AR_F"],["LMG_Mk200_F","LMG_Zafir_F"]] execVM "scripts\b2_restrictions.sqf";
0 = [["B_diver_TL_F","B_diver_F"],["arifle_SDAR_F"]] execVM "scripts\b2_restrictions.sqf";

This restrict ATs, sniper and marksman rifles, LMGs and underwater weapons to respective classes.

scripts\b2_restrictions.sqf

///////////////////////////////////////////////////////////////////////////////////////////////////
//  B2 Weapon Restriction Script v1.01                                                           //
//  Execute from mission init.sqf                                                                //
//  [classesArray,weaponsArray] execVM "scripts\b2_restrictions.sqf";                            //
//  0 = [["B_recon_M_F"],["srifle_GM6_F","srifle_LRR_F"]] execVM "scripts\b2_restrictions.sqf";  //
///////////////////////////////////////////////////////////////////////////////////////////////////

if (isDedicated) exitWith {};

private ["_r_class","_r_weap","_p_weap","_p_weap_base","_p_weap_base2","_p_weap_name","_s_weap","_s_weap_base","_s_weap_base2","_s_weap_name"];

while {true} do
{
 sleep 1;
 _r_class = _this select 0;
 _r_weap = _this select 1;

 _p_weap = primaryWeapon player;
 _p_weap_base = configName(inheritsFrom (configFile >> "CfgWeapons" >> _p_weap));
 _p_weap_base2 = configName(inheritsFrom (configFile >> "CfgWeapons" >> _p_weap_base));
 _p_weap_name = getText(configFile >> "CfgWeapons" >>_p_weap >> "displayName");

 _s_weap = secondaryWeapon player;
 _s_weap_base = configName(inheritsFrom (configFile >> "CfgWeapons" >> _s_weap));
 _s_weap_base2 = configName(inheritsFrom (configFile >> "CfgWeapons" >> _s_weap_base));
 _s_weap_name = getText(configFile >> "CfgWeapons" >>_s_weap >> "displayName");

 if (((_p_weap in _r_weap) || (_p_weap_base in _r_weap) || (_p_weap_base2 in _r_weap)) && !(typeOf player in _r_class))
 then {
   player removeWeapon _p_weap;
   hint format ["RESTRICTED WEAPON\n\nYou are not qualified\nto use %1",_p_weap_name];
 };

 if (((_s_weap in _r_weap) || (_s_weap_base in _r_weap) || (_s_weap_base2 in _r_weap)) && !(typeOf player in _r_class))
 then {
   player removeWeapon _s_weap;
   hint format ["RESTRICTED WEAPON\n\nYou are not qualified\nto use %1",_s_weap_name];
 };
} forEach allUnits;


B2 Check Pilot and Check Gunner Scripts

03.jpg

Made this two scritps for my missions, by combining them you can easily control vehicle restrictions.

CheckPilot works for any actual drivers/pilots/copilots in any vehicle, CheckGunner - for any gunners.

Example (put in mission's init.sqf):

["Helicopter","B_Helipilot_F"] execVM "scripts\b2_checkPilot.sqf";
["Heli_Attack_01_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";
["Heli_Attack_02_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";

This allows only Bluefor pilots to fly all helicopters and man gunner positions in Attack helis, but also won't restrict anyone from using turrets in Transport helis (I don't think you need 2 years in flight school to handle minigun). Same way it can be used for any other vehicles.

scripts\b2_checkPilot.sqf

///////////////////////////////////////////////////////////////////////////////////////////////////
//  B2 Check Pilot Script v1.07                                                                  //
//  Execute from mission init.sqf                                                                //
//  [class,vehicleType] execVM "scripts\b2_checkPilot.sqf";                                      //
//  ["Helicopter","B_Helipilot_F"] execVM "scripts\b2_checkPilot.sqf";                           //
//  ["Wheeled_APC_F","B_Crew_F"] execVM "scripts\b2_checkPilot.sqf";                             //
///////////////////////////////////////////////////////////////////////////////////////////////////

if (isDedicated) exitWith {};

private ["_vehType","_crewType","_crewTypeName","_veh","_seats"];

while {(true)} do {
 _vehType = _this select 0;
 _crewType = _this select 1;
 _crewTypeName = getText(configFile >> "CfgVehicles" >> _crewType >> "displayName");
 if (typeOf player != _crewType) then {

   waitUntil {vehicle player != player};
   _veh = vehicle player;

   if (_veh isKindOf _vehType && !(_veh isKindOf "ParachuteBase")) then {
     _seats = [driver _veh];
     if (_veh isKindOf "Helicopter") then {_seats = _seats + [_veh turretUnit [0]];};
       if (player in _seats) then {
         player action ["GetOut",_veh];
         waitUntil {vehicle player == player};
         hint format ["RESTRICTED VEHICLE\n\nRequired class: %1",_crewTypeName];
         if (isEngineOn _veh) then {_veh engineOn false};
       };
   };
 };
};

scripts\b2_checkGunner.sqf

///////////////////////////////////////////////////////////////////////////////////////////////////
//  B2 Check Gunner Script v1.07                                                                 //
//  Execute from mission init.sqf                                                                //
//  [class,vehicleType] execVM "scripts\b2_checkGunner.sqf";                                     //
//  ["Heli_Attack_01_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";               //
//  ["Wheeled_APC_F","B_Crew_F"] execVM "scripts\b2_checkGunner.sqf";                            //
///////////////////////////////////////////////////////////////////////////////////////////////////

if (isDedicated) exitWith {};

private ["_vehType","_crewType","_crewTypeName","_veh","_seats"];

while {(true)} do {
 _vehType = _this select 0;
 _crewType = _this select 1;
 _crewTypeName = getText(configFile >> "CfgVehicles" >> _crewType >> "displayName");
 if (typeOf player != _crewType) then {
   waitUntil {vehicle player != player};
   _veh = vehicle player;
   if (_veh isKindof _vehType && !(_veh isKindOf "ParachuteBase")) then {
     _seats = [gunner _veh];
     if (_veh isKindOf "Tank") then {_seats = _seats + [_veh turretUnit [0]]; };
     if (_veh isKindOf "Heli_Transport_01_base_F") then {_seats = _seats + [_veh turretUnit [2]];};
       if (player in _seats) then {
       player action ["GetOut",_veh];
       waitUntil {vehicle player == player};
       hint format ["RESTRICTED VEHICLE\n\nRequired class: %1",_crewTypeName];
     };
   };
 };
};


B2 Keep Gunner Script

Redone script from scratch with completely different principle.

Now it spawns co-pilot and gunners in designated number of turrets.

Useful, if you don't like seeing Transport helicopters flying defenceless just because nobody wants to sit by the minigun whole time.

Don't use for playable slots - players won't be able to leave the turret.

Execute from any vehicle init:

0 = [vehicle,crewSide(opt),crewNum(opt),crewInit(opt)] execVM "scripts\b2_keepGunner.sqf";

0 = [this] execVM "scripts\b2_keepGunner.sqf"; - will spawn 1 bluefor crewman,

crewSide: west (default), east, independent

crewNum: 1 (default), 2, 3 (default for Ghosthawks)

crewInit: init string for each crew member, default - empty

scripts\b2_keepGunner.sqf

///////////////////////////////////////////////////////////////////////////////////////////////////
//  B2 Keep Gunner Script v1.06                                                                  //
//  Exec from any vehicle init:                                                                  //
//  0 = [vehicle,crewSide(opt),crewNum(opt),crewInit(opt)] execVM "scripts\b2_keepGunner.sqf";   //
//    crewSide: west (default), east, independent                                                //
//    crewNum: 1 (default), 2, 3 (default for Ghosthawks)                                        //
//    crewInit: init string for each crew member, default - empty                                //
//  0 = [this,west,3] execVM "scripts\b2_keepGunner.sqf";                                        //
///////////////////////////////////////////////////////////////////////////////////////////////////

if (!isServer) exitWith {};

private ["_veh","_crewSide","_crewNum","_crewInit","_crewType","_crewHelm","_crewGrp","_crew"];

_veh = _this select 0;
_crewSide = if (count _this > 1) then {_this select 1;} else {west};
_crewNum = if (count _this > 2) then {_this select 2;} else {
 if (_veh isKindOf "Heli_Transport_01_base_F") then {3} else {1};
};
_crewInit = if (count _this > 3) then {_this select 3;} else {""};
///////////////////////////////////////////////////////////////////////////////

//Selecting type
if (_veh isKindOf "Helicopter") then {
 switch (_crewSide) do {
   case west: {_crewType = "B_Helipilot_F"; _crewHelm = "H_CrewHelmetHeli_B";};
   case east: {_crewType = "O_Helipilot_F"; _crewHelm = "H_CrewHelmetHeli_O";};
   case independent: {_crewType = "I_Helipilot_F"; _crewHelm = "H_CrewHelmetHeli_I";};  
 };
} else {
 switch (_crewSide) do {
   case west: {_crewType = "B_Crew_F";};
   case east: {_crewType = "O_Crew_F";};
   case independent: {_crewType = "I_Crew_F";};
 };
};

///////////////////////////////////////////////////////////////////////////////

//Spawning crew
_crewGrp = createGroup _crewSide;
for "_i" from 1 to _crewNum do {
_crewType createUnit [getPos _veh,_crewGrp,_crewInit];
_crew = (units _crewGrp);
};

//Adding helmets
sleep 0.1;
if (_veh isKindOf "Helicopter") then {
 {_x addHeadgear _crewHelm;} forEach _crew;
};

//Starting cycle
while {alive _veh} do {
 for "_i" from 0 to (_crewNum-1) do {
   {
     _x moveInTurret [_veh,[_i]];
     _x lock true;
     //[_x] joinSilent (driver _veh);
     //if (isNull (driver _veh)) then {[_x] joinSilent _crewGrp};
   } forEach _crew;
 };
 sleep 1;
};

//Clearing group, deleting bodies
deleteGroup _crewGrp;
{deleteVehicle _x} forEach _crew;


B2 Heli Door Script

05.jpg

Another simple script, that automatically opens GhostHawk doors while it's altitude is less then 8m and speed is less then 45 km/h.

Works pretty much same way as the landing gears.

To maintain door functionality after respawn - see example mission - Simple Vehicle Respawn Script works like a charm.

Inspired by Heli Door Open Script by Delta 1 Actual

http://www.armaholic.com/page.php?id=21969

CH-49 and Mi-48 support by DJPorterNZ

scripts\b2_heliDoor.sqf

////////////////////////////////////////////////////////////////////////////////
//  B2 Heli Door Script v1.06                                                 //
//  Execute from any compatible Helicopter init field:                        //
//  0 = [this] execVM "scripts\b2_heliDoors.sqf";                             //
//                                                                            //
//  Credits:                                                                  //
//    Delta 1 Actual for his Heli Door Open Script                            //
//    DJPorterNZ for CH-49 and Mi-48 fix                                      //
//                                                                            //
//  Compatible Aircraft:                                                      //
//    UH-80 Ghost Hawk                                                        //
//    CH-49 Mohawk                                                            //
//    Mi-48 Kajman                                                            //
////////////////////////////////////////////////////////////////////////////////

if (!isServer) exitWith {};

private ["_veh","_alt","_speed"];

_veh = _this select 0;

switch (typeof _veh) do {
// UH-80 Ghost Hawk
case "B_Heli_Transport_01_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
// UH-80 Ghost Hawk (Camo)
case "B_Heli_Transport_01_camo_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
 // CH-49 Mohawk
 case "I_Heli_Transport_02_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_back_R',1]; 
       _veh animateDoor ['door_back_L',1];
       _veh animate ['CargoRamp_Open',1];
     } else {
       _veh animateDoor ['door_back_R',0]; 
       _veh animateDoor ['door_back_L',0];
       _veh animate ['CargoRamp_Open',0];
     };
   };
 };
 // Mi-48 Kajman
 case "O_Heli_Attack_02_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
 // Mi-48 Kajman (Black)
 case "O_Heli_Attack_02_black_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
};


B2 PMC Offroad and ATV Script NEW!

Simple script that turns any civillian offroad into PMC offroad: white, with push bar, roll bar and some backpacks attached to sides.

For ATV it simply makes it black.

Put this into any civillian offroad or any ATV init:

0 = [this] execVM "scripts\b2_pmcVeh.sqf";

scripts\b2_pmcVeh.sqf

///////////////////////////////////////////////////////////////////////////////////////////////////
//  B2 PMC Offroad and ATV Script v1.01                                                          //
//  Put in civilian offroad init                                                                 //
//  0 = [this] execVM "scripts\b2_pmcVeh.sqf";                                                   //
///////////////////////////////////////////////////////////////////////////////////////////////////

if (!isServer) exitWith {};

private ["_veh"];

_veh = _this select 0;

if (_veh isKindOf "Offroad_01_base_F") then {
 _veh = _this select 0;
 _veh animate ["HideConstruction", 0];
 _veh animate ["HideBackpacks", 0];
 _veh animate ["HideBumper1", 1];
 _veh animate ["HideBumper2", 0];
 _veh animate ["HideDoor1", 0];
 _veh animate ["HideDoor2", 0];
 _veh animate ["HideDoor3", 0];
 _veh animate ["HideGlass1", 1];
 _veh animate ["HideGlass2", 1];

 //_veh setObjectTexture [0, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE01_CO.paa"]; //Sand
 //_veh setObjectTexture [1, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE01_CO.paa"]; //Sand
 _veh setObjectTexture [0, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE02_CO.paa"]; //White
 _veh setObjectTexture [1, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE02_CO.paa"]; //White
 //_veh setObjectTexture [0, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_ti_ca.paa"]; //Black
 //_veh setObjectTexture [1, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_ti_ca.paa"]; //Black
};

if (_veh isKindOf "Quadbike_01_base_F") then {
 _veh setObjectTexture [0, "A3\Soft_F_Beta\Quadbike_01\Data\Quadbike_01_CIV_BLACK_CO.paa"];
 _veh setObjectTexture [1, "A3\Soft_F_Beta\Quadbike_01\Data\Quadbike_01_wheel_CIVBLACK_CO.paa"];
};


B2 Loadout Script NEW!

arma3%25202013-09-05%252001-05-19-115.jpg

arma3%25202013-09-05%252001-05-57-905.jpg

Ok, here's the big one.

This script simply gives preset loadout to any unit.

It could be BLUEFOR medic carrying GREENFOR LMG and OPFOR uniform, or OPFOR soldier in PG Services clothes carrying RH Mk18.

It consist of two major parts:

First, "Armies", where you can set types of weapons and gear used by each particular army.

Second, "Loadouts", which sets weapon, camo, backpack and amount of ammunition that will be carried by each class of any army.

Current version works with this addons:

NATO SF and Russian Spetsnaz Weapons

UK Special Forces

PG Services - Private Military Company

Addons support works this way:

Server should have same addons as players to have proper ammo in vehicles and boxes - default ammo will be loaded otherwise.

If player connects with supported mods, he will have mod stuff loaded.

If player connects with no mods, he will have preset loadout with BIS weapons. He won't see modded weapons or camo, but at least he won't be kicked straight away as if placed units or ammobox from mod in editor.

Execute from unit's init:

0 = [unit,class,army,silencers] execVM "scripts\b2_loadouts.sqf";

0 = [this,"grenadier","uksf",1] execVM "scripts\b2_loadouts.sqf"; - UKSF grenadier's loadout with silenced weapon

0 = [this,"medic","pmc"] execVM "scripts\b2_loadouts.sqf"; - PMC medic's loadout

0 = [this,"officer"] execVM "scripts\b2_loadouts.sqf"; - default army officer's loadout

0 = [this] execVM "scripts\b2_loadouts.sqf"; - default army/default loadout (soldier without backpack)

Currently there are one default-"oops-something-gone-wrong" army and two example armies:

"uksf" - United Kingdom Special Forces (supports massi's NATO Weapons and UK SFTG)

"pmc" - Private Military Contractors (supports massi's NATO Weapons and PG Services)

Classes:

"officer"

"grenadier"

"eod"

"lmg_gunner"

"marksman"

"rifleman_at"

"medic"

"sniper"

"spotter"

"pilot"

"crewman"

"diver"

"hunter" - for vehicles

Feel free to adjust "armies", individual loadouts and implemented mods to your particular unit's needs.

scripts\b2_loadouts.sqf


B2 Interactive Whiteboard Script WIP!

arma3%25202013-08-07%252017-10-44-476.jpg02.jpg

Well, name says it all. See example mission, to find out how it works.

It's based on this script from A2: http://www.armaholic.com/page.php?id=15289

[X] in trigger exec field ( 0 = [X] execVM "intel\init.sqf"; ) controls board rotation.

0 means board will be facing south, while 90 - facing east.

It still has couple unsolved issues: only first player who joins the server able to control the Whiteboard, placing and rotation could be simplified, board flickering while loading next texture, lightsource not visible to other players etc.


SAMPLE MISSION 1 (LOADOUTS, WEAPONS RESTRICTIONS AND PMC OFFROADS)

>DOWNLOAD<

SAMPLE MISSION 2 (OTHER SCRIPTS)

>DOWNLOAD<

Edited by Bl2ck Dog
  • Like 1

Share this post


Link to post
Share on other sites
Guest

Thanks for informing us about the release :cool:

Release frontpaged on the Armaholic homepage.

===================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Heli Door script works and looks great but is lost after Heli respawn.

Is there a way to rectify this?

Share this post


Link to post
Share on other sites
Heli Door script works and looks great but is lost after Heli respawn.

Is there a way to rectify this?

My bad. Should be fixed now.

Share this post


Link to post
Share on other sites
My bad. Should be fixed now.

Thanks mate.

I've just been looking through the script to try and see what you changed and to my inexperienced eyes it still looks the same LOL?

Now I'm starting to wonder if I haven't set this up right.

I am only using the heli door script so reference the script below I haven't included any of this in my description.ext.

Should I be using the code below in the code box?

// JIP Check (This code should be placed first line of init.sqf file)
if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};
if (!isDedicated) then {waitUntil {!isNull player && isPlayer player};};

{_x setvariable ["BIS_noCoreConversations", true, true]} foreach allunits;
enableSaving [false, false];
[] execVM "ca\Modules\MP\data\scripts\MPFramework.sqf";

Also this code below. Will that improve the graphics quality at distance?

setViewDistance 2000;
setTerrainGrid 50;

0 =["Helicopter","B_Helipilot_F"] execVM "scripts\b2_checkPilot.sqf";

0 =["Heli_Attack_01_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";

0 =["Heli_Attack_02_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";

0 =["Tank","B_Crew_F"] execVM "scripts\b2_checkPilot.sqf";

0 = ["Tank","B_Crew_F"] execVM "scripts\b2_checkGunner.sqf";

0 = ["Wheeled_APC_F","B_Crew_F"] execVM "scripts\b2_checkPilot.sqf";

Share this post


Link to post
Share on other sites

Well, the only change is:

was

while {(alive _heli)} do {

became

while {(true)} do {

This makes script to run continuously, without checking is heli still alive or not.


// JIP Check (This code should be placed first line of init.sqf file)
if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};
if (!isDedicated) then {waitUntil {!isNull player && isPlayer player};};
{_x setvariable ["BIS_noCoreConversations", true, true]} foreach allunits;
enableSaving [false, false];

That's not really needed, just part of "standard stuff" for my missions, disables AI chatter and saving.


[] execVM "ca\Modules\MP\data\scripts\MPFramework.sqf";

This one (along with CA folder) is only needed if you use Interactive Whiteboard script.


setViewDistance 2000;
setTerrainGrid 50;

That simply sets default viewdistance and grass setting for MP (in SP it overridden by configuration settings).

In this case: 2000m and grass is disabled.


0 =["Helicopter","B_Helipilot_F"] execVM "scripts\b2_checkPilot.sqf";
0 =["Heli_Attack_01_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";
0 =["Heli_Attack_02_base_F","B_Helipilot_F"] execVM "scripts\b2_checkGunner.sqf";
0 =["Tank","B_Crew_F"] execVM "scripts\b2_checkPilot.sqf";
0 = ["Tank","B_Crew_F"] execVM "scripts\b2_checkGunner.sqf";
0 = ["Wheeled_APC_F","B_Crew_F"] execVM "scripts\b2_checkPilot.sqf"; 

That's examples of CheckPilot and CheckGunner scripts usage, don't need these if not using those scripts.

Share this post


Link to post
Share on other sites

Couldn't ask for a clearer more concise answer that :)

Just as a quick heads up. The script I was looking at I downloaded from armaholics this evening and it doesn't reflect the change. I didn't look at the one above so apologies for that.

Thanks mate and thanks for the script. I think it adds a really nice touch to the ghosthawkes that adds to the emersive game play.

Edited by ToM666

Share this post


Link to post
Share on other sites

ToM666, check latest sample mission (bottom of the first post) - there's example how to keep those doors operational after respawn.

Also, redone Keep Gunner Script from scratch with completele different principle.

Edited by Bl2ck Dog

Share this post


Link to post
Share on other sites

hey buddy,

looks great and thanks for crediting me :)

your check pilot/gunner script sort of reminds me of domination :)

and adds that extra bit of realism,

very nice work

Share this post


Link to post
Share on other sites

A brilliant set of scripts there. Really like the interactive whiteboard.

Had a quick play with the heli door script to see what/how it was doing it's magic, and got out my big hammer and adapted it to also handle the other helos with doors. Code is probably not optimised as much as it could be, but feel free to use it or adapt it as you see fit.

////////////////////////////////////////////////////////////////////////////////
//  Simple Heli Door Script v1.03                                             //
//  Execute from any compatible Helicopter init field:                        //
//  0 = [this] execVM "scripts\b2_heliDoors.sqf";                             //
//                                                                            //
//  Inspired by Heli Door Open Script by Delta 1 Actual                       //
//  http://www.armaholic.com/page.php?id=21969                                //
//                                                                            //
//  Compatible Aircraft                                                       //
//  UH-80 Ghost Hawk                                                          //
//  CH-49 Mohawk                                                              //
//  Mi-48 Kajman                                                              //
////////////////////////////////////////////////////////////////////////////////

private ["_veh","_alt","_speed"];

_veh = _this select 0;

if (!isServer) exitWith {};

switch (typeof _veh) do {
// UH-80 Ghost Hawk
case "B_Heli_Transport_01_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
// UH-80 Ghost Hawk (Camo)
case "B_Heli_Transport_01_camo_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
 // CH-49 Mohawk
 case "I_Heli_Transport_02_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_back_R',1]; 
       _veh animateDoor ['door_back_L',1];
       _veh animate ['CargoRamp_Open',1];
     } else {
       _veh animateDoor ['door_back_R',0]; 
       _veh animateDoor ['door_back_L',0];
       _veh animate ['CargoRamp_Open',0];
     };
   };
 };
 // Mi-48 Kajman
 case "O_Heli_Attack_02_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
 // Mi-48 Kajman (Black)
 case "O_Heli_Attack_02_black_F": {
   while {alive _veh} do {
     sleep 0.5;
     _alt = getPos _veh select 2;
     _speed = (sqrt ((velocity _veh select 0)^2 + (velocity _veh select 1)^2 + (velocity _veh select 2)^2));
     if ((_alt < 8) && (_speed < 12)) then {
       _veh animateDoor ['door_R',1]; 
       _veh animateDoor ['door_L',1];
     } else {
       _veh animateDoor ['door_R',0]; 
       _veh animateDoor ['door_L',0];
     };
   };
 };
};

Edited by DJPorterNZ

Share this post


Link to post
Share on other sites

Hi Bl2ck Dog!

since i am new to ArmA 3 and the scripting or implementing of scripts, i am in need of some direction, on how to make your Class Restriction script work. I did copy your example as you wrote in the missions init.sqf but were should i put the rest of the php code? When i follow the downloadlink i only get a pbo for stratis. Is this needed to be put into my arma root or on the server or in the missionfolder?

Would be great if you or someone else could help to enlighten me, so i can learn more and get it running.

Share this post


Link to post
Share on other sites

Hey, lads. Sorry for late reply.

DJPorterNZ, thanks for your support, appreciate the work you've done!

Jazzman, mate, check updated sample missions, I've made .rar archives that could be viewed in editor. Simply unpack them into folders at Documents\Arma 3\missions.

Also, check new Weapon Restriction and Loadout Scripts!

Share this post


Link to post
Share on other sites

Nice set of scripts. Thankyou. Possible to add heli door as an little addon instead of a script please?

Share this post


Link to post
Share on other sites

At the moment have no idea how to do that, but I'll look into it.

Share this post


Link to post
Share on other sites

Great set of scripts; however, I am having an issue with the vehicle restrictions.

When I am a rifleman then switch classes, to a crewman, I still cannot crew a tank or apc. Is this because even though I switched classes the server remembers me as something else, or is the scripts caching this somehow?

Thanks,

Share this post


Link to post
Share on other sites

Hey Bl2ck Dog maybe you could help me out. I am trying to use your script to take away the ability for people to use Thermal optics. I am using your script in conjunction with Tonics Virtual Ammo System. I have removed the scopes that I don't want players to use from the VAS but unfortunately due to the nature of Tonics script a player can spawn in gear from a saved loadout. How would I go about using your script to stop anyone on my server from having these specific scopes?

Thanks in advance!

Share this post


Link to post
Share on other sites

You can limit what players can spawn in from within VAS itself I believe, even if they have a saved profile with something.

Share this post


Link to post
Share on other sites
You can limit what players can spawn in from within VAS itself I believe, even if they have a saved profile with something.

Hmm, I didn't think it worked that way. When I was setting up the VAS i remember reading a line that gave me the impression that saved loadouts would override what is actually available from the VAS

//If limiting weapons its probably best to set this to true so people aren't loading custom loadouts with restricted gear.

Share this post


Link to post
Share on other sites
Tnx for reply, kbone1341. I've made fixed version, which shouldn't have this problem.

Here's link for sample mission https://dl.dropboxusercontent.com/u/14037059/b2_scripts.Stratis.rar

Hey Bl2ck Dog, thanks so much for your scripts!

I'm currently using the vehicle restrictor of the above file and I still only get it to work as long as I spawn as a pilot. Once I spawn as rifleman and switch to an AI helipilot I can't fly the helicopter.

Any idea how to fix the issue?

Edited by Surfer

Share this post


Link to post
Share on other sites

someone can help me with the Restriction Script? is that I want restrict a UAV Backpack, but i don't know how to do.

Share this post


Link to post
Share on other sites
someone can help me with the Restriction Script? is that I want restrict a UAV Backpack, but i don't know how to do.

His restriction script won't help you, as it's for weapons:

This script allows to restrict weapons to certain soldier classes.

And I would venture to say this thread is dead as well, the author hasn't posted here in over a year.

Edited by JShock

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×