Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
DrTauren

Изменённые оповещения об убийствах

Recommended Posts

Видели наверное пару раз в чате что-то типа "Gagatun was killed by Ololoshka"? Так вот при помощи этого скрипта можно изменить сообщения об убийствах и добавить иконку оружия. Выйдет типа как в Counter Strike  :laugh:

 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.


Гайд оформляю на основе сообщения пользователя Bandit3. Так что ему спасибо говорите. Заодно и проверьте работоспособность скрипта.

 

Инструкция:
1)
Создаём файл kill_msg.sqf, кидаем его в корень миссии и вставляем в него этот код:

fnc_kill_message = {
    private ["_finaltxt"];
    _finaltxt = _this select 0;
    [_finaltxt,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + 0.01 * safezoneH,0.3],30,0.5] spawn BIS_fnc_dynamicText;
};
"customkillMessage" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;}; 

2) В файле init.sqf находим блок:

if (!isDedicated) then {

И добавляем в него эту строку:

execVM "kill_msg.sqf";

3) В файле fnc_plyrHit весь код заменяем на этот:

 

 

private ["_victim", "_attacker","_weapon","_weapon_dmg","_distance","_damage","_weapon_img"];
_victim = _this select 0;
_attacker = _this select 1;
_damage = _this select 2;


if (!isPlayer _victim || !isPlayer _attacker) exitWith {};
if ((owner _victim) == (owner _attacker)) exitWith {
    _victim setVariable["AttackedBy", _victim, true];
};


_weapon = (weaponState _attacker);


_vehicle = typeOf (vehicle _attacker); 


if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {
    _weapon_dmg = getText (configFile >> 'CfgVehicles' >> _vehicle >> 'displayName');
    _weapon_img = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture');
} else {
    _weapon_dmg = gettext (configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'displayName');
    _weapon_img = gettext(configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'picture');
};


_distance = _victim distance _attacker;


diag_log format["PLAYERHIT: %1 was hit by %2 with %3 from %4m with %5 dmg", _victim, _attacker, _weapon_dmg, _distance, _damage];


_victim setVariable["AttackedBy", _attacker, true];
_victim setVariable["AttackedByName", (name _attacker), true];
_victim setVariable["AttackedByWeapon", _weapon_dmg, true];
_victim setVariable["AttackedFromDistance", _distance, true];
_victim setVariable["AttackedByWeaponImg", _weapon_img, true]; 

 

 

4) В файле server_playerDied весь код меняем на это:

 

 

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record","_pic","_kill_txt"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =     _this select 0;
_minutes =        _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_infected =        _this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
    _victimName =    _this select 5;
} else {
    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];


_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];


// when a zombie kills a player _killer, _killerName && _weapon will be "nil"
// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.
if ((typeName _killer) != "STRING") then
{
    _weapon = _victim getVariable["AttackedByWeapon", "nil"];
    _distance = _victim getVariable["AttackedFromDistance", "nil"];


    if ((owner _victim) == (owner _killer)) then 
    {
        _message = format["%1 killed himself",_victimName];
        _loc_message = format["PKILL: %1 killed himself", _victimName];
    }
    else
    {
        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
    
        _pic = _victim getVariable["AttackedByWeaponImg", "nil"];
        
        if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
            if (!isNil "_pic") then {
                _kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];


                customkillMessage = [_kill_txt];
                publicVariable "customkillMessage";
            };
        };
    };


    diag_log _loc_message;
    
    if(DZE_DeathMsgGlobal) then {
        [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 {
        [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
    };
    if(DZE_DeathMsgTitleText) then {
        [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;
    };


    // build array to store death messages to allow viewing at message board in trader citys.
    _death_record = [
        _victimName,
        _killerName,
        _weapon,
        _distance,
        ServerCurrentTime
    ];
    PlayerDeaths set [count PlayerDeaths,_death_record];


    // Cleanup
    _victim setVariable["AttackedBy", "nil", true];
    _victim setVariable["AttackedByName", "nil", true];
    _victim setVariable["AttackedByWeapon", "nil", true];
    _victim setVariable["AttackedFromDistance", "nil", true];
};


// Might not be the best way...
/*
if (isnil "dayz_disco") then {
    dayz_disco = [];
};
*/


// dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",diag_tickTime];


if (typeName _minutes == "STRING") then
{
    _minutes = parseNumber _minutes;
};


diag_log ("PDEATH: Player Died " + _playerID);


if (_characterID != "0") then
{
    _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
    #ifdef DZE_SERVER_DEBUG_HIVE
    diag_log ("HIVE: WRITE: "+ str(_key));
    #endif
    _key call server_hiveWrite;
}
else
{
    deleteVehicle _newObject;
}; 

 

 

Share this post


Link to post
Share on other sites



Поставил и прекрасно работает

Share this post


Link to post
Share on other sites

Как правильно вставить? Эту строчку: execVM "kill_msg.sqf";

 Все равно куда и как?

И где искать эти 2 файла: fnc_plyrHit         server_playerDied 

Edited by BlackJack67 (see edit history)

Share this post


Link to post
Share on other sites

Как правильно вставить? Эту строчку: execVM "kill_msg.sqf";

 Все равно куда и как?

И где искать эти 2 файла: fnc_plyrHit         server_playerDied 

Ответ на первое:

if (!isDedicated) then {
exeVM "kill_msg.sqf"

Ответ на второе:

- В dayz_server.pbo/compile

Share this post


Link to post
Share on other sites

Мне кажется или было бы прилично указать ссылку на источник?

Share this post


Link to post
Share on other sites

Мне кажется или было бы прилично указать ссылку на источник?

Я переписал и немножко доделал пост парня, что у казал выше. А так как я не копировал это полностью с другого сайта, то и ссылку указывать не обязательно.

Share this post


Link to post
Share on other sites

А по какой причине не всегда высвечивается данное сообщение? Я так понимаю зависит от скинов?

Share this post


Link to post
Share on other sites

Не все оружия показывает :mad:

И не всегда показывает кто тебя убил!!!

Share this post


Link to post
Share on other sites

на это видимо нет ответа,и зависит это не от скинов,я так думаю.

Share this post


Link to post
Share on other sites

заметил если игрок убит оружием который админ наспавнил в инфи админке,то не показывает сообщение. а если оружием который нашел.то ок

Share this post


Link to post
Share on other sites

как то 1 раз из 5 показывает. от чего может зависить?

Share this post


Link to post
Share on other sites

как то 1 раз из 5 показывает. от чего может зависить?

Тоже самое((

Share this post


Link to post
Share on other sites

В спойлере часть информации поглощается спойлером )). выходит за пределы спойлера.

Share this post


Link to post
Share on other sites

В спойлере часть информации поглощается спойлером )). выходит за пределы спойлера.

Дак в курсе))) это не меняет темы) не всегда срабатывает

Share this post


Link to post
Share on other sites

как то 1 раз из 5 показывает. от чего может зависить?

Нужно сделать задержку , что бы он чаще работал , у меня показывает почти все оповещения  .

Исправления : 

в файле server_playerDied.sqf dayz_server \ compile \ server_playerDied.sqf) просто добавить задержку 

sleep 3;

над 

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

или скопируйте , и замените 

 

 

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID = 	_this select 0;
_minutes =		_this select 1;
_newObject = 	_this select 2;
_playerID = 	_this select 3;
_infected =		_this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
	_victimName =	_this select 5;
} else {
	_victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];

sleep 3;

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName && _weapon will be "nil"
// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.
if ((typeName _killer) != "STRING") then
{
	_weapon = _victim getVariable["AttackedByWeapon", "nil"];
	_distance = _victim getVariable["AttackedFromDistance", "nil"];

	if ((owner _victim) == (owner _killer)) then 
	{
		_message = format["%1 killed himself",_victimName];
		_loc_message = format["PKILL: %1 killed himself", _victimName];
	}
	else
	{
		_message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
		_loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
	
	
		_pic = _victim getVariable["AttackedByWeaponImg", "nil"];
		
                if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
			if (!isNil "_pic") then {
				_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
				_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
				_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
				_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

				customkillMessage = [_kill_txt];
				publicVariable "customkillMessage";
			};
		}; 
	
	
	};

	diag_log _loc_message;

	if(DZE_DeathMsgGlobal) then {
		[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 {
		[nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
	};
	if(DZE_DeathMsgTitleText) then {
		[nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;
	};

	// build array to store death messages to allow viewing at message board in trader citys.
	_death_record = [
		_victimName,
		_killerName,
		_weapon,
		_distance,
		ServerCurrentTime
	];
	PlayerDeaths set [count PlayerDeaths,_death_record];

	// Cleanup
	_victim setVariable["AttackedBy", "nil", true];
	_victim setVariable["AttackedByName", "nil", true];
	_victim setVariable["AttackedByWeapon", "nil", true];
	_victim setVariable["AttackedFromDistance", "nil", true];
};

// Might not be the best way...
/*
if (isnil "dayz_disco") then {
	dayz_disco = [];
};
*/

// dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",diag_tickTime];

if (typeName _minutes == "STRING") then
{
	_minutes = parseNumber _minutes;
};

diag_log ("PDEATH: Player Died " + _playerID);

if (_characterID != "0") then
{
	_key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
	#ifdef DZE_SERVER_DEBUG_HIVE
	diag_log ("HIVE: WRITE: "+ str(_key));
	#endif
	_key call server_hiveWrite;
}
else
{
	deleteVehicle _newObject;
}; 

 

 

 

 

Срабатывание смс . 90 % 

Edited by Bandit3 (see edit history)

Share this post


Link to post
Share on other sites

 

Нужно сделать задержку , что бы он чаще работал , у меня показывает почти все оповещения .

благодарю тебя

Share this post


Link to post
Share on other sites

Возможно это сообщение сделать меньше?

Share this post


Link to post
Share on other sites

Возможно это сообщение сделать меньше?

В смысле меньше?

Share this post


Link to post
Share on other sites

Возможно это сообщение сделать меньше?

Конечно , в файле server_playerDied 

 

_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName];
_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%1'/>",_pic];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %1 </t>",_victimName];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%1m]</t>",(ceil _distance)];

size Это размер . ставьте 0.75  думаю будет нормально

Share this post


Link to post
Share on other sites

Конечно , в файле server_playerDied 

 

_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName];
_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%1'/>",_pic];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %1 </t>",_victimName];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%1m]</t>",(ceil _distance)];

size Это размер . ставьте 0.75  думаю будет нормально

Спасибо огромное =3

Edited by Seksoman (see edit history)

Share this post


Link to post
Share on other sites

Вышла новая версия . попрошу всем скачать . ( исправлены ошибки )

 

Качаем https://yadi.sk/d/X2ib3VKCeEMqj

 

Заменяем все файлы , + кидаем файл player_murderMenu.sqf   Куда вам угодно . ( в папке MPMission) и меняем путь к нему в compile.sqf

call compile preprocessFileLineNumbers ""+ВАШ ПУТЬ+"\player_murderMenu.sqf";

Шаг с player_murderMenu  Не обязательно . 

Edited by Bandit3 (see edit history)

Share this post


Link to post
Share on other sites

В player_murderMenu.sqf нашел 2 ошибки...

 

49 строка: (нет закрытия </t>)

_record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1<br/>,_name];
 

 

 

в общем нужно изменить на вот так:

 

_record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1</t><br/>",_name];
 


 

и вторая ошибка 51 строка: (автор скрипта, я пологаю по запарке промахнулся и засунул закрытие в эту строку...)

 

_record_stxt = _record_stxt + format[<img size='3' image='%1' /></t>",_image];
 

 

 

нужно исправить на вот так:

 

_record_stxt = _record_stxt + format["<img size='3' image='%1' />",_image];
 

 

 

Целиком это место в коде должно выглядеть так: (вырезка)

 

    _record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1</t><br/>",_name];
    if (_image != "nil") then {
         _record_stxt = _record_stxt + format["<img size='3' image='%1' />",_image];
      };
 

 

Edited by JustBullet (see edit history)

Share this post


Link to post
Share on other sites

Вышла новая версия . попрошу всем скачать . ( исправлены ошибки )

 

Качаем https://yadi.sk/d/X2ib3VKCeEMqj

 

Заменяем все файлы , + кидаем файл player_murderMenu.sqf   Куда вам угодно . ( в папке MPMission) и меняем путь к нему в compile.sqf

call compile preprocessFileLineNumbers ""+ВАШ ПУТЬ+"\player_murderMenu.sqf";

Шаг с player_murderMenu  Не обязательно . 

Хуже работает с обновлением так сказать , как и панелька что в торговле показывает часто убит by nil хотя убивает игрок + дистанция тоже не точная убиваешь с 40+ метр пишет 400+

Edited by Dimitri (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Akie
      Никак не могу разобраться как заставить ВАИ выводить миникарту при старте миссии, скрипт есть, просто как заставить его выводить её не могу понять, подскажите пожалуйста господа. Знаю что сообщения выводятся через mission_winorfail.sqf, но как оттуда сделать вызов вариабла сообщения я не знаю.
    • By Sancezz063
      Ребят привет!
      У меня вопрос, возможно ли сделать оповещения о входе в определенную зону ? Ну допустим чтобы он заходил в Солнечный, и ему писало, вы в Солнечном. И потом понаставить таких зон несколько, а не одну.

      Заранее спасибо!
    • By DrTauren
      Собственно, из названия понятно что данный скрипт выводит на экран игрока оповещения о рестарте.


      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
       
      Что нам понадобится:

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
      Или скачать архив по ссылке
       
      Инструкция:
      1) Качаем архив и распаковываем его
      2) Открываем файл init.sqf, находящийся в папке Exile.MapName в скачанном архиве и его содержимое копируем в низ вашего init.sqf
      3) Открываем файл description.ext, находящийся в папке Exile.MapName в скачанном архиве и его содержимое копируем в низ вашего description.ext
      P.S. если у вас уже есть класс RscTitles, то вместо всего блока просто добавьте в уже существующий класс эту строку:
      #include "scarCODE\restartWarnings\hpp\RscDisplayRestartWarnings.hpp" 4) Скопировать папку scarCode в папку с вашей миссией

      Думаю этот простенький скрипт нужен на абсолютно каждом публичном сервере 
    • By pekar0201
      Как можно пофиксить сообщения об убийствах?
      Стандартные почти вообще не работают.
      Эти - https://epochmod.com/forum/topic/28650-release-fixed-killdeath-messages/
      работают через раз.
      Эти - https://epochmod.com/forum/topic/18327-release-custom-kill-messages/
      работают когда им хочется.

      В общем, как быть, и что с ними делать???
      Возможно даже куплю фикс, но не дорого :))
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.