mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 10:56:29 +03:00
0.87
added cancel to repair and salvage menus, added message to salvage when player does not, fixed bulk crates selling of weapons and backpacks, Can no longer place vaults on roads or within 50m of trader citys, Added now entering/leaving messages to trader citys, Added kill messages from f0rt and stapo.
This commit is contained in:
20
dayz_server/compile/fnc_plyrHit.sqf
Normal file
20
dayz_server/compile/fnc_plyrHit.sqf
Normal file
@@ -0,0 +1,20 @@
|
||||
private ["_victim", "_attacker","_weapon","_distance"];
|
||||
_victim = _this select 0;
|
||||
_attacker = _this select 1;
|
||||
|
||||
if (!isPlayer _victim || !isPlayer _attacker) exitWith {};
|
||||
if ((name _victim) == (name _attacker)) exitWith {};
|
||||
|
||||
_weapon = weaponState _attacker;
|
||||
if (_weapon select 0 == "Throw") then {
|
||||
_weapon = _weapon select 3;
|
||||
} else {
|
||||
_weapon = _weapon select 0;
|
||||
};
|
||||
|
||||
_distance = _victim distance _attacker;
|
||||
|
||||
_victim setVariable["AttackedBy", _attacker, true];
|
||||
_victim setVariable["AttackedByName", (name _attacker), true];
|
||||
_victim setVariable["AttackedByWeapon", _weapon, true];
|
||||
_victim setVariable["AttackedFromDistance", _distance, true];
|
||||
@@ -1,28 +0,0 @@
|
||||
private["_item","_qty","_type","_meat","_loop"];
|
||||
_item = _this select 0;
|
||||
_qty = _this select 1;
|
||||
_type = typeOf _item;
|
||||
_meat = 0;
|
||||
_loop = true;
|
||||
_rawfoodtype = configFile >> "CfgSurvival" >> "Meat" >> _type >> "rawfoodtype";
|
||||
|
||||
if (local _item) then {
|
||||
for "_x" from 1 to _qty do {
|
||||
_item addMagazine _rawfoodtype;
|
||||
};
|
||||
sleep 2;
|
||||
_timer = time;
|
||||
while {_loop} do {
|
||||
_meat = count magazines _item;
|
||||
if (_meat == 0) then {_loop = false};
|
||||
if ((time - _timer) > 300) then {_loop = false};
|
||||
sleep 1;
|
||||
};
|
||||
["dayzHideBody",_item] call broadcastRpcCallAll;
|
||||
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)];
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
private["_item","_qty","_type","_meat","_loop"];
|
||||
_item = _this select 0;
|
||||
_qty = _this select 1;
|
||||
_type = typeOf _item;
|
||||
_meat = 0;
|
||||
_loop = true;
|
||||
if (local _item) then {
|
||||
_item addMagazine "ItemZombieParts";
|
||||
sleep 2;
|
||||
_timer = time;
|
||||
while {_loop} do {
|
||||
_meat = count magazines _item;
|
||||
if (_meat == 0) then {_loop = false};
|
||||
if ((time - _timer) > 300) then {_loop = false};
|
||||
sleep 1;
|
||||
};
|
||||
["dayzHideBody",_item] call broadcastRpcCallAll;
|
||||
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)];
|
||||
};
|
||||
@@ -7,16 +7,36 @@ _playerID = _this select 3;
|
||||
_playerName = _this select 4;
|
||||
_infected = _this select 5;
|
||||
|
||||
_victim removeAllEventHandlers "MPHit";
|
||||
|
||||
_victim = _this select 2;
|
||||
_victimName = _victim getVariable["bodyName", "nil"];
|
||||
|
||||
_killer = _victim getVariable["AttackedBy", "nil"];
|
||||
_killerName = _victim getVariable["AttackedByName", "nil"];
|
||||
|
||||
if (_killerName == "nil" || _victimName == _killerName) then {
|
||||
_message = format["%1 Commited Suicide Or Was Killed By A Zombie",_victimName];
|
||||
_loc_message = format["KILLMSG: %1 Commited Suicide Or Was Killed By A Zombie", _victimName];
|
||||
} else {
|
||||
_weapon = _victim getVariable["AttackedByWeapon", "nil"];
|
||||
_distance = _victim getVariable["AttackedFromDistance", "nil"];
|
||||
_message = format["%1 Was Killed By %2 With A %3",_victimName, _killerName, _weapon];
|
||||
_loc_message = format["KILLMSG: %1 Was Killed By %2 With A %3 From %4m", _victimName, _killerName, _weapon, _distance];
|
||||
};
|
||||
|
||||
diag_log _loc_message;
|
||||
//SHOW THE MESSAGE INGAME [GLOBAL CHAT]
|
||||
[nil, nil, rspawn, [_victim, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
|
||||
|
||||
_victim setVariable["AttackedBy", "nil", true];
|
||||
_victim setVariable["AttackedByName", "nil", true];
|
||||
_victim setVariable["AttackedByWeapon", "nil", true];
|
||||
_victim setVariable["AttackedFromDistance", "nil", true];
|
||||
|
||||
dayz_disco = dayz_disco - [_playerID];
|
||||
_newObject setVariable["processedDeath",time];
|
||||
|
||||
/*
|
||||
diag_log ("DW_DEBUG: (isnil _characterID): " + str(isnil "_characterID"));
|
||||
if (isnil "_characterID") then {
|
||||
diag_log ("DW_DEBUG: _newObject: " + str(_newObject));
|
||||
};
|
||||
*/
|
||||
|
||||
if (typeName _minutes == "STRING") then
|
||||
{
|
||||
_minutes = parseNumber _minutes;
|
||||
@@ -25,24 +45,9 @@ if (typeName _minutes == "STRING") then
|
||||
if (_characterID != "0") then
|
||||
{
|
||||
_key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
|
||||
//diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
_key call server_hiveWrite;
|
||||
}
|
||||
else
|
||||
{
|
||||
deleteVehicle _newObject;
|
||||
};
|
||||
|
||||
diag_log ("PDEATH: Player Died " + _playerID);
|
||||
/*
|
||||
_eh = [_newObject] spawn {
|
||||
_body = _this select 0;
|
||||
_method = _body getVariable["deathType","unknown"];
|
||||
_name = _body getVariable["bodyName","unknown"];
|
||||
waitUntil{!isPlayer _body;sleep 1};
|
||||
_body setVariable["deathType",_method,true];
|
||||
_body setVariable["bodyName",_name,true];
|
||||
diag_log ("PDEATH: Player Left Body " + _name);
|
||||
};
|
||||
*/
|
||||
//dead_bodyCleanup set [count dead_bodyCleanup,_newObject];
|
||||
@@ -10,6 +10,9 @@ if (isNull _playerObj) exitWith {
|
||||
diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
|
||||
};
|
||||
|
||||
//Add MPHit event handler
|
||||
_playerObj addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];
|
||||
|
||||
if (_playerID == "") then {
|
||||
_playerID = getPlayerUID _playerObj;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user