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
Sign in to follow this  
TheFirstNoob

[1.0.6] Даем деньги за убийство игроков/зомби

Recommended Posts

Описание: Дает определенное количество денег за убийство игроков и/или зомби
Автор: oldmatechoc (Epochmod.com)
Оригинал: 

https://epochmod.com/forum/topic/43898-kill-coin-rewards/


Потребуется:
ОБЯЗАТЕЛЬНО:
Монетная валюта (ZSC!)
1. сompiles.sqf (из dayz_code\init)
2. local_eventKill.sqf (из dayz_code\compile) - Если даем зомби
3. player_death.sqf (из dayz_code\compile) - Если даем игроку
P.S. Иные файлы где используются выше сказанные. Например: infistar (AH.sqf)

Установка (За убийство Зомби):
1.
Поменять путь до файла local_eventKill.sqf в сompiles.sqf
Найти:

local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf";

Заменить (Поменять на свое!):

local_eventKill = compile preprocessFileLineNumbers "Ваш путь (Например Fixes)\local_eventKill.sqf";


2. Заменить содержимое файла local_eventKill.sqf на это:

//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_killer","_humanity","_coins"];

_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;

if (local _zed) then {
	_kills = _killer getVariable[_type,0];
	_killer setVariable[_type,(_kills + 1),true];

	//increase players humanity when zed killed
	_humanity = _killer getVariable["humanity",0];
	_humanity = _humanity + 5;
	_killer setVariable["humanity",_humanity,true];
	
	//add coins to player for zed kills
	_coins = _killer getVariable [Z_moneyVariable,0];
	_coins = _coins + 250;			// МЕНЯЕМ КОЛИЧЕСТВО ДЕНЕГ НА СВОЕ!
	_killer setVariable[Z_moneyVariable,_coins,true];
};

Готово!

 

Установка (За убийство Игроков):
1.
Поменять путь до файла player_death.sqf в сompiles.sqf
Найти:

player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";

Заменить (Поменять на свое!):

player_death = compile preprocessFileLineNumbers "Ваш путь (Например Fixes)\player_death.sqf";


2. Заменить содержимое файла player_death.sqf на это:

private ["_killer","_coins","_ammo","_body","_distance","_infected","_playerID","_sourceName","_sourceWeapon","_sourceVehicleType","_isBandit","_punishment","_humanityHit","_myKills","_kills","_killsV","_display","_myGroup","_camera","_deathPos","_animState","_animStateArray","_animCheck","_source","_method","_realSource"];

if (deathHandled) exitWith {};
deathHandled = true;

// Get reference to player object before respawn into new unit (respawnDelay=0 in description.ext)
if (typeName (_this select 0) == "ARRAY") then {
	_body = (_this select 0) select 0;
	_source = (_this select 0) select 1;
} else {
	_body = player;
	_source = _this select 0;
};

_deathPos = getPos _body;
_playerID = getPlayerUID player;

//Switch view to camera so player does not see debug plains at respawn_west
_camera = "camera" camCreate _deathPos;
_camera camSetDir 0;
_camera camSetFOV 1;
_camera cameraEffect ["Internal","TOP"];
_camera camSetTarget _deathPos;
_camera camSetPos [_deathPos select 0, (_deathPos select 1) + 2, 5];
_camera camCommit 0;

//SetDamage immediately so Arma registers the player as dead and respawns them into new unit
player setDamage 1;

if (dayz_onBack != "") then {
	_body addWeapon dayz_onBack;
};

//Get killer information immediately. Weapon, distance or vehicle can change in seconds.
_infected = if (r_player_infected && DZE_PlayerZed) then {1} else {0};
_sourceName = "unknown";
_sourceWeapon = "";
_distance = 0;

_method = switch true do {
	case (_this select 1 != "find"): {_this select 1}; //Manually passed method
	case (dayz_lastDamageSource != "none" && diag_tickTime - dayz_lastDamageTime < 30): {dayz_lastDamageSource}; //Major event takes priority for cause of death (zombie, melee, shot, fell, etc.)
	case (dayz_lastMedicalSource != "none" && diag_tickTime - dayz_lastMedicalTime < 10): {dayz_lastMedicalSource}; //Starve, Dehyd, Sick
	default {"bled"}; //No other damage sources in last 30 seconds
};
_ammo = if (count _this > 2) then {_this select 2} else {""};

if (!isNull _source) then {
	if (!isNull _body) then {
		_distance = round (_body distance _source);
	};
	
	_sourceVehicleType = typeOf (vehicle _source);
	_sourceWeapon = currentWeapon _source;
	_sourceWeapon = switch true do {
		case (_ammo in ["PipeBomb","Mine","MineE"]): {_ammo};
		case ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0): {_sourceVehicleType};
		case (_sourceWeapon == "Throw"): {(weaponState _source) select 3};
		default {_sourceWeapon};
	};
	
	if (alive _source) then {
		_sourceName = if (isPlayer _source) then {name _source} else {"AI"};
	} else {
		if (_source == _body) then {_sourceName = dayz_playerName;};
	};
};

//Send Death Notice
diag_log format["Player_Death: Body:%1 BodyName:%2 Infected:%3 SourceName:%4 SourceWeapon:%5 Distance:%6 Method:%7",_body,dayz_playerName,_infected,_sourceName,_sourceWeapon,_distance,_method];
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,toArray dayz_playerName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,_method]; //Send name as array to avoid publicVariable value restrictions
publicVariableServer "PVDZ_plr_Death";

_body setVariable ["deathType", if (_method == "suicide") then {"shot"} else {_method}, true];

if (!local _source && isPlayer _source && !(_body isKindOf "PZombie_VB")) then { //If corpse is a player zombie do not give killer a human or bandit kill
	//Values like humanity which were setVariabled onto player before death remain on corpse.
	_isBandit = (_body getVariable["humanity",0]) <= -2000;
	//_isBandit = (typeOf _body in ["Bandit1_DZ","BanditW1_DZ"]);
	
	//if you are a bandit or start first - player will not recieve humanity drop
	_punishment = (_isBandit or {_body getVariable ["OpenTarget",false]});
	_humanityHit = 0;
	_realSource = effectiveCommander vehicle _source;

	if (!_punishment) then {
		//I'm "not guilty" - kill me and be punished
		_myKills = (_body getVariable ["humanKills",0]) * 33.3;
		// how many non bandit players have I (the dead player) killed?
		// punish my killer 2000 for shooting a surivor
		// but subtract 500 for each survivor I've murdered
		_humanityHit = -(2000 - _myKills);
		_kills = _realSource getVariable ["humanKills",0];
		_realSource setVariable ["humanKills",(_kills + 1),true];
		PVDZ_send = [_realSource,"Humanity",[_humanityHit,300]];
		publicVariableServer "PVDZ_send";
	} else {
		// im guilty kill me as bandit
		_killsV = _realSource getVariable ["banditKills",0];
		_realSource setVariable ["banditKills",(_killsV + 1),true];
	};
	
		//Player kill rewards
		_killer = _realSource;
		_coins = _killer getVariable [Z_moneyVariable,0];
		_coins = _coins + 250;		// МЕНЯЕМ КОЛИЧЕСТВО ДЕНЕГ НА СВОЕ!
		_killer setVariable[Z_moneyVariable,_coins,true];
		PVDZ_send = [_killer,Z_moneyVariable,[_coins,250]];
		publicVariableServer "PVDZ_send";
		
	//Setup for study bodys.
	_body setVariable ["KillingBlow",[_realSource,_punishment],true];
};

disableSerialization;

//Prevent client freezes
_display = findDisplay 49;
if (!isNull _display) then {_display closeDisplay 0;};
if (dialog) then {closeDialog 0;};
if (visibleMap) then {openMap false;};

disableUserInput true;

[_body,20,true,_deathPos] call player_alertZombies;
if (dayz_soundMuted) then {call player_toggleSoundMute;}; // hide icon before fadeSound
0.1 fadeSound 0;

_body setVariable ["NORRN_unconscious", false, true];
_body setVariable ["unconsciousTime", 0, true];
_body setVariable ["USEC_isCardiac",false,true];
_body setVariable ["medForceUpdate",true,true];
_body setVariable ["bloodTaken", false, true];
_body setVariable ["startcombattimer", 0]; //remove combat timer on death
_body setVariable ["inCombat", false, true];
r_player_unconscious = false;
r_player_cardiac = false;
dayz_autoRun = false;

terminate dayz_musicH;
terminate dayz_slowCheck;
terminate dayz_monitor1;

//Reset (just in case)
//deleteVehicle dayz_playerTrigger;
//disableUserInput false;
r_player_dead = true;

//Player is dead!
3 fadeSound 0;

dayz_originalPlayer enableSimulation true;
addSwitchableUnit dayz_originalPlayer;
setPlayable dayz_originalPlayer;
selectPlayer dayz_originalPlayer;

_myGroup = group _body;
[_body] joinSilent dayz_firstGroup;
deleteGroup _myGroup;

80000 cutText ["","PLAIN"]; //Clear group tags
3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];

_body setVariable["combattimeout", 0, true];

_animState = toLower (animationState _body);
_animStateArray = toArray _animState;
_animCheck = toString ([(_animStateArray select 0),(_animStateArray select 1),(_animStateArray select 2),(_animStateArray select 3)]);
if ((_body == (vehicle _body)) && {_animState != "deadstate" && {_animCheck != "adth"}}) then { //fix running corpses - death anims begin with Adth
	[nil, _body, rSWITCHMOVE, ""] call RE;
	_body SWITCHMOVE "";
	PVDZ_plr_SwitchMove = [_body,""];
	publicVariableServer "PVDZ_plr_SwitchMove";
};

[_body,_camera,_deathPos] spawn {	
	_body = _this select 0;
	_camera = _this select 1;
	_deathPos = _this select 2;
	
	waitUntil {camCommitted _camera};
	_camera camSetPos [_deathPos select 0, (_deathPos select 1) + 2, 15];
	_camera camCommit 4;
	uiSleep 5;
	
	1 cutRsc [if (DZE_DeathScreen) then {"DeathScreen_DZE"} else {"DeathScreen_DZ"},"BLACK OUT",3];
	playMusic "dayz_track_death_1";
	uiSleep 2;

	for "_x" from 5 to 1 step -1 do {
		titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
		uiSleep 1;
	};

	PVDZ_Server_Simulation = [_body, false];
	publicVariableServer "PVDZ_Server_Simulation";
	
	_camera cameraEffect ["Terminate","BACK"];
	camDestroy _camera;

	endMission "END1";
};

Готово!

ВАЖНО!

Не забываем менять пути до файлов в других скриптах. Например InfiSTAR (AH.sqf)

Данный гайд подойдет и для Epoch 1051 если сделать о-о-очень маленькие корректировки.
Просто смотрите на переменную, отвечающую за деньги
Z_MoneyVariable и в каком месте надо прописывать.

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
Sign in to follow this  

  • Similar Content

    • By Jdinovich
      Добрый вечер,может кто-нибудь встречал такой скрипт что дает игроку определенное количество денег за час онлайна на сервере,у кого есть, кто может поделиться?
    • By Sovest2
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

      Подготовка
      Для начала нам понадобится подключить кастомный player_death.sqf в compiles.sqf
      Делается это следующим образом:
      В compiles.sqf заменить строку 
      player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf"; на
      player_death = compile preprocessFileLineNumbers "*ВАШ ПУТЬ*\player_death.sqf";  
      Если у вас стоит инфистар,то необходимо заменить строку в AH.sqf
      _death = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_death.sqf'; на
      _death = compile preprocessFileLineNumbers '*ВАШ ПУТЬ*\player_death.sqf';  
      В вашем кастомном player_death.sqf необходимо заменить 
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (player getVariable["humanity",0]) <= -2000; _punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop _humanityHit = 0; if (!_punishment) then { //i'm "not guilty" - kill me && be punished _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000; _humanityHit = -(2000 - _myKills); _kills = _source getVariable ["humanKills",0]; _source setVariable ["humanKills",(_kills + 1),true]; PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]]; publicVariableServer "PVDZE_send"; } else { //i'm "guilty" - kill me as bandit _killsV = _source getVariable ["banditKills",0]; _source setVariable ["banditKills",(_killsV + 1),true]; }; }; _body setVariable ["deathType",_method,true]; }; на
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { [player,_source]execVM "*ВАШ ПУТЬ*\humanityChange.sqf"; [player,_source]execVM "*ВАШ ПУТЬ*\kill_msg_send.sqf"; }; _body setVariable ["deathType",_method,true]; }; Отображение ника убийцы(Kill message)
       
      Создаем файл и закидываем в миссию файл kill_msg_send.sqf
      С содержанием
      private ["_victim","_killer","_vehicle","_weapon","_pic"]; _victim = _this select 0; _killer = _this select 1; _killerName = name _killer; _victimName = name _victim; _vehicle = typeOf (vehicle _killer); _weapon = currentWeapon _killer; if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR","AllVehicles"]) then { _pic = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture'); } else { _pic = gettext(configFile >> 'cfgWeapons' >> _weapon >> 'picture'); }; _kill_txt = format ["<t align='left' size='0.5'>%1 </t>",_victimName]; _kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%1'/>",_pic]; _kill_txt = _kill_txt + format ["<t align='left' size='0.5'> %1 </t>",_killerName]; PVDZE_send = [player,"kill_message",[_kill_txt]]; publicVariableServer "PVDZE_send";  
      Далее,нам необходимо отредактировать файл server_sendToClient.sqf ,которой находится в директории сервера
      И добавить после
      case "tagFriendly": { PVDZE_plr_FriendRQ = _arraytosend; _owner publicVariableClient "PVDZE_plr_FriendRQ"; }; Это
      case "kill_message": { custom_kill_message_show = _arraytosend; publicVariable "custom_kill_message_show"; }; Теперь необходимо создать файл kill_msg_show.sqf в папке с вашей миссией
      с содержимым
      private ["_pos","_i"]; arr_kill = ["","","","","",""]; fnc_kill_message = { private ["_finaltxt"]; _finaltxt = _this select 0; for[{_i = 0},{(_i<6)},{_i = _i +1}] do { if((arr_kill select _i) == "") then { arr_kill set [_i,_finaltxt]; [_i] execVM "*ВАШ ПУТЬ*\kill_msg_delete.sqf"; _i = count(arr_kill); }; }; }; "custom_kill_message_show" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;}; while {true} do { _pos = 0.01; _layout = 1001; { [_x,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + _pos * safezoneH,0.3],5,0.5,0,_layout] spawn BIS_fnc_dynamicText; _pos = _pos + 0.021; _layout = _layout + 1; } ForEach arr_kill; sleep 1; }; Создать файл kill_msg_delete.sqf с 
      private["_pos"]; _pos = _this select 0; sleep 10; arr_kill set [_pos,""];  
      И вставить в init.sqf после строки
      _playerMonitor = [] execVM "custom\player_monitor.sqf"; строку
      execVM "*ВАШ ПУТЬ*\kill_msg_show.sqf"; Осталось только добавить
      custom_kill_message_show В первую строку файла publicvariable.txt
       
      Все,отображение ника убийцы готово!
       
       
      Изменение человечности за убийство Бандита\Героя
      создать файл humanityChange.sqf с содержимым
      private ["_victim","_killer","_myKills","_humanity","_killerHumanity","_isKillerBandit","_isBandit","_humanityHit","_kills","_killerGunner"]; _victim = _this select 0; _killer = _this select 1; _humanity = _victim getVariable["humanity",0]; _killerHumanity = _killer getVariable["humanity",0]; _isKillerBandit = (_killerHumanity) < 0 ; _isBandit = (_humanity) < 0; _humanityHit = 0; _myKills = 0; _killerVehicle = vehicle _killer; if(((!_isBandit) && _isKillerBandit) || (_isBandit && (!_isKillerBandit))) then { _myKills = round((_humanity) / 10); }; if(!_isBandit) then { _myKills = (_myKills + 200); _kills = _killer getVariable ["humanKills",0]; _killer setVariable ["humanKills",(_kills + 1),true]; } else { _myKills = (_myKills - 200); _kills = _killer getVariable ["banditKills",0]; _killer setVariable ["banditKills",(_kills + 1),true]; }; _killerGunner = gunner _killerVehicle; if(!isNil"_sourceGunner") then { _killer = _killerGunner; }; _humanityHit = _myKills * (-1); PVDZE_send = [_killer,"Humanity",[_killer,_humanityHit,300]]; publicVariableServer "PVDZE_send"; Изменение Человечности готово!
       
      Плюсы Всего этого:
      Отображение ника убийцы теперь работает всегда и корректно.(Если убивают с техники или с одного выстрела).
    • By porch
      ребята помогите плис у меня такая проблема при пере заходе пропадают деньги со счёта
      за ране Вам спасибо.
    • By Atavis
      Здорова всем. Столкнулся с проблемой, при заходе нового игрока ему выдается 2500 хотя в configuration.sqf указано 30000. Может кто то сталкивался с таким?
       
      Altis life 3.1.4.8
    • By ZERONE
      Не сохраняются деньги в сейфах,после рестарта пропадают.Стоит ZSC 3.0.Мб есть где фикс искать?
  • 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.