added murder/death ui by maca134

This commit is contained in:
[VB]AWOL
2013-08-23 11:11:11 -05:00
parent c0204167fc
commit 66ca0f757e
3 changed files with 184 additions and 7 deletions

View File

@@ -0,0 +1,65 @@
class EpochDeathBoardDialog
{
idd = -1;
movingenable = 0;
class Controls {
class RscText_1000: RscText
{
idc = -1;
x = 0.283659 * safezoneW + safezoneX;
y = 0.224978 * safezoneH + safezoneY;
w = 0.432681 * safezoneW;
h = 0.550044 * safezoneH;
colorBackground[] = {0,0,0,0.7};
};
class RscText_1001: RscText
{
idc = -1;
text = "Kill Board";
x = 0.283659 * safezoneW + safezoneX;
y = 0.224978 * safezoneH + safezoneY;
w = 0.432681 * safezoneW;
h = 0.0550044 * safezoneH;
colorBackground[] = {0,0,0,0.7};
};
class RscListbox_1500: RscListbox
{
idc = 21000;
x = 0.297181 * safezoneW + safezoneX;
y = 0.334987 * safezoneH + safezoneY;
w = 0.148734 * safezoneW;
h = 0.412533 * safezoneH;
onMouseButtonClick = "[(lbCurSel 21000), ((ctrlParent (_this select 0)) displayCtrl 21001)] spawn EpochDeathBoardClick;";
};
class RscText_1002: RscText
{
idc = -1;
text = "Player Deaths";
x = 0.29042 * safezoneW + safezoneX;
y = 0.293733 * safezoneH + safezoneY;
w = 0.0540852 * safezoneW;
h = 0.0275022 * safezoneH;
colorText[] = {1,1,1,1};
};
class RscShortcutButton_1700: RscShortcutButton
{
idc = -1;
text = "Close";
x = 0.628452 * safezoneW + safezoneX;
y = 0.706267 * safezoneH + safezoneY;
w = 0.0743671 * safezoneW;
h = 0.0550044 * safezoneH;
onButtonClick = "dayzPlayerDeathsResult = nil; ((ctrlParent (_this select 0)) closeDisplay 9000);";
};
class RscStructuredText_1100: RscStructuredText
{
idc = 21001;
text = "";
x = 0.452114 * safezoneW + safezoneX;
y = 0.307485 * safezoneH + safezoneY;
w = 0.250144 * safezoneW;
h = 0.398782 * safezoneH;
colorBackground[] = {0,0,0,0};
};
};
};

View File

@@ -315,6 +315,13 @@ if (!isDedicated) then {
if (_dikCode == 0x50) then { if (_dikCode == 0x50) then {
DZE_Z = true; DZE_Z = true;
}; };
if (_dikCode == 0x4B) then {
DZE_4 = true;
};
if (_dikCode == 0x4D) then {
DZE_6 = true;
};
if (_dikCode == 0x4C) then { if (_dikCode == 0x4C) then {
DZE_5 = true; DZE_5 = true;
}; };
@@ -618,6 +625,90 @@ if (!isDedicated) then {
[0, player, '', _data] execVM (_item select 9); [0, player, '', _data] execVM (_item select 9);
TraderItemList = -1; TraderItemList = -1;
}; };
// murder message boards by maca134
/*
_death_record = [
0_victimName,
1_killerName,
2_weapon,
3_distance,
4ServerCurrentTime
];
*/
EpochDeathBoardDialogList = 21000;
EpochDeathBoardDialogSText = 21001;
EpochDeathBoardDeaths = [];
EpochDeathBoardLoad = {
createdialog "EpochDeathBoardDialog";
/*dayzPlayerDeathsResult = [
["maca134","Bob","AK_107_Kobra",100,[8,30]],
["Fred","Jonny","FN_FAL",42,[8,32]],
["maca134","Bob","M9SD",100,[5,30]],
["Fred","Jonny","BAF_AS50_scoped",42,[8,34]]
];*/
{
lbAdd [EpochDeathBoardDialogList, (_x select 0)];
} forEach dayzPlayerDeathsResult;
};
EpochDeathBoardClick = {
disableSerialization;
private ["_i", "_record", "_output", "_record_stxt", "_name", "_image", "_h", "_m", "_format"];
_quotes = [
"Death is God's way of telling you not to be such a wise guy.",
"What happens if you get scared half to death, twice?",
"Don't upset me.. I'm running out of places to hide the bodies.",
"Don't run, you'll just die tired.",
"Give me immortality or give me death.",
"I can't live with death; he's always leaving the toilet seat up.",
"Why won't you die?!?!",
"Guns don't kill people; death kills people. It's a proven medical fact."
];
_i = _this select 0;
if (_i < 0) exitWith {};
_output = _this select 1;
_record = dayzPlayerDeathsResult select _i;
_record_stxt = call compile format["epoch_death_board_record_%1;",_i];
if(isNil "_record_stxt") then {
_record_stxt = format["<t size='1.6' align='left'>%1</t><br /><br />", (_record select 0)];
_format = {
private ["_codeCount", "_str"];
_str = format["%1", _this];
_codeCount = (count (toArray _str));
if (_codeCount == 1) then {
_str = format["0%1", _str];
};
_str;
};
_h = (_record select 4) select 0;
_m = (_record select 4) select 1;
_record_stxt = format["%1<t size='1' align='left'>Died at %2:%3</t><br /><br />", _record_stxt, (_h call _format), (_m call _format)];
if ((_record select 1) != 'unknown') then {
_record_stxt = format["%1<t size='1' align='left'>Was killed by %2</t><br /><br />", _record_stxt, (_record select 1)];
};
if ((_record select 2) != 'unknown') then {
_name = getText(configFile >> "cfgWeapons" >> (_record select 2) >> "displayName");
_image = getText(configFile >> "cfgWeapons" >> (_record select 2) >> "picture");
_record_stxt = format["%1<t size='1' align='left'>With a %2<br /><img size='3' image='%3' /></t><br /><br />", _record_stxt, _name, _image];
};
if (format["%1", (_record select 3)] != 'unknown') then {
_record_stxt = format["%1<t size='1' align='left'>At a distance of %2m</t><br /><br />", _record_stxt, (_record select 3)];
};
_record_stxt = format["%1<t font='Bitstream'>%2</t>", _record_stxt, (_quotes call BIS_fnc_selectRandom)];
call compile format["epoch_death_board_record_%1 = ""%2"";" ,_i , _record_stxt];
};
_output ctrlSetStructuredText parseText _record_stxt;
};
}; };

View File

@@ -7,8 +7,9 @@ _playerID = _this select 3;
_playerName = _this select 4; _playerName = _this select 4;
_infected = _this select 5; _infected = _this select 5;
_victim = _newObject;
_victim removeAllEventHandlers "MPHit"; _victim removeAllEventHandlers "MPHit";
_victim = _newObject;
_victimName = _victim getVariable["bodyName", "nil"]; _victimName = _victim getVariable["bodyName", "nil"];
_killer = _victim getVariable["AttackedBy", "nil"]; _killer = _victim getVariable["AttackedBy", "nil"];
@@ -39,6 +40,12 @@ if (_killerName != "nil") then
if(DZE_DeathMsgGlobal) then { if(DZE_DeathMsgGlobal) then {
[nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE; [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
}; };
/* needs customRemoteMessage
if(DZE_DeathMsgGlobal) then {
customRemoteMessage = ['globalChat', _message, _killer];
publicVariable "customRemoteMessage";
};
/*
if(DZE_DeathMsgSide) then { if(DZE_DeathMsgSide) then {
[nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE; [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
}; };
@@ -47,7 +54,14 @@ if (_killerName != "nil") then
}; };
// build array to store death messages to allow viewing at message board in trader citys. // build array to store death messages to allow viewing at message board in trader citys.
PlayerDeaths set [count PlayerDeaths,_message]; _death_record = [
_victimName,
_killerName,
_weapon,
_distance,
ServerCurrentTime
];
PlayerDeaths set [count PlayerDeaths,_death_record];
// Cleanup // Cleanup
_victim setVariable["AttackedBy", "nil", true]; _victim setVariable["AttackedBy", "nil", true];
@@ -60,6 +74,7 @@ if (_killerName != "nil") then
if (isnil "dayz_disco") then { if (isnil "dayz_disco") then {
dayz_disco = []; dayz_disco = [];
}; };
dayz_disco = dayz_disco - [_playerID]; dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",time]; _newObject setVariable["processedDeath",time];
@@ -68,6 +83,10 @@ if (typeName _minutes == "STRING") then
_minutes = parseNumber _minutes; _minutes = parseNumber _minutes;
}; };
#ifdef DZE_SERVER_DEBUG_PKILL
diag_log ("PDEATH: Player Died " + _playerID);
#endif
if (_characterID != "0") then if (_characterID != "0") then
{ {
_key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected]; _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
@@ -75,12 +94,14 @@ if (_characterID != "0") then
diag_log ("HIVE: WRITE: "+ str(_key)); diag_log ("HIVE: WRITE: "+ str(_key));
#endif #endif
_key call server_hiveWrite; _key call server_hiveWrite;
// spawn flies
_sound = createSoundSource["Sound_Flies",getPosATL _newObject,[],0];
// Add flies to cleanup array
dayz_flyMonitor set[count dayz_flyMonitor, [_sound,_newObject]];
} }
else else
{ {
deleteVehicle _newObject; deleteVehicle _newObject;
}; };
#ifdef DZE_SERVER_DEBUG_PKILL
diag_log ("PDEATH: Player Died " + _playerID);
#endif