+ Added variable pricing to traders. Stock under 5 will be sold at the
buy price and over 50 will be bought at the sell price.
+ Fixed trades not forcing a gear save and added more forced gear saves.
+ Added test for time based UID for purchased vehicles.
+ Reduced humanity gained by using a blood bag to 100 down from 250.
+ Added 5 minute penalty knockout for combat loggers.
+ Added prevention to logging out in a trader city. fixes #171
+ Changed cargo check to only show on alive vehicles. Fixes #176
+ Potential fix for gunner on armored SUV. Fixes #172
+ Fixes for refueling and repairing that was broken by 1.7.61
+ Removed taming of dogs for now. fixes #162
This commit is contained in:
vbawol
2013-03-03 13:41:35 -06:00
parent 598cb62a26
commit 320046779b
32 changed files with 266 additions and 87 deletions

View File

@@ -18,6 +18,10 @@ if (_ammo != "") then {
_vehicle removeMagazineTurret [_ammo,_turret];
_vehicle addMagazineTurret [_ammo,_turret];
player removeMagazine _ammo;
disableSerialization;
call dayz_forceSave;
cutText [format["You have successfully loaded %1 ammunition.",_ammoType], "PLAIN DOWN"];
} else {
cutText [format["You need %1 type of ammo to do this.",_text], "PLAIN DOWN"];

View File

@@ -36,6 +36,10 @@ if (_hasbottleitem and _hastinitem) then {
player addMagazine "ItemWaterbottleBoiled";
};
disableSerialization;
call dayz_forceSave;
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_02") , "PLAIN DOWN"];

View File

@@ -78,6 +78,10 @@ if(!_cancel) then {
player removeMagazine _item;
disableSerialization;
call dayz_forceSave;
player playActionNow "Medic";
sleep 1;
@@ -95,9 +99,9 @@ if(!_cancel) then {
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariable "dayzPublishObj";
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
sleep 2;
player allowDamage true;

View File

@@ -76,6 +76,19 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
_sqty = _sell select 0;
_sname = _sell select 1;
_stype = _sell select 2;
switch(true)do{
case (_stype == 1): {
_stype = "CfgMagazines";
};
case (_stype == 2): {
_stype = "CfgVehicles";
};
case (_stype == 3): {
_stype = "CfgWeapons";
};
};
// Display Name of sell item
_textCurrencySell = getText(configFile >> _stype >> _sname >> "displayName");
// Menu sort order
_order = _x select 5;
@@ -89,16 +102,23 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
// Allways 1 for now
_out = 1;
// qty consumed of bname
_in = _bqty;
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
if(_qty <= 0) then {
_Display = format["Buy %1 (Out of Stock: %2)", _textPart, _qty];
_part = player addAction [_Display, "\z\addons\dayz_code\actions\trade_cancel.sqf",[], 0, true, false, "",""];
} else {
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _in, _textCurrency, _qty];
_part = player addAction [_Display, _File,[_name,_bname,_out,_in,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
// if over 50 in stock lower price to that of sell price
if(_qty >= 50) then {
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _sqty, _textCurrencySell, _qty];
_part = player addAction [_Display, _File,[_name,_sname,_out,_sqty,"buy",_textCurrencySell,_textPart,_header], _order, true, true, "",""];
} else {
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _bqty, _textCurrency, _qty];
_part = player addAction [_Display, _File,[_name,_bname,_out,_bqty,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
};
};
diag_log format["DEBUG TRADER: %1", _part];

View File

@@ -26,6 +26,9 @@ _cookedmeat = meatcooked;
player addMagazine _meatcooked;
if !(_meat in magazines player) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
};
disableSerialization;
call dayz_forceSave;
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
};
} forEach _rawmeat;

View File

@@ -10,6 +10,9 @@ if ("ItemJerrycanEmpty" in magazines player) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
};
disableSerialization;
call dayz_forceSave;
player playActionNow "Medic";
_dis=10;
@@ -17,6 +20,8 @@ if ("ItemJerrycanEmpty" in magazines player) then {
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
cutText [format[(localize "str_player_09"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_10") , "PLAIN DOWN"];

View File

@@ -84,6 +84,9 @@ if (_hasrequireditem or _bypass) then {
_dir = getDir player;
player removeMagazine _item;
disableSerialization;
call dayz_forceSave;
player playActionNow "Medic";
sleep 1;
@@ -104,7 +107,7 @@ if (_hasrequireditem or _bypass) then {
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariable "dayzPublishObj";
publicVariableServer "dayzPublishObj";
sleep 2;
player allowDamage true;

View File

@@ -76,7 +76,7 @@ player setVariable["medForceUpdate",true];
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
dayzPlayerSave = [player,[],true];
publicVariable "dayzPlayerSave";
publicVariableServer "dayzPlayerSave";
dayz_lastMeal = time;
dayz_hunger = 0;

View File

@@ -65,7 +65,7 @@ if(!(alive _item)) then {
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
dayzPlayerSave = [player,[],true];
publicVariable "dayzPlayerSave";
publicVariableServer "dayzPlayerSave";
[player,"eat",0,false] call dayz_zombieSpeak;

View File

@@ -1,6 +1,8 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not refuel while someone is in the vehicle", "PLAIN DOWN"]};
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
@@ -14,6 +16,9 @@ _newFuel = (_newFuel / _capacity);
player removeMagazine "ItemJerrycan";
player addMagazine "ItemJerrycanEmpty";
disableSerialization;
call dayz_forceSave;
player playActionNow "Medic";
_dis=10;
_sfx = "refuel";
@@ -23,10 +28,14 @@ _sfx = "refuel";
sleep 6;
dayzSetFuel = [_vehicle,_newFuel];
dayzSetFuel spawn local_setFuel;
publicVariable "dayzSetFuel";
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
call fnc_usec_medic_removeActions;

View File

@@ -6,6 +6,8 @@ _part = _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not repair while someone is in the vehicle", "PLAIN DOWN"]};
//
_hasToolbox = "ItemToolbox" in items player;
_section = _part in magazines player;
@@ -26,6 +28,9 @@ if (_section and _hasToolbox) then {
player removeMagazine _part;
disableSerialization;
call dayz_forceSave;
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
@@ -50,6 +55,7 @@ if (_section and _hasToolbox) then {
//Success!
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else {

View File

@@ -1,4 +1,7 @@
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
disableSerialization;
_id = _this select 2;
_array = _this select 3;
_vehicle = _array select 0;
@@ -6,6 +9,12 @@ _part = _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not salvage while someone is in the vehicle", "PLAIN DOWN"]};
_isOK = false;
_brokenPart = false;
//
_hasToolbox = "ItemToolbox" in items player;
@@ -26,20 +35,24 @@ if (_hasToolbox) then {
//dont allow removal of damaged parts
if (_damage < 1) then {
_isOK = [player,_part] call BIS_fnc_invAdd;
if (_isOK) then {
// the more damaged the part the higher the chance to loose the part.
// 0.25 = 25% chance to loose part
// 0.5 = 50% chance to loose part
// 0.75 = 75% chance to loose part
// 0.99 = 99% chance to loose part
_findPercent = (1 - _damage) * 10;
if(ceil (random _findPercent) == 1) then {
_isOK = true;
_brokenPart = true;
} else {
_isOK = [player,_part] call BIS_fnc_invAdd;
_brokenPart = false;
_findPercent = (1 - _damage) * 10;
// X = 1 - 0.25 = 0.75 x 10 == 7.5
// X = 1 - 0.99 = 0.01 x 10 == 0.1
call dayz_forceSave;
};
if (_isOK) then {
player playActionNow "Medic";
//break the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
@@ -50,25 +63,23 @@ if (_hasToolbox) then {
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
}
player playActionNow "Medic";
};
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_vehicle setvelocity [0,0,1];
if(ceil (random _findPercent) == 1) then {
// loose part and damage vehicle
player removeMagazine _part;
if(_brokenPart) then {
//Failed!
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
} else {
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];

View File

@@ -56,6 +56,19 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
_bqty = _buy select 0;
_bname = _buy select 1;
_btype = _buy select 2;
switch(true)do{
case (_btype == 1): {
_btype = "CfgMagazines";
};
case (_btype == 2): {
_btype = "CfgVehicles";
};
case (_btype == 3): {
_btype = "CfgWeapons";
};
};
// Display Name of buy item
_textCurrencyBuy = getText(configFile >> _btype >> _bname >> "displayName");
// Sell data from array
_sell = _x select 4;
@@ -110,15 +123,36 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
_count = {_x == _name} count weapons player;
};
if (_count > 0) then {
_Display = format["Sell %1 for %2 %3 each", _textPart, _sqty, _textCurrency];
} else {
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _sqty, _textCurrency];
};
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
// if under 5 in stock raise price to that of buy price
if(_qty <= 5) then {
if (_count > 0) then {
_Display = format["Sell %1 for %2 %3 each", _textPart, _bqty, _textCurrencyBuy];
} else {
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _bqty, _textCurrencyBuy];
};
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
_part = player addAction [_Display, _File,[_sname,_name,_bqty,_in,"sell",_textPart,_textCurrencyBuy,_header], _order, true, true, "",""];
} else {
if (_count > 0) then {
_Display = format["Sell %1 for %2 %3 each", _textPart, _sqty, _textCurrency];
} else {
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _sqty, _textCurrency];
};
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
_part = player addAction [_Display, _File,[_sname,_name,_sqty,_in,"sell",_textPart,_textCurrency,_header], _order, true, true, "",""];
};
_part = player addAction [_Display, _File,[_sname,_name,_out,_in,"sell",_textPart,_textCurrency,_header], _order, true, true, "",""];
diag_log format["DEBUG TRADER: %1", _part];
s_player_parts set [count s_player_parts,_part];

View File

@@ -1,6 +1,8 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not sihpon fuel while someone is in the vehicle", "PLAIN DOWN"]};
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
@@ -16,6 +18,9 @@ if (_newFuel > 0) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
disableSerialization;
call dayz_forceSave;
player playActionNow "Medic";
[player,"refuel",0,false] call dayz_zombieSpeak;
@@ -27,10 +32,15 @@ if (_newFuel > 0) then {
//["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
dayzSetFuel = [_vehicle,_newFuel];
dayzSetFuel spawn local_setFuel;
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
publicVariable "dayzSetFuel";
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
call fnc_usec_medic_removeActions;

View File

@@ -45,6 +45,9 @@ if (_qty >= _qty_in) then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
disableSerialization;
call dayz_forceSave;
_dir = round(random 360);
@@ -73,12 +76,17 @@ if (_qty >= _qty_in) then {
_veh call fnc_vehicleEventHandler;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
disableSerialization;
call dayz_forceSave;
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
@@ -103,7 +111,7 @@ if (_qty >= _qty_in) then {
} else {
_needed = _qty_in - _qty;
cutText [format[("No %1 found within 20 meters."),_needed,_textPartIn] , "PLAIN DOWN"];
cutText [format[("No %1 found within 20 meters."),_textPartOut] , "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -46,13 +46,15 @@ if (_qty >= _qty_in) then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
disableSerialization;
call dayz_forceSave;
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = [(getPosATL (_helipad select 0)),0,10,1,0,2000,0] call BIS_fnc_findSafePos;
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};
@@ -76,16 +78,20 @@ if (_qty >= _qty_in) then {
dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh";
// check if this will add the needed event handlers to correctly track damage client side
// event handlers to correctly track damage client side
_veh call fnc_vehicleEventHandler;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
disableSerialization;
call dayz_forceSave;
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
@@ -98,6 +104,7 @@ if (_qty >= _qty_in) then {
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
@@ -110,7 +117,7 @@ if (_qty >= _qty_in) then {
} else {
_needed = _qty_in - _qty;
cutText [format[("No %1 found within 20 meters. "),_needed,_textPartIn] , "PLAIN DOWN"];
cutText [format[("No %1 found within 20 meters. "),_textPartOut] , "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -43,6 +43,10 @@ if (_bulkqty >= 1) then {
_part_in = "bulk_" + _part_in;
player removeMagazine _part_in;
disableSerialization;
call dayz_forceSave;
diag_log format["DEBUG remove magazine %1", _part_in];
// increment trader for each
@@ -65,8 +69,6 @@ if (_bulkqty >= 1) then {
//
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
// find number of gold
_gold_out = _qty_out / 30;
@@ -90,9 +92,6 @@ if (_bulkqty >= 1) then {
player addMagazine _part_out;
};
} else {
for "_x" from 1 to _qty_out do {
@@ -100,6 +99,9 @@ if (_bulkqty >= 1) then {
};
};
disableSerialization;
call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
dayzTradeResult = nil;
@@ -138,8 +140,11 @@ if (_bulkqty >= 1) then {
// player addBackpack _part_out;
};
disableSerialization;
call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;

View File

@@ -36,7 +36,11 @@ if (_bulkqty >= 1) then {
_part_in = "bulk_" + _part_in;
player removeMagazine _part_in;
diag_log format["DEBUG remove magazine %1", _part_in];
disableSerialization;
call dayz_forceSave;
// diag_log format["DEBUG remove magazine %1", _part_in];
// increment trader for each
for "_x" from 1 to 12 do {
@@ -96,6 +100,9 @@ if (_bulkqty >= 1) then {
};
};
disableSerialization;
call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
dayzTradeResult = nil;
@@ -134,10 +141,14 @@ if (_bulkqty >= 1) then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
disableSerialization;
call dayz_forceSave;
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),(_qty_in*_qty),_textPartIn,(_qty_out*_qty),_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;

View File

@@ -72,6 +72,8 @@ if (_qty >= _qty_in) then {
};
if(_total_out > 0) then {
cutText [format[("Traded %1 %2 for %3 %4"),_total_in,_textPartIn,_total_out,_textPartOut], "PLAIN DOWN"];
disableSerialization;
call dayz_forceSave;
};
} else {

View File

@@ -97,6 +97,8 @@ if (_bulkqty >= 1) then {
};
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
disableSerialization;
call dayz_forceSave;
dayzTradeResult = nil;
@@ -136,6 +138,8 @@ if (_bulkqty >= 1) then {
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
disableSerialization;
call dayz_forceSave;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;

View File

@@ -1,6 +1,8 @@
private["_position","_tent","_location","_isOk","_backpack","_tentType","_trg","_key"];
//check if can pitch here
call gear_ui_init;
disableSerialization;
_playerPos = getPosATL player;
_item = _this;
_hastentitem = _this in magazines player;
@@ -101,6 +103,9 @@ if(!_cancel) then {
if (!_isOk) then {
//remove tentbag
player removeMagazine _item;
call dayz_forceSave;
_dir = round(direction player);
//wait a bit
@@ -137,7 +142,6 @@ if(!_cancel) then {
dayzPublishObj = [dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"];
publicVariableServer "dayzPublishObj";
cutText ["You have setup your Safe", "PLAIN DOWN"];
} else {

View File

@@ -269,11 +269,11 @@ class Citizen1; // External class reference
transportmaxbackpacks = 2;
class Turrets {};
};
class ArmoredSUV_Base_PMC;
class ArmoredSUV_PMC_DZ : ArmoredSUV_Base_PMC {
class ArmoredSUV_PMC;
class ArmoredSUV_PMC_DZ : ArmoredSUV_PMC {
scope = 2;
side = 2;
faction = "PMC_BAF";
faction = "PMC_BAF";
crew = "";
typicalCargo[] = {};
transportMaxWeapons = 20;

View File

@@ -66,7 +66,7 @@ if(_isPZombie) then {
};
if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < 6)) then { //Has some kind of target
if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < 5)) then { //Has some kind of target
_isHarvested = cursorTarget getVariable["meatHarvested",false];
_isVehicle = cursorTarget isKindOf "AllVehicles";
_isVehicletype = typeOf cursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
@@ -151,7 +151,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
};
*/
if((_isVehicle or _isTent or (cursorTarget isKindOf "VaultStorage")) and _canDo and !_isMan) then {
if((_isVehicle or _isTent or (cursorTarget isKindOf "VaultStorage")) and _isAlive and _canDo and !_isMan) then {
if (s_player_checkGear < 0) then {
s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\cargocheck.sqf",cursorTarget, 1, true, true, "", ""];
};
@@ -405,7 +405,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
player removeAction s_player_studybody;
s_player_studybody = -1;
};
/*
//Dog
if (_isDog and _isAlive and (_hasRawMeat) and _canDo and _ownerID == "0" and player getVariable ["dogID", 0] == 0) then {
if (s_player_tamedog < 0) then {
@@ -415,6 +416,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
player removeAction s_player_tamedog;
s_player_tamedog = -1;
};
*/
if (_isDog and _ownerID == dayz_characterID and _isAlive and _canDo) then {
_dogHandle = player getVariable ["dogID", 0];

View File

@@ -1,17 +1,14 @@
private["_item","_qty","_type","_meat","_loop"];
_item = _zombiebody select 0;
_qty = _zombiebody select 1;
_type = typeOf _item;
_meat = 0;
_loop = true;
if (local _item) then {
_item addMagazine "ItemZombieParts";
private["_zombiebody","_qty","_type","_meat","_loop"];
_zombiebody = _this select 0;
_qty = _this select 1;
if (local _zombiebody) then {
_zombiebody addMagazine "ItemZombieParts";
[time, _zombiebody] spawn {
private ["_timer", "_body"];
_timer = _zombiebody select 0;
_body = _zombiebody select 1;
_timer = _this select 0;
_body = _this select 1;
while {(count magazines _body >0) and (time - _timer < 300) } do {
sleep 5;
};
@@ -24,11 +21,8 @@ if (local _item) then {
true;
};
sleep 10;
deleteVehicle _item;
} else {
_ehLoc = "client";
if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)];
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_zombiebody)];
};

View File

@@ -31,6 +31,10 @@ private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
cutText [format ["Can Abort in %1", (_timeMax - _timeOut)], "PLAIN DOWN"];
//cutText [format[localize "str_abort_zedsclose",_text, "PLAIN DOWN"];
};
case (!placevault) : {
_btnAbort ctrlEnable false;
cutText ["Cannot Abort while in a trader city!", "PLAIN DOWN"];
};
case (player getVariable["combattimeout", 0] >= time) : {
_btnAbort ctrlEnable false;
//cutText ["Cannot Abort while in combat!", "PLAIN DOWN"];

View File

@@ -19,6 +19,8 @@
"dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety};
"usecBreakLegs" addPublicVariableEventHandler {(_this select 1) call player_breaklegs};
"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) spawn local_setFuel};
"dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
//Both
@@ -37,8 +39,7 @@ if (isServer) then {
"dayzLoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin};
"dayzCharSave" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerSync};
//Checking
"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) spawn local_setFuel};
"dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
"dayzDeleteObj" addPublicVariableEventHandler {(_this select 1) spawn server_deleteObj};
"atp" addPublicVariableEventHandler { _array = _this select 1; diag_log format["TELEPORT REVERT: %1 (%2) from %3 to %4 now at %5", _array select 0, _array select 1, _array select 2, _array select 3, _array select 4];};

View File

@@ -41,12 +41,16 @@ if (_finished) then {
_unit setVariable["LastTransfusion",time,true];
_unit setVariable["USEC_lowBlood",false,true];
player removeMagazine "ItemBloodbag";
disableSerialization;
call dayz_forceSave;
//["usecTransfuse",[_unit,player]] call broadcastRpcCallAll;
usecTransfuse = [_unit,player];
publicVariable "usecTransfuse";
//dayzHumanity = [player,250];
[player,250] call player_humanityChange;
//dayzHumanity = [player,100];
[player,100] call player_humanityChange;
} else {
r_interrupt = false;
player switchMove "";

View File

@@ -286,7 +286,7 @@ class FSM
" _currentState = [_currentWpn,_currentAnim,_temp];" \n
" " \n
" dayz_Magazines = _magazineArray;" \n
" dayzPlayerSave = [player,dayz_Magazines,false];" \n
" dayzPlayerSave = [player,dayz_Magazines,false,true];" \n
" publicVariableServer ""dayzPlayerSave"";" \n
" " \n
" if (isServer) then {" \n
@@ -591,10 +591,6 @@ class FSM
"dayzGearSave = false;" \n
"_inventory call player_gearSet;" \n
"" \n
"player removeMagazine ""DummyItem"";" \n
"" \n
"player addMagazine ""DummyItem"";" \n
"" \n
"//Assess in backpack" \n
"if (count _backpack > 0) then {" \n
" //Populate" \n

View File

@@ -18,7 +18,15 @@ if (vehicle _object != _object) then {
if (59 in _playerIDtoarray) exitWith { };
if ((_timeout - time) > 0) then {
diag_log format["COMBAT LOGGED: %1 (%2)", _playerName,_timeout];
_object setVariable["NORRN_unconscious",true, true];
_object setVariable["unconsciousTime",300,true];
diag_log format["SET UNCONCIOUSNESS: %1", _playerName];
//_message = format["PLAYER COMBAT LOGGED: %1 (%2)",_playerName, _killerName, _weapon];
//[nil, nil, rspawn, [_object, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
};
diag_log format["DISCONNECT: %1 (%2) Object: %3, _characterID: %4", _playerName,_playerID,_object,_characterID];
@@ -29,7 +37,7 @@ if (!isNull _object) then {
{ [_x,"gear"] call server_updateObject } foreach
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]);
if (alive _object) then {
//[_object,(magazines _object),true,(unitBackpack _object)] call server_playerSync;
//[_object,(magazines _object),true,true] call server_playerSync;
[_object,[],true] call server_playerSync;
_myGroup = group _object;
deleteVehicle _object;

View File

@@ -20,6 +20,7 @@ private["_character","_magazines","_force","_characterID","_charPos","_isInVehic
_character = _this select 0;
_magazines = _this select 1;
//_force = _this select 2;
_forceGear = _this select 3;
_force = true;
@@ -94,10 +95,10 @@ if (_characterID != "0") then {
};
_character setVariable ["posForceUpdate",false,true];
};
if (_isNewGear) then {
if (_isNewGear or _forceGear) then {
//diag_log ("gear..."); sleep 0.05;
_playerGear = [weapons _character,_magazines];
//diag_log ("playerGear: " +str(_playerGear));
//diag_log ("playerGear: " +str(_playerGear));
_backpack = unitBackpack _character;
_playerBackp = [typeOf _backpack,getWeaponCargo _backpack,getMagazineCargo _backpack];
};

View File

@@ -14,9 +14,10 @@ diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;
//Generate UID
_uid = _worldspace call dayz_objectUID2;
// _uid = format["%1%2",dayZ_instance,_uid];
//Generate UID test using time
// _uid = str( round (dateToNumber date)) + str(round time);
_uid = _worldspace call dayz_objectUID3;
//_uid = format["%1%2",(round time),_uid];
if (_spawnDMG) then {
_fuel = 0;

View File

@@ -421,6 +421,20 @@ dayz_objectUID2 = {
_key
};
dayz_objectUID3 = {
private["_position","_dir","_key"];
_dir = _this select 0;
_key = "";
_position = _this select 1;
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} forEach _position;
_key = _key + str(round(_dir + time));
_key
};
dayz_recordLogin = {
private["_key"];
_key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];