Jump to content

[Release] PVE Prison punish after a kill


Rythron

Recommended Posts

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.
 
 
https://www.youtube.com/watch?v=cUAkJ5pOCY8
 
I Have the
 
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 & seelenapparat for this 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
 
 
add the prison.sqf to your custom maps   
and add this to your server_functions.sqf at the bottom
call compile preProcessFileLineNumbers "\z\addons\dayz_server\CUSTOMMAPS\prison.sqf";
pack your server.pbo
 
Mission folder.
 
add these 2
 
class Item2
		{
			side="LOGIC";
			class Vehicles
			{
				items=1;
				class Item0
				{
					position[]={-143.93861,0.52647489,2319.5012};
					id=50;
					side="LOGIC";
					vehicle="FunctionsManager";
					leader=1;
					lock="UNLOCKED";
					skill=0.60000002;
				};
			};
		};
	};
	class Vehicles
		{
		items=1;
		class Item0 // 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";
       			 };
		};					
and
 
class Markers
	{
		items=1; //+1
		class Item0
	class Item0 // 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 
_nil = [] execVM "custom\remote_messages.sqf";
 
in your init.sqf  in the (!isDedicated) like below
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.
[] ExecVM "addons\Safezone\Pzone.sqf";    
 
 
it is activated by the "canbuild" so you cannot abort in a trader city!
 
And add this part
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 
_prison = player distance jail_center_H > 100;
if (_prison) then {
below the following in your suicide script in your fn_selfActions.sqf
private ["_handGun"];
_handGun = currentWeapon player;
And dont forget to close it with a extra bracket };
 

Download Files

 
Thats it.
 
Let's punish those PVE killers
 
Greetz  Rythron
Link to comment
Share on other sites

what about PVP servers ???

well howz about combat loggers spawn in the prison....

anyone help with this ??

 

server_onPlayerdisconnect.sqf

 

find

if ((_timeout - time) > 0) then {

_playerObj setVariable["NORRN_unconscious",true, true];
_playerObj setVariable["unconsciousTime",300,true];

below add this

_playerObj execVM "addons\jail\start_punish.sqf"

this is untested and really just a quick  uneducated guess....

 

 

 

 

Link to comment
Share on other sites

 

what about PVP servers ???

well howz about combat loggers spawn in the prison....

anyone help with this ??

 

server_onPlayerdisconnect.sqf

 

find

if ((_timeout - time) > 0) then {

_playerObj setVariable["NORRN_unconscious",true, true];
_playerObj setVariable["unconsciousTime",300,true];

below add this

_playerObj execVM "addons\jail\start_punish.sqf"

this is untested and really just a quick  uneducated guess....

 

 

 

 

 

Great idea  i can try if it works !! let u know 

 

EDIT: no succes so far

Link to comment
Share on other sites

Can someone help me port this to Napf, please?   :(

you can set the coords by yourself in the files and have to build another prison or building. 

I do not know if you put the prison in the Napf map were it is on the map. 

You might have lucky. 

Link to comment
Share on other sites

Hello :) Really nice script, thank you!

So i'm getting a lot of Errors in my .rpt Log, like this:

 

 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error position: <Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error Undefined variable in expression: prison
 1:21:54 File mpmissions\__cur_mp.sauerland\addons\jail\escapekill.sqf, line 8
 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 90};



customRemoteMessage = [>
 1:21:54   Error position: <Prison > 90};



customRemoteMessage = [>
 1:21:54   Error Undefined variable in expression: prison
 1:21:54 File mpmissions\__cur_mp.sauerland\addons\jail\escapee.sqf, line 8
 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error position: <Prison > 105};

Can someone help me out fixing it? 

Thank you :)

p.s. I just created another prison in Editor for Sauerland. The new created Spawnpoints inside of the cells are working fine. This could be a help for you.

Link to comment
Share on other sites

Hello :) Really nice script, thank you!

So i'm getting a lot of Errors in my .rpt Log, like this:

 

 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error position: <Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error Undefined variable in expression: prison
 1:21:54 File mpmissions\__cur_mp.sauerland\addons\jail\escapekill.sqf, line 8
 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 90};



customRemoteMessage = [>
 1:21:54   Error position: <Prison > 90};



customRemoteMessage = [>
 1:21:54   Error Undefined variable in expression: prison
 1:21:54 File mpmissions\__cur_mp.sauerland\addons\jail\escapee.sqf, line 8
 1:21:54 Error in expression <};

sleep 2;

waitUntil {_unit distance Prison > 105};

if ((inJail) && (alive _>
 1:21:54   Error position: <Prison > 105};

Can someone help me out fixing it? 

Thank you :)

p.s. I just created another prison in Editor for Sauerland. The new created Spawnpoints inside of the cells are working fine. This could be a help for you.

did you add the class marker with the name prison in your mission.sqm?

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";
        };   
   };

If you named it different like "jail" instead of prison, you have to change it in the files.

waitUntil {_unit distance Prison > 90};
waitUntil {_unit distance Jail > 90};

escapee.sqf

waitUntil {_unit distance Prison > 105};
waitUntil {_unit distance Jail > 105};

escapekill.sqf

 

Try that

Link to comment
Share on other sites

unfortunatly on our server it does not work correct.

the script itself is fine.

but the problem is: when somebody dies, he sometimes spawns with all his gear and alive next to his body where he died.

so technically the character dupes itself.

any thoughts on that?

 

€: I also get this reported in my server rpt:

 

12:50:58 Error in expression <il {_unit distance Prison > 105};
call dayz_forceSave;
if ((inJail) && (alive _>
12:50:58   Error position: <dayz_forceSave;
if ((inJail) && (alive _>
12:50:58   Error Undefined variable in expression: dayz_forcesave
12:50:58 File mpmissions\DayZ_Epoch_24.Napf\custom\jail\escapekill.sqf, line 10

Link to comment
Share on other sites

Don't know why but after I installed this im getting a popup error.

 Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.
warehouse

I think I understand what its saying, Ive installed a map addon, which included map parts for the prison that arent in my map files (Taviana epoch overwatch origins) 

 

I am guessing this is a cherno map peice,

 

 

What I am asking will adding this to my mission.sqf inside my 

 

addOns[]=
{
...,
...,
...,
"warehouse"
};
 

 

Will this solve the issue or cause more issues? 

Link to comment
Share on other sites

Don't know why but after I installed this im getting a popup error.

 Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.
warehouse

I think I understand what its saying, Ive installed a map addon, which included map parts for the prison that arent in my map files (Taviana epoch overwatch origins) 

 

I am guessing this is a cherno map peice,

 

 

What I am asking will adding this to my mission.sqf inside my 

 

addOns[]=
{
...,
...,
...,
"warehouse"
};
 

 

Will this solve the issue or cause more issues? 

warehouse must be there so you are correct and add it there were you said.

Link to comment
Share on other sites

next problem I noticed:

DZMS and (not 100pro sure) DZAI bots are being punished too, when they kill a player! :D

not sure, how to handle this...

shoulnd't something like this work:

if (side _killer == WEST) then {

...

for determing the player killer.

 

AI is EAST if i remember correct? Players are WEST?

 

DZMS is using DZAI AI and correct i have seen it also happen.

You can try this. 

if (_killer isKindOf "Man"|| side _killer == WEST ) then {
   [_killer] execVM "addons\jail\start_punish.sqf"
} else {
   if ((count crew _killer) > 1) then {
     if ((gunner _killer) in (crew _killer)) then {
       [(gunner _killer)] execVM "addons\jail\start_punish.sqf"
     } else {
       [(driver _killer)] execVM "addons\jail\start_punish.sqf"
     };
   } else {
     [(driver _killer)] execVM "addons\jail\start_punish.sqf"
   };
};

Let me know if it works.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...