Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hier einstellen wie viel pro Sekunde runter gehen soll.
- //(1 -> max, 0 -> kein fuel mehr / 0,0005 = ca. 25 min fuel)
- [] spawn
- {
- _time = 2; //wie oft die sekunde? (performance und so)
- _armoredLoss = 0.004 * _time; //Panzer, BTR, ...
- _carLoss = 0.002 * _time; //HMMVS, Hunter, Strider, Normale Autos
- _airLoss = 0.001 * _time; //Jets, Helis
- _autonomousLoss = 0.0009 * _time; //z.B. Drone
- _shipLoss = 0.001 * _time; //z.B. Speedboat
- _supportLoss = 0.0009 * _time; //z.B. Ammotruck
- _kinds = ["Support", "Ship", "Car", "Autonomous", "Armored", "Air"];
- _losses = [_supportLoss, _shipLoss, _carLoss, _autonomousLoss, _armoredLoss, _airLoss];
- hint "fuellower startet";
- while{true} do
- {
- sleep _time;
- {
- if(isEngineOn _x) then
- {
- _vehicle = _x;
- _index = {
- if(_vehicle isKindOf _x) then
- {
- exitWith { _forEachIndex }
- };
- if(_forEachIndex == 5) then
- {
- exitWith { -1 }
- };
- }
- foreach _kinds;
- if(_index != -1) then
- {
- _wieVielVerlieren = _losses select _index;
- _x setFuel (fuel _x - _wieVielVerlieren);
- };
- };
- }
- foreach vehicles;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement