Jump to content
Sign in to follow this  
A-SUICIDAL

Team kill Punish with Jail Cell (All Versions)

Recommended Posts

That's funny Iceman, 2 team killers from opposite teams sharing the same cage.

I more than welcome others to take what I've created and expand on it, improve it, fix it up, clean it up, anything you want. Use the script as a foundation. If nothing else, the actual jail cell was built pretty well and could be used in a totally different punish script.

My punish script is amateur. Any advanced scripting guru could easily take a look at the scripts I wrote and see that I took the poormans route to accomplish what I set out to do. There are a lot of different conditions that have to be met considering the many different things the script checks for. It was a lot for me to do on my own. There were many previous failed attempts. But I never wanted to give up on it. It could use a professional touch.

Share this post


Link to post
Share on other sites

I'm not a guru by any means. Looks like you did a good job. Because I'm mostly partial to use my own scripts though (if i can) I actually just wrote a simpler tk script. It wont catch all cases of tks. But it detects if a player has a negative score, or has layed a satchel within a trigger list (base). Basically, good for stopping the guy at base going on a rampage or trying to blow up the base with satchels. But not too good for cases of "insta rage", where a player may kill another player, in the heat of the moment, over a particular vehicle etc etc. Shit like that.

Has incremental jail time. IE; each time you violate, your jail time increases, until finally, it just disables all input for infinity. Forcing an alt f4 ;) Anyhow, maybe time increases is something you could do for yours.

Edited by Iceman77

Share this post


Link to post
Share on other sites

ok i test on dedicated server on arma 2 stadalone version and all work perfect man .....!!!!!!!! i am very hapy now because dont need to stay like admin all the time and kick team killers i can go afk and i have more free time if i open my server .!!!!!u resolve my biger problem now i am serching for anti hack because the hackers is many to like team killers again thankss for ur hard work!! this jail script is amazing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites

Iceman77, I can understand what that feels like. You finish making a good mission and then play it with friends and some jerk joins the server and starts destroying the base. When I found out about the ProtectionZone_EP1, I started using it in my missions right away. For anybody that doesn't already know what it does exactly, the protection zone basically prevents all damage, so you could literally place a C4 charge at your own feet and detonate it and it won't do any damage to you or any vehicles. A plane could crash on your head and you would still be standing. Unfortunately, I think it only works with Arrowhead and CO. I have a friend that really sucks at flying and he took off in a chopper in my base and immediately rolled his chopper and crashed and killed 2 teammates and blew up 4 other vehicles, including another chopper and the ground was all ripped up with craters and omg the place was a burning mess. Then I figured out how to remove craters from within 150 meters of my base area if they are created by (only) my base vehicles. Then I found out about the protection zone and added about 8 of them to my base and they stop players from being able to teamkill each other at base or destroy any vehicles. Honestly, I didn't want to use the protection zone, but it seemed like the only alternative. Enemy never come near my base, but if they do I have a trigger that will kill them if they are within 300 meters and are on foot. Otherwise the protection zone prevents me from being able to kill them. The Jail cell uses 1 protection zone in the Arrowhead and CO sample mission. It works really well.

AnGeLo, I'm happy that everything is working for you on a dedicated server and that you are very happy with the script. :)

Share this post


Link to post
Share on other sites

A-SUICIDAL after many hours playning on my dedicated server arma 2 stadalone with ur anti team kill script i find 1 problem in arma 2 version if i am a pilot and my gunner shot team mate i got panishe pilot got panishe all other work fine i thing i use civilians choper in my LHD base for transport because the most off team killer know this bug and shoot from chopers

Share this post


Link to post
Share on other sites

What chopper was it exactly? The script is setup to work with specific chopper types. I might have left one out that needs to be added to the list of vehicle types that are checked.

I am currently working on a few different things right now, but one of the things I am working on is a "Forgive" option for the punish script, where the victim will have the choice to forgive his teamkiller. A dialog would appear that simply says "Forgive Team Killer?" with "Yes" & "No" buttons. If Yes is chosen, the Jailed player would be released from jail.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

choper is MH-60S USMC stantar choper in arma 2 stadalone. so where i can add this choper? i am goin to search in sqfs thanks!!

Share this post


Link to post
Share on other sites
I am working on is a "Forgive" option for the punish script, where the victim will have the choice to forgive his teamkiller.

That would we awesome.

Share this post


Link to post
Share on other sites

I added the MH60S to the check system. I don't know how I missed adding it. It was only missing from the Arma 2 version. Both the Arrowhead and Combined Operations versions are fine. I updated the download link. I will let Foxhound know that I updated the file.

For anybody that is using the Arma 2 stand alone version and would rather fix the script yourself without having to re-download and reinstall the entire jail script, 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 {

As for the "Forgive" feature that I am currently working on, it's coming along nicely. I might also be add an option that will allow mission creators to easily enable or disable a looping sound file that is played using "say3D" and will loop every 1 minute until the player is released from jail. I will add a few different sound files to choose from, greatest hits like, "Banana song", "The trololo guy" or pretty much any Justin Bieber song will do. lol.

Share this post


Link to post
Share on other sites

Suicidal

His mate I haven't had a chance to try thenscriptmout yet, not been on pc at all this weekend.

With regards to respawning out of jail, how does it work?

Do you go back to last known position, or do you have a random spawn system in place?

Also, I'm guessing I can use protectionzone_ep1 around it so other people can come and taunt the inmates if they want to?

Share this post


Link to post
Share on other sites

There is already a protection zone around it, and a grass cutter, they can be disabled. The Arma 2 stand alone version does not support it, but Arrowhead and Combined Operations do.

By default, when the player is released from jail, they will be released at their main "respawn_west" marker randomly within an 8 meter radius. The radius can be changed as well as the direction the player will face. But... there are 3 optional choices the mission creator can choose from when implementing the script into his/her mission where the mission creator can use the the default method as is, or they can choose to have the jailed player be released at 1 of several markers, like "respawn_west", "respawn_west_1", "respawn_west_2", "respawn_west_3", "respawn_west_4", etc, which act randomly on their own. Or the mission creator can have the player released from jail at one "respawn_west" marker at an exact position (no radius), which is what I am currently using in a mission I am working on now because it's a small 14 man coop. If you want to use one of the other methods instead of the default method, simply un-comment the method that you want to use and then comment out the method that you will no longer be using. There are directions on how to do all this in the original post in this thread.

You can also set the direction the player faces when teleported into jail, which is kind of important if you want the short cut-scene camera to pan nicely. And there is a invisible helipad named "jail_center_H", which must remain in the very center of the jail cell, but when it is rotated it will control how the cut-scene camera pans to the left or right, which is also kind of important if you want it to look good. These things do not need adjusting if you use the jail cell on the same angle it is used in the sample mission, but if you paste the jail cell into your own existing mission and then decide to rotate the jail cell, then you might want to play around and adjust the direction the player will face and rotate the "jail_center_H" and test it a few times until you get the cut-scene camera looking good.

The jail cell in the movie is an older jail cell, the new one is built much better, looks nicer and is completely impenetrable with 4 invisible wall death triggers and 1 on roof. Aint nobody getting in or out. Even if somebody managed to escape, another trigger will detect if they are more than 12 meters from the jail_center_H and instantly kill them and penalize then -25 points and broadcast it to others, but they won't get out.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

I'm done adding the "Forgive" dialog feature.

The victim will see a small dialog pop up window in the middle of their screen with question "Forgive Team Killer?" at the top, 30 second countdown timer in the middle and "Yes" & "No" buttons at the bottom.

If "No action taken", the timer expires and the dialog closes automatically, the killer continues with his punishment as normal and a sideChat message tells everybody that VictimName chose not to forgive KillerName.

If "No" is chosen, the dialog closes and pretty much the same thing happens as "No Action taken" only it occurs sooner.

If "Yes" is chosen, the dialog closes and it also terminates the dialog script, which stops the dialog timer before it gets to the "No Action Taken" and then sideChat VictimName chose to forgive KillerName, but the killer won't be released until the jail timer hint appears, then the timer stops and the killer is released.

It should work, but I won't know for sure until I am able to test it with another player. If it doesn't work, then I am going to need help with it, but I think it will work fine.

Share this post


Link to post
Share on other sites

hi A-SUICIDAL this is very good news ur anti team kill scrip goin to be perfect from all the sides.!!!! i chance the line 35 in arma 2 stadalone >> if ( (_killer == _veh turretUnit [1]) && ((_veh isKindOf "Mi17_Ins") OR (_veh isKindOf "Mi17_CDF") OR (_veh isKindOf "MH60S")) ) then { and now pilot no got panishe if the gunner kill team mate but the gunner just got message for team kill and dont go in jail just got message u are ascape from jail -25 score team killer die after this and respawn in base for more team kille i make somthing wronk???

edit: Here a real test with real players on my deticated server http://www.youtube.com/watch?v=nvYRWX6zDc4&feature=youtu.be

Edited by AnGeLo

Share this post


Link to post
Share on other sites

Funny video. Alcatraz, heh.

I'm going to buy a second copy of combined ops and install it on my other comp so I can test the scripts between each computer as player and victim and see exactly what is happening and be able to find problems easier and fix them faster. It is very hard to test a script like this alone and even if I have a friend to test with, there is a lot of going back and forth from the editor and to the game and it could drive anybody nuts.

Share this post


Link to post
Share on other sites

Hi, IMO could be pimp if you force the players sent to jail, to perform push ups and exercise in general during their time on the cell; forcing the 3rd person view. After all... what kind of punishment is be sent to get bored!?, maybe... also send two garrison guards to beat you up after some push ups, at random. Then the player will get the point of "don't screw it up again, b*tch". Just an idea... . Let's C ya

Share this post


Link to post
Share on other sites

i can help u if u want i can login to ur server for test if u want u can tell me when is open with skype or msn or somthing my skype name is aggelos.koutsaylis so u dont need a new copy u can call me in skype easy i am on alot off hours

Edited by AnGeLo

Share this post


Link to post
Share on other sites

When testing further I discovered that the "wrongful_kill.sqf" script should have been written differently. I then tried to write it with an entirely different check system and discovered that I am able to distinguish who the killer is of any vehicle except for air vehicles where the pilot can manually fire. The Littlebird in Arrowhead/Combined Operations does not have the ability to turn on/off manual fire, but it also does not have any gunner positions, so that vehicle doesn't cause problems with the script. There are some other air vehicles that also have the ability to fire as the pilot without any ability to turn manual fire on/off, like the UH1Y and some other vehicles, but they have other gunner positions and that causes problems with the script. My check system works for all vehicles except for air vehicles where the pilot can fire and there are other gunner positions. I can't seem to isolate the individual killer of the vehicle. I've tried using checks to see if "isManualFire" and "!isManualFire" but in the case where there is both a pilot and gunner in an AH1Z, the punish script still fires for both players in the vehicle. I wanted to re-write the script so there are only a few lines of script that will work for all players rather than using individual checks for each player s1 through s100, but for some reason it always bugs and gives me strange results. So for now I am trying to at least see if I can get it work using a check system that is specific to each players name. If I can get it working correctly, then later I will try using one script for all players and instead of running checks for players s1 through s100, I will instead simply run checks for "player" and "_killer".

This is an example of check for players s1 and s2. It works great except for the last check that I marked in red:

_victim=_this select 0;
_killer=_this select 1;

_veh=(vehicle _killer);

if (!alive _killer) exitWith {};

waitUntil{!(isNil "BIS_MPF_InitDone")};



//Check 1: if killer is on foot.
if ((_victim!=_killer) && (vehicle s1 == s1) && (vehicle _killer == s1)) then {[nil, s1, "loc", rEXECVM, "jail\start_punish.sqf", s1] call RE;};

//Check 2: if killer is in a LandVehicle gunner turret.
if ((_victim!=_killer) && (vehicle s1 != s1) && (vehicle _killer != s1) && (_veh isKindOf "LandVehicle") && ((s1 == _veh turretUnit [0]) OR (s1 == _veh turretUnit [1]) OR (s1 == _veh turretUnit [2])) ) then {[nil, s1, "loc", rEXECVM, "jail\start_punish.sqf", s1] call RE;};

//Check 3: if killer is in an Air vehicle gunner turret.
if ((_victim!=_killer) && (vehicle s1 != s1) && (vehicle _killer != s1) && (_veh isKindOf "Air") && (assignedDriver _veh != s1) && ((s1 == _veh turretUnit [0]) OR (s1 == _veh turretUnit [1]) OR (s1 == _veh turretUnit [2])) ) then {[nil, s1, "loc", rEXECVM, "jail\start_punish.sqf", s1] call RE;};

//Check 4: if killer is a pilot.
[color="#800000"]if ((_victim!=_killer) && (vehicle s1 != s1) && (vehicle _killer != s1) && (_veh isKindOf "Air") && (assignedDriver _veh == s1) && (assignedGunner _veh != s1) && (s1 != _veh turretUnit [0]) && (s1 != _veh turretUnit [1]) && (s1 != _veh turretUnit [2])) then {[nil, s1, "loc", rEXECVM, "jail\start_punish.sqf", s1] call RE;};[/color]



//Check 1: if killer is on foot.
if ((_victim!=_killer) && (vehicle s2 == s2) && (vehicle _killer == s2)) then {[nil, s2, "loc", rEXECVM, "jail\start_punish.sqf", s2] call RE;};

//Check 2: if killer is in a LandVehicle gunner turret.
if ((_victim!=_killer) && (vehicle s2 != s2) && (vehicle _killer != s2) && (_veh isKindOf "LandVehicle") && ((s2 == _veh turretUnit [0]) OR (s2 == _veh turretUnit [1]) OR (s2 == _veh turretUnit [2])) ) then {[nil, s2, "loc", rEXECVM, "jail\start_punish.sqf", s2] call RE;};

//Check 3: if killer is in an Air vehicle gunner turret.
if ((_victim!=_killer) && (vehicle s2 != s2) && (vehicle _killer != s2) && (_veh isKindOf "Air") && (assignedDriver _veh != s2) && ((s2 == _veh turretUnit [0]) OR (s2 == _veh turretUnit [1]) OR (s2 == _veh turretUnit [2])) ) then {[nil, s2, "loc", rEXECVM, "jail\start_punish.sqf", s2] call RE;};

//Check 4: if killer is a pilot.
[color="#800000"]if ((_victim!=_killer) && (vehicle s2 != s2) && (vehicle _killer != s2) && (_veh isKindOf "Air") && (assignedDriver _veh == s2) && (assignedGunner _veh != s2) && (s2 != _veh turretUnit [0]) && (s2 != _veh turretUnit [1]) && (s2 != _veh turretUnit [2])) then {[nil, s2, "loc", rEXECVM, "jail\start_punish.sqf", s2] call RE;};[/color]

What happens is, if I am player s1 and I am the gunner in an AH1Z and player s2 is the pilot in the AH1Z, when I team kill it activates the 2nd check for player s1(me), but then it also activates the 4th check for player s2, so I need to some how change the 4th check so it doesn't punish the pilot when I team kill from the gunner seat. Basically the 3rd and 4th check conflicts for both players and I need to fix it. If anybody can think of a way to do this it would fix everything and this script would be bug proof. I don't think it's possible to fix it, but I haven't given up hope. If I could somehow check to see what the actual pilot turret/gun is, or if the pilot actually fired at the victim, then I could fix it, but I don't think there is any way to detect that since the pilot is not really a turret seat - even if he can use manual fire and fire cannons and rockets etc. If I can't figure this out, then I would have to make a version of the punish script that will only work for missions that do not use any choppers where the pilot can fire weapons. This is not a problem in my own mission because I do not use attack choppers, but I do use the Littlebird in my mission where the pilot can fire, but since there are no other gunner seats in the Littlebird, it does not conflict with the script.

How would I make it so the 3rd and 4th check does not conflict and punish both the gunner and pilot?

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

This is a more simplified version of the script, which works fine when I test alone with ai, but I would assume that the same problem as above^ will occur with real players in the game.

wrongful_kill.sqf:

_victim=_this select 0;
_killer=_this select 1;

killcount = 0;

if (!alive _killer) exitWith {};

waitUntil{!(isNil "BIS_MPF_InitDone")};



//Check if killer is not in a vehicle (on foot).
if ((_victim!=_killer) && (vehicle _killer == player)) then {[nil, player, "loc", rEXECVM, "jail\start_punish.sqf", player] call RE;};

//Check if killer is in a LandVehicle and in a gunner turret.
if ((_victim!=_killer) && (vehicle _killer != player) && (vehicle _killer isKindOf "LandVehicle") && ((player == vehicle player turretUnit [0]) OR (player == vehicle player turretUnit [1]) OR (player == vehicle player turretUnit [2])) ) then {[nil, player, "loc", rEXECVM, "jail\start_punish.sqf", player] call RE;};

//Check if killer is in an Air vehicle and in a gunner turret.
if ((_victim!=_killer) && (vehicle _killer != player) && (vehicle _killer isKindOf "Air") && ((assignedGunner vehicle player == _killer) OR (player == vehicle player turretUnit [0]) OR (player == vehicle player turretUnit [1]) OR (player == vehicle player turretUnit [2])) ) then {[nil, player, "loc", rEXECVM, "jail\start_punish.sqf", player] call RE;};

//Check if killer is a pilot.
if ((_victim!=_killer) && (vehicle _killer != player) && (vehicle _killer isKindOf "Air") && (assignedDriver _killer == player) && ((isManualFire vehicle player) OR (!isManualFire vehicle player))) then {[nil, player, "loc", rEXECVM, "jail\start_punish.sqf", player] call RE;};

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

I'm kind of a nooby when it comes to scripting. I've followed the instructions to the best of my ability and it appears I'm a all round fail.

I'm not sure if it's me not understanding the lingo or if I'm just plain dense.

Anyhow!! could someone be nice enough to share a working version for "Arma 2" only! specifically "co40_Domination_2_11A2_West.Chernarus" with the script already installed and working so that I may use it to investigate where on earth I went wrong.

I believe in this system and would love to have the ability to stop kicking and banning people from my server and just get down to business creating a good community of players who share the same enjoyment I do with co-op.

Thank you!

Edited by DevilsUrn

Share this post


Link to post
Share on other sites

I am just finishing some last touches on a new version of the punish script. It's much easier to implement into a mission now too. No more need to name your playable units s1, s2, s3, etc. There is also working "Forgive Yes/No" 20 sec dialog feature that appears for victims. I'm still working out some bugs with attach chopper pilots that fire rockets and teamkill and then both the pilot and gunner get punished. I think once the pilot is sent to jail - any rockets that are still airborne that then kill a player then get blamed on the gunner, or something to that effect. My last changes seemed to have fixed that problem since I have yet to see it re-occur. There is also a new check system for moving gunners or crew members in the pilot seat if the pilot was sent to jail for team killing. There are various other fixes incorporated as well. So far it has been testing fine. I just need to figure out a way to make the victims "forgive" dialog to appear in front of the score board.

I can help you get it working in your mission when I am done.

Share this post


Link to post
Share on other sites

The new version is still not ready for release - it needs to be tested more thoroughly on a dedicated server and I need to find somebody to help me test it.

Here's a preview video showing some of the new changes:

It might be easier to read the messages in the movie if you choose high detail and fullscreen.

I used an enemy (Takistan Army rifleman) to test the teamkill script, that's why in the video you don't see a teammate score get penalized for team killing me.

Normally the script is set so the enemy cannot trigger the punish script, but for testing purposes I changed it.

You also see me team kill 2 teammates with the Littlebird chopper. What would happen in that situation is... only one of the victims (the first killed)would be given the chance to forgive.

I'm still looking into other solutions for that, but for now it shouldn't cause any problems.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

try to throw a granade in front of you.... on dedi servers you can get ex: dragonsyr is unconsius hit by dragonsyr . what happened then? is this a team kill for the script?

Share this post


Link to post
Share on other sites

The punish script will not activate if victim is also the killer. The game might tell you that you killed yourself, but the punish script will not punish you for it. You also cannot be punished if you are dead, but I might implement a feature where the killer can be sent to jail upon respawn. I am also trying to count the number of victims and give each victim the opportunity to vote if the killer should be forgiven and released from jail - at which point the killer would only be released from jail if more than 50% of "Forgive" votes cast are "Yes".

Share this post


Link to post
Share on other sites

hi A-SUICIDAL nice work mate i am here for some litle problems after many test with arma 2 stadalone version on my dedicated server the biger 1 is if gunners shot the script panishe the pilot i chance the line 35 like u say but same problem for now i just chance my usms chopers to civilians choper for trasport so now the players dont have gun in choper ... the problem 2 is if somone with rocket or any king of waepon hit the jail the player in jail die and is free again in game some people find this way to escape from jail i dont know if the sames problem in Arrohead version i never test it .. problem 3 some players if my server have 10 15 or 20 players online 2 players if i have 10 online for example dont go to jail and makes team kill free all other got panishe if i have 15 players online 3 or 4 player never go to jail can kill free anyone all for others work fine with 20 players online maybe 5 or more can team kill for free anyone and this problem is random the same player if make 2 minite later again team kill got panishe my english is very bad i hope u got it what i mean maybe ur script is ok and somthing with all my mission make that bug i dont know i love ur script and ur work i am here just for help ... last problem i have 1 mission domination by xeno so i add ur script and jail in this mission because i like this mission but nothing work jail is open and the time no work if u make team kill in all other mission work fine but this maybe happent because i am king of noob with script i dont know... I wait for test ur new version i hope ur add in new version like no need the players name s1 s2 s3 is for arma stadalone version to..!!!thanks again for all ur amaZING WORK..!!

Share this post


Link to post
Share on other sites

Will this work with Arma3 Alpha? or you will you need to alter it to run in A3?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×