Files
DayZ-Epoch/dayz_code/actions/fill_startGenerator.sqf
vbawol 53bb1b9075 1.0.0.6 Developer Build
+ [CHANGED] lowered metal pole crafting requirements to 1 scrap 1 tank
trap.
+ [CHANGED] Corrugated crafting now
{"ItemPole",1},{"PartGeneric",2},{"ItemTankTrap",1},{"PartWoodLumber",2}.
+ [CHANGED] Generator can now be started and stopped.
+ [FIXED] Generators cannot be removed while running.
+ [ADDED] New larger backpack: DZ_LargeGunBag_EP1 (Weapons = 10;
Magazines = 45) added to MilitarySpecial loot table.
+ [ADDED] New backpack: DZ_GunBag_EP1 (Weapons = 6; Magazines = 8) added
to Militaryloot table..
+ [ADDED] New backpack: DZ_CompactPack_EP1 (Weapons = 1; Magazines = 18)
added to Supermarket loot table.
+ [ADDED] New backpack: DZ_TerminalPack_EP1 (Weapons = 1; Magazines =
12) added to Supermarket loot table.
+ [ADDED] Green domed tent ItemTentDomed2 - TentStorageDomed2 added to
Residential loot table at 0.01.
+ [ADDED] When removing road debris you will now get one random car part
in return.
+ [ADDED] Revamped chopping wood so that it now actually chops down a
tree within 5m. Supports specific tree types for most maps.
+ [ADDED] Craftable stick fence requires tools
{"ItemToolbox","ItemKnife"} and input {"PartWoodPile",6}.
+ [ADDED] Buildable stick fence StickFence_DZ requires tools
{"ItemEtool","ItemToolbox"}.
+ [CHANGED] Middle floor of A2 in Namalsk changed to MilitarySpecial.
+ [ADDED] 55 Gallon Fuel Barrel as a rare spawn to Farm and Industrial
loot tables at 0.005.
+ [CHANGED] Lowered chance for spawn of generator to 0.005 from 0.01.
+ [FIXED] incorrectly setting characterID server side with wrong
variable.
2013-04-27 19:11:24 -05:00

91 lines
2.3 KiB
Plaintext

private ["_vehicle","_started","_finished","_animState","_isMedic"];
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
player removeAction s_player_fillgen;
// Use target from addaction
_vehicle = _this select 3;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
cutText ["Preparing to fuel and start generator, move to cancel.", "PLAIN DOWN"];
[player,50,true,(getPosATL player)] spawn player_alertZombies;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled." , "PLAIN DOWN"]
};
if (_finished) then {
// take jerry can and replace with empty
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemJerrycanEmpty";
// mark as once filled
_vehicle setVariable ["GeneratorFilled", true,true];
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
// Sound_Generator1
// Looks like this was the entended way of making the sound, lets test
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
_vehicle setVariable ["GeneratorSound", _soundSource,true];
// TODO: Add running sounds to generator
cutText ["Generator has been started.", "PLAIN DOWN"];
};
} else {
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
// Sound_Generator1
// Looks like this was the entended way of making the sound, lets test
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
_vehicle setVariable ["GeneratorSound", _soundSource,true];
// TODO: Add running sounds to generator
cutText ["Generator has been started.", "PLAIN DOWN"];
};
};
TradeInprogress = false;
s_player_fillgen = -1;