Jump to content

[Release] PVE Prison punish after a kill


Rythron

Recommended Posts

Any chance of being able to automatically knock out the offender, fade the screen to black and then fade it back in to show them in the buttsex palace?

it is possible you can try this

killer.sqf

_unit = _this select 0;
_veh = (vehicle _unit);

if (!alive _unit) exitWith {terminate jail;};
inJail=true;

_unit setVariable ["NORRN_unconscious", true, false];


sleep 1;
customRemoteMessage = ['titleCut', "You will be send to Prison for killing a player.", _unit];
publicVariable "customRemoteMessage";
sleep 5;


// These are the Arma 2 air vehicles that have pilot "manual fire" capabilities as well as gunner and passenger seats. 
// If Pilot is jailed for a manual fire team kill - one of the crew will move into the pilot seat.
// This only works for vehicles that have "pilot manaul fire" capabilities. 
// Only modify this part if you have "Addon" air vehicles that you would like to add this feature to, otherwise do not change this.

if ( (driver _veh == _unit) && ((_veh isKindOf "Ka52") OR (_veh isKindOf "Ka52Black") OR (_veh isKindOf "pook_H13_gunship") OR (_veh isKindOf "AH6J_EP1") OR (_veh isKindOf "UH60M_EP1_DZ") OR (_veh isKindOf "Mi17_rockets_RU") OR (_veh isKindOf "Ka60_GL_PMC") OR (_veh isKindOf "AH1Z") OR (_veh isKindOf "AW159_Lynx_BAF")) ) then {
	null = [_unit] execVM "addons\jail\toDriver.sqf";
};



if (_veh != _unit) then {
	doGetOut _unit;
	sleep 0.5;
};
sleep 0.5;

[_unit]execVM "addons\jail\jail.sqf";
 

and jail.sqf

private ["_unit"];

_unit = _this select 0;
_unit setdir 140;
cutText ["","BLACK FADED",5];
_ebayrandomspawn = [[1383.84,4060.98,6.7], [1365.49,4018.96,0.001], [1354.59,4029.89,0.001], [1377.01,4063.66,0.001], [1342.9,4052.88,0.001], [1387.26,4052.39,0.001], [1376.87,4069.25,6.583], [1396.61,4046.41,6.606], [1360.35,4017.93,6.558],
 [1350.47,4029.77,6.557], [1344.58,4041.73,0.001], [1384.24,4055.02,0.001], [1384.24,4055.02,0.001], [1348.86,4110.56,0.001]] call BIS_fnc_selectRandom;
_unit setPosATL _ebayrandomspawn;
sleep 6;
cutText ["","BLACK IN"];
_unit setVariable ["NORRN_unconscious", false, true];

customRemoteMessage = ['globalChat', "I have been sent to jail, somebody coming to visit me?", _unit];
publicVariable "customRemoteMessage";

sleep 10;

customRemoteMessage = ['titleCut', "You will be released after 10 minutes of Jail time.\nDo not try to escape you will be shot!", _unit];
publicVariable "customRemoteMessage";

sleep 600;
_unit allowDamage false;

customRemoteMessage = ['titleCut', "You will be released from Jail now\nDo not kill Players any more!", _unit];
publicVariable "customRemoteMessage";
sleep 10;
inJail=false;
isKiller=false;
terminate shield;
terminate escapee;
terminate escapekill;
_unit setDir 180;
cutText ['','black'];
_unit setPos [1361.91,3979.33,0.001];
cutText ['','black in', 5];

sleep 5;
customRemoteMessage = ['globalChat', "I have been released from jail, can somebody pick me up?", _unit];
publicVariable "customRemoteMessage";
sleep 65;
_unit allowDamage true;

Let me know if it works! 

The buttsex palace you have to imagine it think  -_-

Link to comment
Share on other sites

Great mod :)

 

Would there be a way to apply the prison script to certain spots on the map only? for example, if someone kills someone withing a certain radius of a trader. 

It can be possible if you set the spots in your mission.sqm 

and then you must adjust the code in server_playerDied.sqf

if (_killer isKindOf "Man"|| if kill1 or kill2 or kill3 ) 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"
   };
};

kill1 and kill2 and kill3 you need to makes sensors in your missions.sqm

	class Item12
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill1";
            expCond="(player distance kill1) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item13
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill2";
            expCond="(player distance kill2) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item14
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill3";
            expCond="(player distance kill3) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};

and make file that actives the zone.

in the init.sqf place this add the bottom.

[] ExecVM "folderyouwant\killzone.sqf";

 

past this in your killzone.sqf


Private ["_msg"];
if (isServer) exitWith {
	"PVOZ_EPOCH_KILLZONE" addPublicVariableEventHandler {
		_msg = _this select 1;
		_msg = str(_msg);
		if (isServer) then {
			[nil, nil, rspawn, [_msg], {systemChat (_this select 0);}] call RE;
		};
	};
};
[] spawn {if (isNil "killZone") then {killZone = false;};
	
};

This might work let me know.

Link to comment
Share on other sites

regarding the bot problem, I even tried this:

 

if ((side _killer == WEST) && (isPlayer _killer)) then {

 

but nonetheless, bots go to jail.

 

strange thing. I really like your script, but for pve its not usable, if the bots go to jail too.

And this ?

if ((side _killer) == west) then {
Link to comment
Share on other sites

tried this variation too. and tried only (isPlayer _killer).

but nothing worked. or better said: all have the same result. players and bots go to jail.

it wouldnt be that big of a problem, but the dzms missions don't finish when there are not all bots dead.

Yeah gonna try some things too thx !

Link to comment
Share on other sites

It can be possible if you set the spots in your mission.sqm 

and then you must adjust the code in server_playerDied.sqf

if (_killer isKindOf "Man"|| if kill1 or kill2 or kill3 ) 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"
   };
};

kill1 and kill2 and kill3 you need to makes sensors in your missions.sqm

	class Item12
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill1";
            expCond="(player distance kill1) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item13
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill2";
            expCond="(player distance kill2) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item14
		   {

            position[]={1348.44,339,4065.91};// position you want
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill3";
            expCond="(player distance kill3) < 100;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};

and make file that actives the zone.

in the init.sqf place this add the bottom.

[] ExecVM "folderyouwant\killzone.sqf";

 

past this in your killzone.sqf

Private ["_msg"];
if (isServer) exitWith {
	"PVOZ_EPOCH_KILLZONE" addPublicVariableEventHandler {
		_msg = _this select 1;
		_msg = str(_msg);
		if (isServer) then {
			[nil, nil, rspawn, [_msg], {systemChat (_this select 0);}] call RE;
		};
	};
};
[] spawn {if (isNil "killZone") then {killZone = false;};
	
};

This might work let me know.

 

 

Thank you, but i seem to get some errors, while testing i get this:

17:44:00 Error in expression <bject;
};

if (_killer isKindOf "Man"|| if kill1 or kill2 or kill3 or kill4 or k>
17:44:00   Error position: <if kill1 or kill2 or kill3 or kill4 or k>
17:44:00   Error if: Type Object, expected Bool
17:44:00 File z\addons\dayz_server\compile\server_playerDied.sqf, line 91

my server_playerDied.sqf :

if (_killer isKindOf "Man"|| if kill1 or kill2 or kill3 or kill4 or kill5 ) 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"
   };
};

Any tips?

Link to comment
Share on other sites

ok, I think I figured it out:

 

I first make a statement that checks for the east side of the killer (for AI is east).

if this is the case, the script exits.

if the killer is west (player), then he goes to jail.

testet it with a friend on my testserver and can confirm, that this does work.

 

the sleeptimer in the second statement is for showing first the killmessage, then the "you go to prison" message.

 

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

Link to comment
Share on other sites

ok, I think I figured it out:

 

I first make a statement that checks for the east side of the killer (for AI is east).

if this is the case, the script exits.

if the killer is west (player), then he goes to jail.

testet it with a friend on my testserver and can confirm, that this does work.

 

the sleeptimer in the second statement is for showing first the killmessage, then the "you go to prison" message.

 

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"

   };

};

Great Job ... i will adjust it in the installation post.. 

Link to comment
Share on other sites

Ok try this 

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if ((side _killer) == WEST && kill1 or kill2 or kill3 or kill4 or kill5 ) 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"
   };
};

Hope it works 

the second if will cause the error. delete it, like I did. then you should be fine.

Link to comment
Share on other sites

the second if will cause the error. delete it, like I did. then you should be fine.

 

Tested, doesnt seem to work for me :(

20:14:55 Error in expression < jail!";
};

if ((side _killer) == WEST && kill1 or kill2 or kill3 or kill4 or k>
20:14:55   Error position: <&& kill1 or kill2 or kill3 or kill4 or k>
20:14:55   Error &&: Type Object, expected Bool,code
20:14:56 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95

My server_playerDied :

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if ((side _killer) == WEST && kill1 or kill2 or kill3 or kill4 or kill5 ) then {
    sleep 8;
   [_killer] execVM "scripts\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 "scripts\jail\start_punish.sqf"
     } else {
        sleep 8;
       [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
     };
   } else {
        sleep 8;
        [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
   };
};

My mission.sqm :

		class Item6
		   {

            position[]={6325.6772,304.99033,7807.7412};// stary killzone
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill1";
            expCond="(player distance kill1) < 500;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item7
		   {

            position[]={4063.4226,365.00577,11664.19};// Bash killzone
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill2";
            expCond="(player distance kill2) < 500;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
	class Item8
		   {

            position[]={11447.472,317.26886,11364.504};// Klen killzone
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill3";
            expCond="(player distance kill3) < 500;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
		
	class Item9
		   {

            position[]={1606.6443,289.70795,7803.5156};// bandit killzone
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill4";
            expCond="(player distance kill4) < 500;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};
		
	class Item10
		   {

            position[]={12944.227,210.19823,12766.889};// hero killzone
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=0;
            age="UNKNOWN";
            name="kill5";
            expCond="(player distance kill5) < 500;";
            expActiv="canbuild = true;killZone = true;";
			expDesactiv="canbuild = true;killZone = false;";
		    class Effects	
			{
			};
		};		

and killzone.sqf as instructed:

Private ["_msg"];
if (isServer) exitWith {
	"PVOZ_EPOCH_KILLZONE" addPublicVariableEventHandler {
		_msg = _this select 1;
		_msg = str(_msg);
		if (isServer) then {
			[nil, nil, rspawn, [_msg], {systemChat (_this select 0);}] call RE;
		};
	};
};
[] spawn {if (isNil "killZone") then {killZone = false;};
	
};

The original post works as intended, tested and worked. As soon as i try and pin point the locations where players cant kill other players, then i get the errors.

Link to comment
Share on other sites

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if ((kill1 or kill2 or kill3 or kill4 or kill5) && ((side _killer) == WEST )) then {
    sleep 8;
   [_killer] execVM "scripts\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 "scripts\jail\start_punish.sqf"
     } else {
        sleep 8;
       [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
     };
   } else {
        sleep 8;
        [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
   };
};
 

Would you try it the other way around

Because kill1 or the other positions must be true

Link to comment
Share on other sites

or try this 

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if ((killZone) && ((side _killer) == WEST )) then {
    sleep 8;
   [_killer] execVM "scripts\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 "scripts\jail\start_punish.sqf"
     } else {
        sleep 8;
       [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
     };
   } else {
        sleep 8;
        [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
   };
};
Link to comment
Share on other sites

I get the following errors:

13:42:02 Error in expression <"Bots dont go to jail!";
};

if ((kill1 or kill2 or kill3 or kill4 or kill5) && >
13:42:02   Error position: <or kill2 or kill3 or kill4 or kill5) && >
13:42:02   Error or: Type Object, expected Bool
13:42:02 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95

and then this on the other suggestion:

13:50:49 Error in expression <g_log "Bots dont go to jail!";
};

if ((killZone) && ((side _killer) == WEST )) >
13:50:49   Error position: <killZone) && ((side _killer) == WEST )) >
13:50:49   Error Undefined variable in expression: killzone
13:50:49 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95

I have however made these alterations to my server, maybe that is causing some issues:

Link to comment
Share on other sites

Ok i have another option.

And the deathmessages should be no problem.

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if (killZone) && ((side _killer) == WEST ) then {
    sleep 8;
   [_killer] execVM "scripts\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 "scripts\jail\start_punish.sqf"
     } else {
        sleep 8;
       [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
     };
   } else {
        sleep 8;
        [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
   };
};

Try this .. 

Link to comment
Share on other sites

Ok i have another option.

And the deathmessages should be no problem.

if ((side _killer) == EAST) exitwith {
    diag_log "Bots dont go to jail!";
};

if (killZone) && ((side _killer) == WEST ) then {
    sleep 8;
   [_killer] execVM "scripts\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 "scripts\jail\start_punish.sqf"
     } else {
        sleep 8;
       [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
     };
   } else {
        sleep 8;
        [(driver _killer)] execVM "scripts\jail\start_punish.sqf"
   };
};

Try this .. 

 

 

same stuff : 

14:39:43 Error in expression <ag_log "Bots dont go to jail!";
};

if (killZone) && ((side _killer) == WEST ) t>
14:39:43   Error position: <killZone) && ((side _killer) == WEST ) t>
14:39:43   Error then: Undefined variable in expression: killzone
14:39:43 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95

I even tried changing this bit

if (killZone) && ((side _killer) == WEST ) then {

to

if (isNil "killZone") && ((side _killer) == WEST ) then {

It works, but everywhere :P

Link to comment
Share on other sites

same stuff : 

14:39:43 Error in expression <ag_log "Bots dont go to jail!";
};

if (killZone) && ((side _killer) == WEST ) t>
14:39:43   Error position: <killZone) && ((side _killer) == WEST ) t>
14:39:43   Error then: Undefined variable in expression: killzone
14:39:43 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95

I even tried changing this bit

if (killZone) && ((side _killer) == WEST ) then {

to

if (isNil "killZone") && ((side _killer) == WEST ) then {

It works, but everywhere :P

lol

Link to comment
Share on other sites

if (!isNil "killZone") && ((side _killer) == WEST ) then {

and this?

 

 

 

It might be progress, diff error. lol

16:58:43 Error in expression <killZone") && ((side _killer) == WEST ) then {
sleep 8;
[_killer] execVM "script>
16:58:43   Error position: <then {
sleep 8;
[_killer] execVM "script>
16:58:43   Error then: Type Bool, expected if
16:58:43 File z\addons\dayz_server\compile\server_playerDied.sqf, line 95
Link to comment
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
  • Advertisement
×
×
  • Create New...