Supply drop

User avatar
Tuntematon
Posts: 2291
Joined: 19 May 2015, 15:29
Location: Valkeakoski
Contact:

Re: Supply drop

Post by Tuntematon »

en testannut. [+] Spoiler

Code: Select all

/*
      ::: ::: :::             ::: :::             :::
     :+: :+:   :+:           :+:   :+:           :+:
    +:+ +:+     +:+         +:+     +:+         +:+
   +#+ +#+       +#+       +#+       +#+       +#+
  +#+ +#+         +#+     +#+         +#+     +#+
 #+# #+#           #+#   #+#           #+#   #+#
### ###             ### ###             ### ###

 Helicopter ammo box drop script (aw_drop.sqf) was written by Jester [AW] of AhoyWorld.co.uk
 You may add or alter this code to your liking as long as you leave the authors name in place.
 set _reloadtime = 30 to however many seconds you want before it is available to use again.
 place "this addAction ["<t color='#0000f6'>Ammo Drop</t>", "aw_drop.sqf",[1],0,false,true,""," driver  _target == _this"];" in the helicopter/plane init field.
 change the loadouts to the crate to your likings.
*/

private ["_heli", "_reloadtime"];

      // lets set some local variables
      _heli = _this select 0;
    _chuteType = "B_Parachute_02_F";   //parachute for blufor, for opfor and greenfor replace the 'B' with 'O' or 'G' respectively
    _crateType =  "rhs_tigr_sts_msv";   //ammocrate class for blufor, feel free to change to whichever box you desire
    _smokeType =  "";  //smoke shell color you want to use
    _lightType =  "";  //chemlightcolor you want used
    _reloadtime = 9999;  // time before next ammo drop is available to use
    _minheight = 0;  // the height you have to be before you can actually drop the crate
    _HQ = [West,"HQ"];  // do not touch this!
    _toLow = format
       [
       "<t align='center'><t size='2.2' color='#ed3b00'>TOO LOW ALTITUDE</t><br/><t size='1.2' color='#9ef680'>You need to be above</t><br/><t size='1.5' color='#ed3b00'>%1 meters</t><br/><t size='1.2' color='#9ef680'>in order to drop an ammo crate.</t></t>",
          _minheight
       ];  //text to display when not high enough to drop

        if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};
        // Wait until player is initialized
   if (!isDedicated) then
   {
      waitUntil {!isNull player && isPlayer player};
   };

   // meat and potatoes
   if (player getVariable ["AW_ammoDrop",false]) exitWith {hint "Ammo drop is not currently available"};
   if ((getPos player) select 2 < _minheight) exitWith {hint parseText _toLow};
   if ((getPos player) select 2 > _minheight) then
   {
      player setVariable["AW_ammoDrop", true];

      _chute = createVehicle [_chuteType, [100, 100, 100], [], 0, 'FLY'];
      _chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, 50];
      _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];
      _crate attachTo [_chute, [0, 0, -1.3]];
      _crate allowdamage false;
      _light = createVehicle [_lightType, position _chute, [], 0, 'NONE'];
      _light attachTo [_chute, [0, 0, 0]];

      // clear crate - leaves medkits in place. add clearItemCargoGlobal _crate; to remove medkits
      clearWeaponCargoGlobal _crate;
      clearMagazineCargoGlobal _crate;
      clearItemCargoGlobal _crate;
      // fill crate with our junk
      _crate addWeaponCargoGlobal ["rhs_weap_rpg26",2];
      _crate addWeaponCargoGlobal ["rhs_weap_rshg2",2];
      _crate addMagazineCargoGlobal ["rhs_mag_rgn",10];
      _crate addMagazineCargoGlobal ["rhs_100Rnd_762x54mmR",10];
      _crate addMagazineCargoGlobal ["rhs_30Rnd_545x39_7N10_AK",20];
      _crate addMagazineCargoGlobal ["rhs_mag_rdg2_white",5];
      _crate addMagazineCargoGlobal ["rhs_rpg7_PG7VL_mag",1];
      _crate addMagazineCargoGlobal ["rhs_rpg7_PG7VL_mag",1];
      _crate addMagazineCargoGlobal ["rhs_rpg7_OG7V_mag",1];
      _crate addMagazineCargoGlobal ["rhs_VOG25",5];
      _crate addMagazineCargoGlobal ["rhs_GRD40_White",5];
      _crate addItemCargoGlobal ["ACE_DefusalKit", 2];
      _crate addItemCargoGlobal ["ACE_Bodybag", 5];
      _crate addItemCargoGlobal ["ACE_fieldDressing", 20];
      _crate addItemCargoGlobal ["ACE_Morphine", 10];
      _crate addItemCargoGlobal ["SmokeShell", 10];
      _crate addItemCargoGlobal ["SmokeShellRed", 10];
      _crate addItemCargoGlobal ["SmokeShellGreen", 10];
      _crate addItemCargoGlobal ["ACE_wirecutter",3];
      _crate setVariable ["AFI_vehicle_gear","east",true];

      //hint format ["ammo crate dropped, Next one will be ready in: %1 seconds",_reloadtime];
      waitUntil {position _crate select 2 < 1 || isNull _chute};
      detach _crate;
      _crate setPos [position _crate select 0, position _crate select 1, 0];
      _smoke = _smokeType createVehicle [getPos _crate select 0, getPos _crate select 1,5];

      // time to reload a new ammo crate
      sleep _reloadtime;

      // we are back in action
      //vehicle player vehicleChat "";
      player setVariable["AW_ammoDrop", false];
   };
Periaatteessa tuo on vähän turha scripti jos tarkoitus on vain käyttää kerran per pelaaja.
User avatar
zpeed
Posts: 108
Joined: 10 Feb 2015, 20:08
Location: Kuopio

Re: Supply drop

Post by zpeed »

Ahteri wrote:Siellä on kaksi publicvariablea, vaihda niitä kahdessa muussa awdrop scriptissä.
Jees, toi skulas. Thanks, voitte nauttia yhden huurteisen altaan ääressä.
Tuntematon wrote:
en testannut. [+] Spoiler

Code: Select all

/*
      ::: ::: :::             ::: :::             :::
     :+: :+:   :+:           :+:   :+:           :+:
    +:+ +:+     +:+         +:+     +:+         +:+
   +#+ +#+       +#+       +#+       +#+       +#+
  +#+ +#+         +#+     +#+         +#+     +#+
 #+# #+#           #+#   #+#           #+#   #+#
### ###             ### ###             ### ###

 Helicopter ammo box drop script (aw_drop.sqf) was written by Jester [AW] of AhoyWorld.co.uk
 You may add or alter this code to your liking as long as you leave the authors name in place.
 set _reloadtime = 30 to however many seconds you want before it is available to use again.
 place "this addAction ["<t color='#0000f6'>Ammo Drop</t>", "aw_drop.sqf",[1],0,false,true,""," driver  _target == _this"];" in the helicopter/plane init field.
 change the loadouts to the crate to your likings.
*/

private ["_heli", "_reloadtime"];

      // lets set some local variables
      _heli = _this select 0;
    _chuteType = "B_Parachute_02_F";   //parachute for blufor, for opfor and greenfor replace the 'B' with 'O' or 'G' respectively
    _crateType =  "rhs_tigr_sts_msv";   //ammocrate class for blufor, feel free to change to whichever box you desire
    _smokeType =  "";  //smoke shell color you want to use
    _lightType =  "";  //chemlightcolor you want used
    _reloadtime = 9999;  // time before next ammo drop is available to use
    _minheight = 0;  // the height you have to be before you can actually drop the crate
    _HQ = [West,"HQ"];  // do not touch this!
    _toLow = format
       [
       "<t align='center'><t size='2.2' color='#ed3b00'>TOO LOW ALTITUDE</t><br/><t size='1.2' color='#9ef680'>You need to be above</t><br/><t size='1.5' color='#ed3b00'>%1 meters</t><br/><t size='1.2' color='#9ef680'>in order to drop an ammo crate.</t></t>",
          _minheight
       ];  //text to display when not high enough to drop

        if (!isServer && isNull player) then {isJIP=true;} else {isJIP=false;};
        // Wait until player is initialized
   if (!isDedicated) then
   {
      waitUntil {!isNull player && isPlayer player};
   };

   // meat and potatoes
   if (player getVariable ["AW_ammoDrop",false]) exitWith {hint "Ammo drop is not currently available"};
   if ((getPos player) select 2 < _minheight) exitWith {hint parseText _toLow};
   if ((getPos player) select 2 > _minheight) then
   {
      player setVariable["AW_ammoDrop", true];

      _chute = createVehicle [_chuteType, [100, 100, 100], [], 0, 'FLY'];
      _chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, 50];
      _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];
      _crate attachTo [_chute, [0, 0, -1.3]];
      _crate allowdamage false;
      _light = createVehicle [_lightType, position _chute, [], 0, 'NONE'];
      _light attachTo [_chute, [0, 0, 0]];

      // clear crate - leaves medkits in place. add clearItemCargoGlobal _crate; to remove medkits
      clearWeaponCargoGlobal _crate;
      clearMagazineCargoGlobal _crate;
      clearItemCargoGlobal _crate;
      // fill crate with our junk
      _crate addWeaponCargoGlobal ["rhs_weap_rpg26",2];
      _crate addWeaponCargoGlobal ["rhs_weap_rshg2",2];
      _crate addMagazineCargoGlobal ["rhs_mag_rgn",10];
      _crate addMagazineCargoGlobal ["rhs_100Rnd_762x54mmR",10];
      _crate addMagazineCargoGlobal ["rhs_30Rnd_545x39_7N10_AK",20];
      _crate addMagazineCargoGlobal ["rhs_mag_rdg2_white",5];
      _crate addMagazineCargoGlobal ["rhs_rpg7_PG7VL_mag",1];
      _crate addMagazineCargoGlobal ["rhs_rpg7_PG7VL_mag",1];
      _crate addMagazineCargoGlobal ["rhs_rpg7_OG7V_mag",1];
      _crate addMagazineCargoGlobal ["rhs_VOG25",5];
      _crate addMagazineCargoGlobal ["rhs_GRD40_White",5];
      _crate addItemCargoGlobal ["ACE_DefusalKit", 2];
      _crate addItemCargoGlobal ["ACE_Bodybag", 5];
      _crate addItemCargoGlobal ["ACE_fieldDressing", 20];
      _crate addItemCargoGlobal ["ACE_Morphine", 10];
      _crate addItemCargoGlobal ["SmokeShell", 10];
      _crate addItemCargoGlobal ["SmokeShellRed", 10];
      _crate addItemCargoGlobal ["SmokeShellGreen", 10];
      _crate addItemCargoGlobal ["ACE_wirecutter",3];
      _crate setVariable ["AFI_vehicle_gear","east",true];

      //hint format ["ammo crate dropped, Next one will be ready in: %1 seconds",_reloadtime];
      waitUntil {position _crate select 2 < 1 || isNull _chute};
      detach _crate;
      _crate setPos [position _crate select 0, position _crate select 1, 0];
      _smoke = _smokeType createVehicle [getPos _crate select 0, getPos _crate select 1,5];

      // time to reload a new ammo crate
      sleep _reloadtime;

      // we are back in action
      //vehicle player vehicleChat "";
      player setVariable["AW_ammoDrop", false];
   };
Periaatteessa tuo on vähän turha scripti jos tarkoitus on vain käyttää kerran per pelaaja.
Jooh, mun osaamisella tuo saa riittää. _reloadtimeen riittävästi ysejä ni ei voi spammia ainakaan.
Post Reply