Jump to content
Joshyy

[Release] Trader Kill Notification - 1.0.6

Recommended Posts

If a player is killed within a defined range from a trader there will be a chat message notifying everyone so they can be punished.

 

Step 1:

Make a copy of player_death.sqf in your mission file and change the path in your compiles.sqf

 

Step 2:

Define your trader areas by making an array with the trader position, range, and trader name

DZE_tradersarray = [

// [[position],range,"tradername"],

// [[position],range,"tradername"] -- Don't forget the last one doesn't have a , at the end!

];

Example:

Spoiler

DZE_tradersarray     = [
    [[4064,11665,0],510,"Trader city Bash"], // 510 = range from trader where the notification will check if the killer or victim is within. (in meters)
    [[6326,7809,0],510,"Trader city Stary"],
    [[11447,11364,0],510,"Trader city Klen"],
    [[12944,12766,0],510,"Hero camp"],
    [[1606,7803,0],510,"Bandit camp"],
    [[12060,12638,0],510,"Aircraft dealer"],
    [[3096,3469,0],510,"Trader city Bor"]
];

Put this in your init.sqf somewhere at the top or put it inside your configVariables.sqf

Step 3: 

Open your custom player_death.sqf

and find

Spoiler

if (!isNull _source) then {
        if (!isNull _body) then {

Then add this below

 

Spoiler

        {
            private ["_pos","_dis","_loc","_rng","_rnt","_systemchat"];
            _pos = _x select 0;
            _dis = _x select 1;
            _loc = _x select 2;

           _playerName = name _source;
            _rng = ((getPos _body) distance _pos); // Get victim position from trader
            _rnt = ((getPos _source) distance _pos); // Get attacker position from trader
            if (_rnt <= _dis) exitWith { // Check if victim was in trader range
                _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,dayz_playerName,_killerName,_rng,_loc];
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
            if (_rng <= _dis) exitWith { // Check if killer was in trader range
                _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,dayz_playerName,dayz_playerName,_rng,_loc];
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
        } forEach DZE_tradersarray;

 

The whole block should look like

Spoiler

    if (!isNull _source) then {
        if (!isNull _body) then {
        {
            private ["_pos","_dis","_loc","_rng","_rnt","_systemchat"];
            _pos = _x select 0;
            _dis = _x select 1;
            _loc = _x select 2;

           _playerName = name _source;


            _rng = ((getPos _body) distance _pos); // Get victim position from trader
            _rnt = ((getPos _source) distance _pos); // Get attacker position from trader
            if (_rnt <= _dis) exitWith { // Check if victim was in trader range
                _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,dayz_playerName,_killerName,_rng,_loc];
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
            if (_rng <= _dis) exitWith { // Check if killer was in trader range
                _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,dayz_playerName,dayz_playerName,_rng,_loc];
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
        } forEach DZE_tradersarray;
            _distance = round (_body distance _source);
        };
        _sourceVehicleType = typeOf (vehicle _source);
        _sourceWeapon = if (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") then {_sourceVehicleType} else {currentWeapon _source};
        if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
        if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;};
        if (alive _source) then {
            _sourceName = if (isPlayer _source) then {name _source} else {localize "STR_PLAYER_AI"};
        };
    };

 

Note: This is compatible with 1.0.5.1

 

Comment if you have any problems!

Share this post


Link to post
Share on other sites

The person getting killed gets kicked for

Value Restriction #0 "remExField" = [,,"spawn",["(Server): TRADER KILL! any killed any when any was 224.19m from Trader city Stary"],{systemChat (_this select 0)}]

Turn off battleye and it works except the message reads "TRADER KILL! any killed any when any was xxxxx from trader city"

Its not picking up the name of either player.

Share this post


Link to post
Share on other sites
On 23/01/2017 at 0:18 AM, lwbuk said:

The person getting killed gets kicked for

Value Restriction #0 "remExField" = [,,"spawn",["(Server): TRADER KILL! any killed any when any was 224.19m from Trader city Stary"],{systemChat (_this select 0)}]

Turn off battleye and it works except the message reads "TRADER KILL! any killed any when any was xxxxx from trader city"

Its not picking up the name of either player.

You can use a remote message script, those shouldn't cause BE kicks.

as for the name, make sure _killerName and _victimName are defined (_killerName = name _source;_victimName = name player;) << add this above the script somewhere

 

Edit: updated OP with fix

 

Share this post


Link to post
Share on other sites

@Joshyy if possible rcognize the killer as an unique entity?

cuz a great punish will be attach this player to a big stick in the middle of stary trader :D

using something like

_stick createvehicle......................

_killer  attachTo [_stick, [2, 2, 0]];

sleep 60;
detach _killer;

 

Share this post


Link to post
Share on other sites

player_death.sqf  (this one works)

Spoiler
private ["_pos","_display","_body","_playerID","_array","_source","_method","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup","_model","_infected","_distance","_sourceVehicleType","_sourceWeapon","_sourceName","_ammo"];
disableSerialization;
if (count _this == 0) then {
	//Spawned from Killed EH (engine death), this should be rare
	//Wait to see if sched_medical 1s loop spawns with _source and _method (blood<=0 death)
	uiSleep 1;
};
if (deathHandled) exitWith {};
deathHandled = true;

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

_body = player;
_playerID = getPlayerUID player;
disableUserInput true;

//add weapon on back to player
if (dayz_onBack != "") then {
	//Add weapon on back to body.
	_body addWeapon dayz_onBack;
    /*
	//Add weapon on back to the ground.
	_pos = _body modeltoWorld [1,1,0];
	//_pos set [2, 0];
    _item = createVehicle ["WeaponHolder", _pos, [], 0.0, "CAN_COLLIDE"];
    _item setPosATL [_pos select 0, _pos select 1, ((_pos select 2) + 0.1)];
    _item addWeaponCargoGlobal [dayz_onBack,1];
	*/
};
_infected = if (r_player_infected && DZE_PlayerZed) then {1} else {0};
_method = "unknown";
_sourceName = "unknown";
_sourceWeapon = "";
_distance = 0;
if (count _this > 0) then {
	_source = _this select 0;
	_method = _this select 1;
	_ammo = if (count _this > 2) then {_this select 2} else {""};
	
	if (!isNull _source) then {
		if (!isNull _body) then {
		     {
            private ["_pos","_dis","_loc","_rng","_rnt","_systemchat"];
            _pos = _x select 0;
            _dis = _x select 1;
            _loc = _x select 2;
			_killerName = name _source;
		   _victimName = name player; 

           _playerName = name _source;
            _rng = ((getPos _body) distance _pos); // Get victim position from trader
            _rnt = ((getPos _source) distance _pos); // Get attacker position from trader
            if (_rnt <= _dis) exitWith { // Check if victim was in trader range
             
			    _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,_victimName,_killerName,_rng,_loc];// this line are working. save the file, repack and try again
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
            if (_rng <= _dis) exitWith { // Check if killer was in trader range
                _systemchat = format["(Server): TRADER KILL! %1 killed %2 when %3 was %4m from %5",_killerName,dayz_playerName,dayz_playerName,_rng,_loc];
                [nil, nil, rspawn, [_systemchat], {systemChat (_this select 0)}] call RE;
            };
        } forEach DZE_tradersarray; 
		
		_distance = round (_body distance _source);
		};
		_sourceVehicleType = typeOf (vehicle _source);
		_sourceWeapon = if (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") then {_sourceVehicleType} else {currentWeapon _source};
		if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
		if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;};
		if (alive _source) then {
			_sourceName = if (isPlayer _source) then {name _source} else {localize "STR_PLAYER_AI"};
		};
	};
};

//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,toArray _method]; //Send name as array to avoid publicVariable value restrictions
publicVariableServer "PVDZ_plr_Death";

_id = [player,20,true,getPosATL player] call player_alertZombies;
uiSleep 0.5;
player setDamage 1;
if (dayz_soundMuted) then {call player_toggleSoundMute;}; // hide icon before fadeSound
0.1 fadeSound 0;

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

_array = _this;
if (count _array > 0) then {
	_source = _array select 0;
	_method = _array select 1;
	if (!local _source && isPlayer _source) then {
		_isBandit = (player getVariable["humanity",0]) <= -2000;
		//_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]);
		
		//if you are a bandit or start first - player will not recieve humanity drop
		_punishment = ((_isBandit or {player getVariable ["OpenTarget",false]}) && !(player isKindOf "PZombie_VB"));
		_humanityHit = 0;

		if (!_punishment) then {
			//I'm "not guilty" - kill me and be punished
			_myKills = (player 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 = _source getVariable ["humanKills",0];
			_source setVariable ["humanKills",(_kills + 1),true];
			PVDZ_send = [_source,"Humanity",[_humanityHit,300]];
			publicVariableServer "PVDZ_send";
		} else {
			//i'm "guilty" - kill me as bandit
			_killsV = _source getVariable ["banditKills",0];
			_source setVariable ["banditKills",(_killsV + 1),true];
		};
		
		//Setup for study bodys.
		_body setVariable ["KillingBlow",[_source,_punishment],true];
	};
	_body setVariable ["deathType",_method,true];
};

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;
uiSleep 1;

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 icons

3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];

_body setVariable["combattimeout", 0, true];
//due to a cleanup issue with effects this has been disabled remember to look at the cleanup before adding it back.
//dayzFlies = player;
//publicVariable "dayzFlies";
uiSleep 2;
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";

endMission "END1";

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By EditedSnowHD
      Hallo all,
      First I want to say i'm not the owner of this server. I just really like the server! Why?
      Well it reminds me of the good old days, and it has an 'OG Epoch feeling'. This is because the map isn't edited and the loot is really balanced. 
      You can't just join, get 25000 coins and start shooting with a tank. It's not like those servers. Ow and another thing, if you open up a map, you won't see like 300 activities all going on at once, not turbid at all. 
      The server also uses the original silver/gold system and everything you find/build/shoot feels really rewarding. 
      The addons added to the server really add something special to the experience on the server, and not distract you from the original feeling.
      I have just played for a few days on the server, and there a few standard players (and the owner is really kind!). But we're still looking to share this amazing experience with other people who might be searching for the 'OG Epoch feeling'.
      Already sold? Here is the Server IP: 78.143.13.42 port: 2302 , Server name: [EU][PvP] GGWEZ DayZ Epoch Chernarus - FreshDB | HC | Gemcrafting
      Link to loading screen and rules: https://imgur.com/a/kIsfXaX

      Features:
      Deploy Bike (old bike).
      Gem Crafting (static Weapons, decorations and more).
      AI Base.
      Custom Vehicles.
      Missions.
      Indestructible bases.
      Take Clothes.
      Spawn Selection.
      Custom Economy and Loot (Really well balanced IMO).
      Lift object with heli.
      Custom Trader City (Really cozy).
      Refuel at gasstation.
      Dogs.
      Street, -Buildinglights (for at night).
      and much more!
      Mods:
      @Epoch
      There also is a Discord channel where you can meet up and share info (like about the AI base or player builds).
      Discord: discord.gg/M6w2fun
      Staff: Drashyy & Mfkrp9 & EditedSnow
      If you have any more questions, feel free to contact me! Hope to see you in Chernarus.
      Edit 10-05-2020: I'm now part of the staff! Im a moderator on their discord.

       
       
    • By THAC0_Gewch
      https://github.com/OlofTheBald/DayZ-Humanity-Loadout-Granter/tree/Epoch_1.0.5.1
       
      Updated for 1.0.6.x
    • By MysteryGamersElite
      [EU/UK] SDF Epoch|Wiped April 1st|FPS++|WAI & DZMS|SSD|Coins|Hourly Paycheck|Custom Loot| AND MORE....
      BRAND NEW DATABASE + SERVER 1st APRIL 2020!
      Server IP: 164.132.67.27:2302
      Discord: https://discord.gg/BWJCjTe
      We offer 24 hour support via discord for any questions or issues with your game!
      Top Server Feature List:
      - Modded DZMS and WAI Mission System
      - Custom High Loot Tables and Improved Dynamic Vehicle Spawns
      - Paycheck Every Hour
      - Coin Based Currency with Storage Banking only
      - Deploy Bike & Mozzie
      - Locate Vehicle
      - Snap Build Pro
      - Group Management
      - Repair, Refuel and Rearm at Service Stations
      - Vehicle Key Changer
      - infiSTAR AntiHack
      - Virtual Garage
      - Change View Distance with Binoculars
      - 3 Hour Restarts starting from Midnight GMT
      - Garage Door Opener
      - Take Clothes
      - Indestructible Bases except doors
    • By Vitor99
      Hi everyone, i would like to know if there is any torrent links for Epoch and Overpoch, if you know some send me the link here
    • By Reaper5150
      Simple but fun little script I put together awhile ago.
      What it does? It is bound to a object in this case "ItemObsidian" as a right click, but can be changed to whatever you want. It then will sends out a message to the players on the server and marks the player with red smoke and a marker on the map.
      The player will then get 2 mins of god mod acting like the amour. Once the amour takes damage (All it is is a countdown timer really) The god mode is then disabled so they can be killed.
      I'm still working on this and will update it when it is done. If any of you better scriptwriters then myself ( I'm still a noob lol) have any ideas on how to improve this? contact me so I can give you credit in the update :)
      Known bugs:
      marker sometimes stays on map Credits to : @Schalldampfer  For helping me understand map markers
      Install: Place this in your scripts folder name it something like Jugg.sqf
      //========================================================
      //========= Juggernaut script-Written by Reaper5150 ===========
      //=======================================================
      sleep 2;
      [nil,nil,rTitleText,"THERE IS A JUGGERNAUT,FIND HIM AND KILL HIM IF YOU CAN!!!","PLAIN",3] call RE;
      sleep 1;
      [nil, player, rSAY, "YOURSOUND.OGG", 100] call RE; //Add your custom sound here when Juggernaut spawns 
      [] spawn {
      player removeMagazine 'ItemObsidian';//Add whatever object you want and bound to your right click function
      sleep 5;
      [nil,nil,rTitleText,"THE JUGGERNAUT HAS BODY ARMOR,WE CAN'T KILL HIM...HELP!!!","PLAIN",3] call RE;
      ////////Set marker/////////////////////////////////////////////////////////////////////
      [] execVM "scripts\marker.sqf";
      //Start Smoke Marker//////////////////////////////////////////////////////////////////////////
      sleep 5;
      PJ_grenade = "SmokeShellRed" createVehicle position player;
      PJ_grenade attachto [vehicle player,[0.1,0,0]];
      sleep 2;
      [nil,nil,rTitleText,"THE JUGGERNAUT (PLAYER) HAS BEEN MARKED WITH SMOKE AND ON THE MAP!!!","PLAIN",3] call RE;
       
      //Temp Godmode for 2 mins////////////////////////////////////////////////////
      (vehicle player) removeAllEventHandlers "handleDamage";
      (vehicle player) addEventHandler ["handleDamage", { false }];    
      (vehicle player) allowDamage false;
       
      //Acts like a countdown timer//////////////////////////////////////////////////////////////////
      sleep 90;
      [nil,nil,rTitleText,"THE JUGGERNAUTS ARMOR HAS TAKEN 30% DAMAGE","PLAIN",3] call RE;
      sleep 100;
      [nil,nil,rTitleText,"THE JUGGERNAUTS ARMOR HAS TAKEN 50% DAMAGE","PLAIN",3] call RE;
      sleep 110;
      [nil,nil,rTitleText,"THE JUGGERNAUTS ARMOR HAS TAKEN 90% DAMAGE","PLAIN",3] call RE;
      uiSleep 120;
      [nil,nil,rTitleText,"THE JUGGERNAUTS ARMOR IS WEAK...TAKE HIM OUT NOW!!!","PLAIN",3] call RE;
      sleep 2;
       
      //Start ending Juggernaut///////////////////////////////////
      (vehicle player) addEventHandler ["handleDamage", { true }];    
      (vehicle player) removeAllEventHandlers "handleDamage";
      (vehicle player) allowDamage true;
      uiSleep 240;
      deleteVehicle PJ_grenade;
      END;
      Call it from your right click
      ["ItemObsidian","JUGGERNAUT","execVM 'scripts\Jugg.sqf';","true"], 
      marker.sqf:
      _unit = player;
      _nameP = name _unit;
      _markerobjp = createMarker [_namep,[0,0]];
      _markerobjp setMarkerShape "ICON";
      _markerobjp setMarkerType "mil_dot";
      _markerobjp setMarkerColor "ColorRed";
      _markerobjp setMarkerText _nameP;
      _markerobjp setMarkerSize [1,1];

      while {alive _unit} do {
      _markerobjp setmarkerdir (getdir _unit);
      _markerobjp setMarkerPos (getPos _unit);
      _markerobjp setMarkerText _nameP;
      sleep 5;
      };
      ////////////////////////////////////////////
      uiSleep 240;
      deleteMarker _markerobjp;
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...