SaintZ

Script Help

7 posts in this topic

Hey guys, can anyone help me simplify this?

//SaintZ's Crate Spawner
private ["_crateClassName", "_pos", "_pos2", "_pos3", "_crate", "_NATO_Weapons", "_Wpncount"];
//Item Options
_NATO_Weapons = 1 //Set to 1 if you want nato weps
_Wpncount = 30 // Ammount of weapons you want to spawn
//Positions of the crates
_pos = (29.6336,217.241,1.2009)
//_pos2 = (19.6575,247.971,1)
//_pos3 = (94.902,234.794,1.9)
//Spawns crate above terrain level
_spawnATL = if ((count _this)>2) then {_this select 2} else {true};

_crate = createVehicle [Box_NATO_Support_F,_pos,[], 0, "CAN_COLLIDE"];

_crate setDir (random 360);

 

if (_spawnATL) then
{
 _crate setPosATL _pos;
}
else
{
 _crate setPosASL _pos;
};

_crate allowDamage false;

clearWeaponCargoGlobal   _crate;
clearItemCargoGlobal   _crate;
clearMagazineCargoGlobal  _crate;
clearBackpackCargoGlobal  _crate;

_crate;
//Lets add items to the crate
//NATO Weapons
_NATO_Weapon_Array = [];
if (_NATO_Weapons == 1) then {
 _cfgWeapons = configFile >> "CfgWeapons";
 
 for "_i" from 0 to (count _cfgWeapons)-1 do
 {
  _cur_cfg = _cfgWeapons select _i;
  
  if (isClass _cur_cfg) then
  {
   _classname = configName _cur_cfg;
   _cur_cfg_type = getNumber(_cur_cfg >> "type");
   _picture = getText(_cur_cfg >> "picture");
   private ["_base"];
   if (_Base_Weapons == 1) then {
    _base = (configName (configFile >> "CfgWeapons" >> _classname >> "LinkedItems")) == "";
   }
   else
   {
    _base = true;
   };
   if (_cur_cfg_type in [1,2] && _picture != "" && !(_classname in _NATO_Weapon_Array) && ((["MX", _classname] call BIS_fnc_inString) || (["EBR", _classname] call BIS_fnc_inString) || (["LRR", _classname] call BIS_fnc_inString) || (["P07", _classname] call BIS_fnc_inString) || (["SMG_01", _classname] call BIS_fnc_inString) || (["Pistol_heavy_01", _classname] call BIS_fnc_inString)) && (_base)) then {
    if (_Debug == 1) then {if (_Debug == 1) then {diag_log format["Classname: %1 - Type: %2 - Pic: %3 - Cfg Dir: %4",_classname,_cur_cfg_type,_picture,_cur_cfg];};};
    _NATO_Weapon_Array set[count _NATO_Weapon_Array, _classname];
   };
  };
 };
 {
  _crate addItemCargoGlobal [_x, _Wpncount];
 } foreach _NATO_Weapon_Array;
};

Share this post


Link to post
Share on other sites

What do you mean by simplify? As in make it a shorter code or make it easier to understand what's going on in the script? What are you wanting to do with this code...

Share this post


Link to post
Share on other sites
Advertisement

That was not me that posted that. Trying to figure out who the heck was able to use my account and why they would use it for something as idiotic as this. Sorry guys.....weirdness

Share this post


Link to post
Share on other sites

That was not me that posted that. Trying to figure out who the heck was able to use my account and why they would use it for something as idiotic as this. Sorry guys.....weirdness

Sounds like it's time for a new complex password xD

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.