Author: A-SUICIDAL
Author Website:

Requirements: No addons required

Version: 2/14/2013 fixed2

Short description: An anti team kill script which puts the offender in jail temporarily.

Date: 2013-02-17 10:06


Comments: (4)
Rating:



 


Team kill Punish with Jail Cell

by
A-SUICIDAL


Description:
An anti team kill script which puts the offender in jail temporarily.


Special features:
The jail cell has a protection zone and a clutter cutter that removes grass. These can easily be removed by deleting the 2 corresponding placed triggers.
I would not recommend removing the protection zone from the jail cell. It is there to protect the jailed player.
Hedgehogs on roof to prevent choppers from landing on the jail. Walking on roof will kill players.
The surrounding ground level barbed wire will also kill players.
Players teleported into jail are positioned randomly within a 3 meter radius inside the center of cell to prevent pile ups.
Players will not have the use of the "Escape" key while in jail", therefore there is no ability to choose "Respawn or Abort".
Players that by some miracle manage to escape from jail will be killed once they are more than 10 meters from the center of the jail cell.

You are always forced out of your vehicle if you teamkill from a vehicle turret, then you are teleported into jail.
Pilots of US and BAF Chinooks are given back points that were deducted from team killing side gunners.
Pilots of Blackhawks and Nighthawks are given back points deducted from the team killing right side door gunners.
If a pilot crashes and kills several crew, the pilot will not go to jail (because he's dead), the crew that died will count against the clutzy pilot's score.
If an AH1Z or Apache pilot manual fires and team kills, the pilot goes to jail and the gunner, if one exists, will automatically be moved into the pilot seat.
If a chopper pilot uses manual fire and team kills, a gunner or passenger, if one exists, will immediately be moved into the pilot seat - This works for the AH-6J, MH-60S, UH-60M, UH1Y, AH11 Wildcat, Ka-60 and Ka-60 (M32). Any addon choppers added to the mission that have "pilot" manual fire capabilities or turret/gunner positions, these can also have the "switch to pilot seat" capability by simply editing line 26 of "killer.sqf" and adding the correct vehicle class names. For example, you could add:
OR (_veh isKindOf "OH58")

Additional "loadout_start.sqf"(custom loadout) and "loadout_respawn.sqf" scripts are incorporated, but you do not need to use them if you have your own loadout scripts, but they do work great. You can disable/remove the "loadout_start.sqf" and the "loadout_respawn.sqf" by removing lines 22 & 23 from the "init.sqf" file.
The "killer.sqf" is the main punish script and it has its own built in "remember loadout" functionality that should not interfere with other loadout scripts - it basically remembers the weapons you last had before you were sent to jail and gives back the same weapons upon your release, if you have basic editing skills -you can easily add mod specific loadout functionality to the "killer.sqf" file if needed to support a 3rd party backpack script or other addon loadout abilities.

The jail cell has an invisible helipad named "jail_center_H" in the center that is needed and is linked to certain scripts and should not be changed or removed.
The actual red "Jail" marker seen on the map in-game is also linked to certain scripts and should not be changed or removed.

Line 50 and 130 in the "killer.sqf" file sets the direction that the player faces when teleported into jail and when released to the main respawn_west marker.
These lines might need adjusting depending on where you might decide to relocate jail cell. The jail can easily be selected, dragged and dropped anywhere you wish.
Also the "EH_handlers.sqf" file (line 6) sets the direction the player faces on respawn after dying - this can either be removed or changed to suit your mission.
Lines 50 through 60 in the "killer.sqf" offer additional location choices when you are released from jail. You can either be released at one "respawn_west" marker", or be released at one of several "respawn_west" markers randomly, or you can be released within a set radius at one "respawn_west" marker, which is what the sample mission is currently set to do - using an 8 meter radius. To use one of the other methods simply un-comment the new method you wish to use and then comment out the old method that you no longer wish to use.

The only know bugs I have found when testing was... When an ai takes over the pilot seat on a dedicated server the "engineOn true;" command seems to fail, but usually the ai chopper pilot seems to land fast without blowing up. This should not be of much concern with real players that get switched to the pilot seat, but I will still try to sort this out so it works for the ai.

I added a light that hangs from the ceiling in the center of the jail cell - the light source can only be seen at night.
I think I covered everything I can think of. I was going to make Arma 2 and Arrowhead versions of the jail punish script, but that would require building new jail cells since the jail cell was built using objects from both Arma 2 and Arrowhead, so for now the jail script is for Combined Operations only. If somebody really wants to use a version of the jail script for Arma 2 or Arrowhead stand alone, contact me and I'll see what I can do.


Installation / Usage:
Open the sample mission in the editor and turn markers on "F6" and you will see descriptive marker text. Select the entire jail cell and the Functions Module and the 3 triggers near the Functions Module and press "Ctrl-C" to copy, then open your own existing mission and press either "Ctrl-V" to paste, or "Ctrl-Shift-V" to paste in (same)place. I am assuming that you already have a "respawn_west" marker, but if you don't, copy and paste that into your mission too.

Open the sample mission folder and copy all of the sub folders and the "stringtable.csv" file and paste them into your own existing mission folder.

Open the sample missions "init.sqf" file and copy everything and paste it into your own exisiting "init.sqf" file.
Set the "jail_timer" in the init.sqf (line 4) to the desired punish time. I recommend setting it to two minutes: 120

Open the sample missions "description.ext" file - from line 20 and down you will need the "class CfgSounds", "class RscStdText" and "class RscTitles", so you can either copy and paste line 20 & down into your own exisiting "description.ext" file, or if you already have these classes in your existing mission, then you would just need to add the defined sound and image file from the sample mission to your own existing "description.ext" file. This should be simple to do for anybody with basic editing skills.

Add the following line to the "init" field each playable & non-playable "friendly" unit:
null = this addEventHandler ["killed", {nul = [_this select 0, _this select 1] execVM "jail\wrongful_kill.sqf"}];
You can also add this line to the "init" field of each friendly unit if you would like the "Remove Body" feature when a unit dies:
null = this addEventHandler ["killed", {(_this select 0) execVM "scripts\removePlayerBody.sqf"}];

For mission makers that create missions that do not have ai enabled (like most Domi missions) and use "disabledAI = true;" in their description.ext file and do not have any non-playable friendly ai placed or spawned in their mission, then the alternative method for adding the EH to each playable unit would be... to leave each playable unit's "init" field empty and simply un-comment the lines in the "EH_Handlers.sqf" file, which can be found in the "EH" sub folder. This will automatically add the EH to each "player" that joins the server.


Media:


The movie is still from an older version, but shows the same basic functionality.


Notes:
- This script was last tested on a dedicated server 2/14/2013.
- Supports up to 100 playable/non-playable friendly (same side) units. Units must be named... s1, s2, s3 etc. Any amount of units under 100 can be added.
- It's hard to test all this stuff on my own. So for anybody that feels like helping me test this stuff, that would be awesome.


Know bugs:
1.)When an ai unit is switched into pilot seat, the engineOn true; command still doesn't seem to work on a dedicated server, but does work in single-player and hosted environment. Real players should not have a problem with this on a dedicated server.
2.)If gunners of certain air vehicles kill teammates and it causes the pilot's score to be penalized, the script will fix the pilots score, but not if gunner killed a civilian.


Changelog:
v2/14/2013 fixed2
In the Arma 2 stand alone version the MH60S was missing from the check system when the right side door gunner team kills and it punishes the pilots score. I fixed it and now the pilot will be given back 1 point and the gunner will have 1 point deducted from his score.
For anybody that is using the Arma 2 stand alone version and would rather fix the script themselves without having to re-download and reinstall the entire jail script, they can simply open the "killer.sqf" file and replace line 35 with this:
if ( (_killer == _veh turretUnit [1]) && ((_veh isKindOf "Mi17_Ins") OR (_veh isKindOf "Mi17_CDF") OR (_veh isKindOf "MH60S")) ) then {

v2/14/2013 fixed
- removed backpacks from Arma 2 version (not supported)
- removed "player forceWalk true;" command from Arma 2 version (not supported)

v2/14/2013
- The timer used to not work if the punish time was set high, my bad. Fixed.
- Jail timer used to appear as 00:00, but now it will appear as 00:00:00
- When pilot gets sent to jail for a manual fire team kill, there were many vehicle types that were left out of the check system when it looked for an available gunner/cargo unit to switch to pilot seat. Fixed.
- Some team killing gunners were teleported into jail and then back into the pilot seat, so I added an additional check for that. Fixed.
- When an air vehicle gunner team kills and the pilot gets punished for it - I forgot to add several vehicle types to the check system when it adds back a point to the pilots score and removes a point from the gunner/teamkiller. Fixed.
- Rebuilt Jail cell with Arma 2 parts that should now be compatible with all versions. Spaced outside wall further away from jail cell to prevent prisoner from getting into vehicles parked outside. Jail cell is now completely surrounded with KILL triggers(All 4 walls and roof). Still need to make sure the objects used to build the jail cell will work for Arrowhead stand alone.
- Removed ClutterCutter and ProtectionZone from Arma2 version.
- Added custom loadout specific to game version.
- Escapees weren't dying. Fixed. By the off chance that a jailed player manages to escape, by possibly getting in a vehicle parked close to the outside wall, or a hovering chopper, the player will die if he gets more than 12 meters from the center of the jail cell - and he will be punished -25 points.
- When a player was released from jail they were unable to fire rifle because the muzzle not selected properly - typical grenade launcher bug. Fixed.
- Many other tweaks and changes. Can't remember them all off hand. If you are using an older version of the script, replace it with this new one.

beta 2
- I added a lot more support, so the script is already prepped to be used with as many as 100 players
- I added support for all of the choppers that have manual fire abilities or gunner positions.
- now it seems to be working great on a dedicated server

beta
The jail cell is now viewable in the editor, it used to be spawned.
There is no more Civilian Kill punishment, it has been removed.
There are no more "additional score deductions".


Forum Topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Anti,   Jail,   Team Kill,   Tk