Advertisement
Guest User

Untitled

a guest
May 1st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.17 KB | None | 0 0
  1. // Hier einstellen wie viel pro Sekunde runter gehen soll.
  2. //(1 -> max, 0 -> kein fuel mehr  /  0,0005 = ca. 25 min fuel)
  3. [] spawn
  4. {
  5.     _time = 2; //wie oft die sekunde? (performance und so)
  6.     _armoredLoss = 0.004 * _time; //Panzer, BTR, ...
  7.     _carLoss = 0.002 * _time; //HMMVS, Hunter, Strider, Normale Autos
  8.     _airLoss = 0.001 * _time; //Jets, Helis
  9.     _autonomousLoss = 0.0009 * _time; //z.B. Drone
  10.     _shipLoss = 0.001 * _time; //z.B. Speedboat
  11.     _supportLoss = 0.0009 * _time; //z.B. Ammotruck
  12.     _kinds = ["Support",     "Ship",    "Car",    "Autonomous",    "Armored",    "Air"];
  13.     _losses = [_supportLoss, _shipLoss, _carLoss, _autonomousLoss, _armoredLoss, _airLoss];
  14.                
  15.     hint "fuellower startet";
  16.     while{true} do
  17.     {
  18.         sleep _time;
  19.         {
  20.             if(isEngineOn _x) then
  21.             {
  22.                 _vehicle = _x;
  23.                 _index = {
  24.                     if(_vehicle isKindOf _x) then
  25.                     {
  26.                         exitWith { _forEachIndex }
  27.                     };
  28.                     if(_forEachIndex == 5) then
  29.                     {
  30.                         exitWith { -1 }
  31.                     };
  32.                 }
  33.                 foreach _kinds;
  34.                
  35.                 if(_index != -1) then
  36.                 {
  37.                     _wieVielVerlieren = _losses select _index;
  38.                     _x setFuel (fuel _x - _wieVielVerlieren);
  39.                 };
  40.             };
  41.         }
  42.         foreach vehicles;
  43.     };
  44. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement