mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 17:20:26 +03:00
1.0.0.7 Developer Build
+ [CHANGED] Build-ables now get deleted from database when killed. + [ADDED] Basic fishing on ocean using toolbelt item: ItemFishingPole. TODO: add model + [ADDED] New way of chopping down trees that actually takes into account the size of the tree for number of chops/output. For example medium sized tree will typically require 3 animations and will yield 3 wood piles. + [ADDED] Airplane dealer to Namalsk and updated trader config. + [CHANGED] Can now remove park bench with refund. + [FIXED] dayz_maxGlobalZombies was not incrementing when other players are within 400m. Also, variable was overwritten in player_spawncheck code so a init variable was added dayz_maxGlobalZombiesInit (default=40) as well as dayz_maxGlobalZombiesIncrease (default=10) to control the amount of increase for each additional player within range. + [CHANGED] Any backpack placed on the ground will with gear will now disappear to all other players. + [FIXED] Added 5 second sleep to swimming in ground fix, now it should actually work without glitching. fixes #326 + [CHANGED] To prevent lost primary weapons in backpacks, all backpacks have been Upgraded. This requires that backpacks the weapon to magazines ratio be within 1:10. http://dayzepoch.com/wiki/index.php/Backpacks + [CLEANUP] disable debug of player zombie vision. + [ADDED] ASC EU Lights Mod FROM http://www.armaholic.com/page.php?id=12076 + [ADDED] New Craft-able light_pole_kit and Build-able LightPole_DZ for night lighting. RECIPE 4 lumber + 1 scrap + 1 Light Bulb + [ADDED] MAP Editorupgrade (EU) @MAP Mod FROM http://www.armaholic.com/page.php?id=6194 + [CHANGED] Picking up crowbar now gives toolbelt item instead of melee weapon.
This commit is contained in:
104
dayz_code/actions/fill_nearestVehicle.sqf
Normal file
104
dayz_code/actions/fill_nearestVehicle.sqf
Normal file
@@ -0,0 +1,104 @@
|
||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canName","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCan","_configVeh","_capacity","_nameText","_availableCansEmpty","_availableCans"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Get all nearby vehicles within 10m
|
||||
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x and !(_x isKindOf "Man")) then {
|
||||
_findNearestVehicle set [(count _findNearestVehicle),_x];
|
||||
};
|
||||
} foreach _findNearestVehicles;
|
||||
|
||||
_IsNearVehicle = count (_findNearestVehicle);
|
||||
|
||||
if(_IsNearVehicle >= 1) then {
|
||||
|
||||
// select the nearest one
|
||||
_vehicle = _findNearestVehicle select 0;
|
||||
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
|
||||
_isOk = true;
|
||||
// perform fuel up
|
||||
while {_isOk} do {
|
||||
|
||||
// qty to add per loop
|
||||
_canSize = 20;
|
||||
|
||||
cutText [format["Filling up %1, move to cancel.",_nameText], "PLAIN DOWN"];
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = false;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
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";
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Get vehicle fuel levels again
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + 20);
|
||||
|
||||
if (_newFuel > _capacity) then {_newFuel = _capacity; _abort = true; };
|
||||
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
cutText [format["%1 filled to %2 percent capacity.",_nameText,round(_newFuel*100)], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if(_abort) exitWith {};
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["No Vehicles Nearby.", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
Reference in New Issue
Block a user