Jump to content
Sign in to follow this  
frezinator

How to make USMC pilots unarmed and not allowed to go to ammo crates and trucks????

Recommended Posts

I need a script that can make my pilots unarmed and they are not allowed to go to ammo crates and ammunition trucks.

can you tell me what to put in int.sqf and what new sqf file I need to make to be able make this happen?

Share this post


Link to post
Share on other sites

This should work. It's to use with a USMC pilot. You'll have to change the pilots class name to the correct one if you use any other pilot, or extend the condition for other pilot types.

init.sqf

_handle=[]execVM "pilots_loop.sqf";

pilots_loop.sqf


Sleep .005;

While {True} do 

{

     {

        If (_x IsKindOf "USMC_Soldier_Pilot") Then 

                      {
                       RemoveAllWeapons _x;
                      }


     } ForEach AllUnits;

Sleep 1;

};

They can still go to ammo boxes and trucks. But, the loop should keep removing the weapons from the pilot, in the case he should grab one.

OR


ICE_PILOTS = 

{

     {

        If (_x IsKindOf "USMC_Soldier_Pilot") Then 

                      {
                       RemoveAllWeapons _x;
                      }


     } ForEach AllUnits;

};

Sleep .005;

While {True} do 

  {

        _handle = [] Spawn ICE_PILOTS;  
        Sleep 1;

  };

Edited by Iceman77

Share this post


Link to post
Share on other sites
This should work. It's to use with a USMC pilot. You'll have to change the pilots class name to the correct one if you use any other pilot, or extend the condition for other pilot types.

init.sqf

_handle=[]execVM "pilots_loop.sqf";

pilots_loop.sqf


Sleep .005;

While {True} do 

{

     {

        If (_x IsKindOf "USMC_Soldier_Pilot") Then 

                      {
                       RemoveAllWeapons _x;
                      }


     } ForEach AllUnits;

Sleep 1;

};

They can still go to ammo boxes and trucks. But, the loop should keep removing the weapons from the pilot, in the case he should grab one.

OR


ICE_PILOTS = 

{

     {

        If (_x IsKindOf "USMC_Soldier_Pilot") Then 

                      {
                       RemoveAllWeapons _x;
                      }


     } ForEach AllUnits;

};

Sleep .005;

While {True} do 

  {

        _handle = [] Spawn ICE_PILOTS;  
        Sleep 1;

  };

Thank you it worked!!! but one more thing do you know how to add a message or hint??? for example: "Pilots are not allowed to be armed"

how do you add that message to the pilot_loop.sqf???

Share this post


Link to post
Share on other sites

Not tested.

Sleep .005;

While {True} do 

 { 

        { 

            If (_x IsKindOf "USMC_Soldier_Pilot") Then

                      {                         
                           If ((PrimaryWeapon _x != "") || (SecondaryWeapon _x != "")) Then  

                                            {
                                              RemoveAllWeapons _x; 
                                              Hint "Pilots are not allowed to be armed";
                                            };


                      } 



        } ForEach AllUnits;  

   Sleep 1;  

};

Edited by Iceman77

Share this post


Link to post
Share on other sites
not tested.

sleep .005;

while {true} do 

 { 

        { 

            if (_x iskindof "usmc_soldier_pilot") then

                      {                         
                           if ((primaryweapon _x != "") || (secondaryweapon _x != "")) then  

                                            {
                                              removeallweapons _x; 
                                              hint "pilots aren't allowed to use weapons!!";
                                            };
                      } 



        } foreach allunits;  

   sleep 1;  

};

thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :)

Share this post


Link to post
Share on other sites

You're welcome. btw you can take sleep .005 out. I just put it there for giggles.

Also, the above code only will remove primary weapons & launchers (secondary weapons). If pilot having a pistol is a big deal, then use this.


//////////////////////
//WEAPON RESTRICTION//
/////BY: Iceman77/////
//////////////////////

Private "_Pistols";

// Put all pistol class_names here.
_Pistols = 

 [

   "M9",
   "glock17_EP1",
   "Colt1911",
   "M9SD",
   "Makarov",
   "MakarovSD",
   "revolver_EP1",
   "revolver_gold_EP1",
   "Sa61_EP1","UZI_EP1",
   "UZI_SD_EP1"

 ]; 

While {True} Do 

 { 


         { 

            If (_x IsKindOf "USMC_Soldier_Pilot") Then

                      {                         

                           If ((PrimaryWeapon _x != "") || (SecondaryWeapon _x != "") || ({_x In _Pistols} Count (Weapons _x)) != 0) Then  

                                       {

                                         RemoveAllWeapons _x; 
                                         Hint "Pilots aren't allowed to use weapons";

                                       };



                      } 



        } ForEach AllUnits;  

   Sleep 1;  

};

Edited by Iceman77

Share this post


Link to post
Share on other sites
You're welcome. btw you can take sleep .005 out. I just put it there for giggles.

Also, the above code only will remove primary weapons & launchers (secondary weapons). If pilot having a pistol is a big deal, then use this.


//////////////////////
//WEAPON RESTRICTION//
/////BY: Iceman77/////
//////////////////////

Private "_Pistols";

// Put all pistol class_names here.
_Pistols = 

 [

   "M9",
   "glock17_EP1",
   "Colt1911",
   "M9SD",
   "Makarov",
   "MakarovSD",
   "revolver_EP1",
   "revolver_gold_EP1",
   "Sa61_EP1","UZI_EP1",
   "UZI_SD_EP1"

 ]; 

While {True} do 

 { 


         { 

            If (_x IsKindOf "USMC_Soldier_Pilot") Then

                      {                         
                           If ((PrimaryWeapon _x != "") || (SecondaryWeapon _x != "") || ({_x In _Pistols} Count (Weapons _x)) != 0) Then  

                                            {
                                              RemoveAllWeapons _x; 
                                              Hint "Pilots aren't allowed to use weapons!!";
                                            };



                      } 



        } ForEach AllUnits;  

   Sleep 1;  

};

kk thank you!!!!!!!

Share this post


Link to post
Share on other sites

//////////////////////
//WEAPON RESTRICTION//
/////BY: Iceman77/////
//////////////////////

Private "_Pistols";

// Put all pistol class_names here.
_Pistols = 

 [

   "M9",
   "glock17_EP1",
   "Colt1911",
   "M9SD",
   "Makarov",
   "MakarovSD",
   "revolver_EP1",
   "revolver_gold_EP1",
   "Sa61_EP1","UZI_EP1",
   "UZI_SD_EP1"

 ]; 

While {True} Do 

 { 


         { 

            If (_x IsKindOf "USMC_Soldier_Pilot") Then

                      {                         

                           If ((PrimaryWeapon _x != "") || (SecondaryWeapon _x != "") || ({_x In _Pistols} Count (Weapons _x)) != 0) Then  

                                       {

                                         RemoveAllWeapons _x; 
                                         _x addWeapon "NVGoggles";
                                         Hint "Pilots aren't allowed to use weapons";

                                       };



                      } 



        } ForEach AllUnits;  

   Sleep 1;  

};

_x addWeapon "NVGoggles"; is the right code.

Share this post


Link to post
Share on other sites
//////////////////////
//WEAPON RESTRICTION//
/////BY: Iceman77/////
//////////////////////

Private "_Pistols";

// Put all pistol class_names here.
_Pistols = 

 [

   "M9",
   "glock17_EP1",
   "Colt1911",
   "M9SD",
   "Makarov",
   "MakarovSD",
   "revolver_EP1",
   "revolver_gold_EP1",
   "Sa61_EP1","UZI_EP1",
   "UZI_SD_EP1"

 ]; 

While {True} Do 

 { 


         { 

            If (_x IsKindOf "USMC_Soldier_Pilot") Then

                      {                         

                           If ((PrimaryWeapon _x != "") || (SecondaryWeapon _x != "") || ({_x In _Pistols} Count (Weapons _x)) != 0) Then  

                                       {

                                         RemoveAllWeapons _x; 
                                         _x addWeapon "NVGoggles";
                                         Hint "Pilots aren't allowed to use weapons";

                                       };



                      } 



        } ForEach AllUnits;  

   Sleep 1;  

};

_x addWeapon "NVGoggles"; is the right code.

Thank you so much!!!!

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
Sign in to follow this  

×