PVE Prison punish after a kill

Discussion in 'Script/Addon releases' started by Rite, Jan 16, 2015.

  1. Rite

    Rite Member

    Joined:
    Oct 21, 2013
    Messages:
    47
    Likes Received:
    4
    Difficulty Medium

    What you need

    -Knowledge of Scripting
    -dayz_server.pbo
    -Mission folder

    What does it do?
    Punishment for the PVE killers.
    They will sent to prison and must stay there for 10 minutes.
    If they escape it will result in death !
    After 10 minutes they will be released and put in front of the gate.


    I Have the DZE Piggd Banking System

    So after a kill they loose 1 briefcase money
    after escape from prison and if they end up death they loose 2 briefcases.

    If you don't have DZE Piggd Banking System remove the parts in "escapekill.sqf" that are highlighted in the files with //DZE Piggd Banking System
    And adjust the messages like you want to have them.


    Server side.


    Place this
    "Special thanks to Vampire and seelenapparat for this code!"
    Code:
    
    if ((side _killer) == EAST) exitwith {
        diag_log "Bots dont go to jail!";
    };
    
    if ((side _killer) == WEST) then {
        sleep 8;
       [_killer] execVM "custom\jail\start_punish.sqf"
    } else {
       if (((count crew _killer) > 1) && ((side _killer) == WEST)) then {
         if (((gunner _killer) in (crew _killer)) && ((side _killer) == WEST)) then {
            sleep 8;
           [(gunner _killer)] execVM "custom\jail\start_punish.sqf"
         } else {
            sleep 8;
           [(driver _killer)] execVM "custom\jail\start_punish.sqf"
         };
       } else {
            sleep 8;
            [(driver _killer)] execVM "custom\jail\start_punish.sqf"
       };
    };
    
    at the bottom in your server_playerDied.sqf

    The Prison in this script was made by MaxPowers.
    http://epochmod.com/forum/index.php?/topic/6391-pavlovo-prison

    add the prison.sqf to your custom maps
    and add this to your server_functions.sqf at the bottom
    Code:
    call compile preProcessFileLineNumbers "\z\addons\dayz_server\CUSTOMMAPS\prison.sqf";
    
    pack your server.pbo

    Mission folder.

    add these 2
    Code:
    class Vehicles
    
        {
            items=4; // add + 1
            class Item3 // your follow up number
            {
                position[]={1348.44,339,4065.91};
                azimut=182.39052;
                id=53;
                side="EMPTY";
                vehicle="HeliHEmpty";
                skill=0.60000002;
                text="jail_center_H";
                description="the jail center point";
            };
    
        };
    
    class Markers
        {
            items=29; // add + 1
            class Item28 // your follow up number
                {
                position[]={1348.44,339,4065.91};
                name="Prison";
                text="Prison";
                type="o_mech_inf";
                colorName="ColorRed";
            };
       };
    
    in mission.sqm

    UPLOAD the directory "jail" in your addons in your mission file.

    if you want the messages you have to have "remote_messages" installed

    if you don't then add remote_messages.sqf to your custom directory

    and place this
    Code:
    _nil = [] execVM "custom\remote_messages.sqf";
    in your init.sqf in the (!isDedicated) like below
    Code:
    if (!isDedicated) then {
    _nil = [] execVM "custom\remote_messages.sqf";
    };
    EXTRA POSSIBILITY
    If you dont want them to abort in prison place the Pzone.sqf in your mission directory i have it in my safezone directory.
    Then add this in your init.sqf add the bottom.
    Code:
    [] ExecVM "addons\Safezone\Pzone.sqf";    

    it is activated by the "canbuild" so you cannot abort in a trader city!

    And add this part
    Code:
    class Sensors
       {
            items=14; // add + 1
            class Item13 // your follow up number
               {
                position[]={1348.44,339,4065.91};
                a=100;
                b=100;
                activationBy="WEST";
                repeating=1;
                interruptable=0;
                age="UNKNOWN";
                name="Prison";
                expCond="(player distance Prison) < 100;";
                expActiv="inPZone = true;";
                expDesactiv="canbuild = true;inPZone = false;";
                class Effects
                {
                };
            };
        };
    in your mission.sqm

    If you have a suicide script you can add this
    Code:
    _prison = player distance jail_center_H > 100;
    if (_prison) then {
    below the following in your suicide script in your fn_selfActions.sqf
    Code:
    private ["_handGun"];
    _handGun = currentWeapon player;
    And dont forget to close it with a extra bracket };


    Thats it.

    Let's punish those PVE killers

     
    Last edited: Sep 2, 2015
    DangerRuss likes this.

Share This Page