Jump to content
Sign in to follow this  
demonized

Team Kill punishment [script]

Recommended Posts

TK Punishment v 1.1

v 1.1 posted 12/08 - 2011

Tested in SP, MP in A2 only, OA only, CO.

Changelog v 1.1:

* added A2 only compatibility.

v 1.0 - release

This is a simple script wich gives out punishment for those pesky TK´ers.

It does nothing special, offending player will remain where he was but see a black screen, giving the message and showing timer until he can play again.

He can die and respawn, timer will force him to finnish his time.

If he kills multiples, timers increase, also if he kills someone by timer or crash after punishment is issued.

But.... we dont want the offender to get off easy, so now he cannot type, use mouse or keyboard until timer is done, he cant exit server or game.

Offender has to manually shut down his entire game, not just the mission to regain control if he does not want to do the time.

This will make it a real hassle for him if he wants to repeat this beheaviour.

In addition there is option to add to the punishment timer for each total Team kill committed, if its set to for example 10, for that he gets the initial time, + (10 seconds * 10 TK´s), so in this posted script he will have to wait 130 seconds.

If he kills one more after that he will have to wait 140 seconds etc.

Adjust options to what you deem appropriate for your mission.

Some options in top of script, read comments there as well as instructions.

save as TKP.sqf and place in your mission folder.

/*
TK punishment v 1.1
by Demonized

Teach Team Killers a lesson..

1: Make sure you have a functions module on your map.
2: Place a marker called DMZ_TKP_marker in your base or your no TK zone, or change marker name below in options.
3: Place this in init of any unit you wish to be included in TKP script.
	_null = [this,"start"] execVM "TKP.sqf";
*/

_timer = 30;	// time in seconds until TK´er can move again. 
_increase = 10;	// extra time in seconds added for every amount of TK´s commited, if its the second TK, it will be total wait of (_timer + _increase + _increase) in seconds.
_distance = 500;	// this is the distance to DMZ_TKP_marker, if within this punishment will be done, if this is set to 0, punishment will be done no matter where the TK happened.
// default marker used, can be any marker, for example "respawn_west".
_noTKzone = "DMZ_TKP_marker";
// message given to Team killer.
_message = "You are being punished because of Team killing";

waitUntil {!(isNil "BIS_MPF_InitDone")};
_killer = _this select 0;
if ("start" in _this) exitWith {
if (local _killer) then {_killer addEventHandler ["killed", {[(_this select 1),(side (group (_this select 0))),(getPos (_this select 0)),"EH"] execVM "TKP.sqf"}]};
};
if ("EH" in _this) exitWith {
_side = _this select 1; _pos = _this select 2;
if (_side == (side (group _killer)) AND _killer == player) then {[nil, _killer, "loc", rEXECVM, "TKP.sqf", _killer, _pos] call RE};
};
if (_killer != player OR (_distance != 0 AND ((_this select 1) distance (getMarkerPos _noTKzone)) > _distance)) exitWith {};
if (DMZ_TKP) exitWith {DMZ_TKP_rapsheet = DMZ_TKP_rapsheet + 1};
disableUserInput true;
if (isNil "DMZ_TKP_rapsheet") then {DMZ_TKP_rapsheet = 1; DMZ_TKP = true} else {DMZ_TKP_rapsheet = DMZ_TKP_rapsheet + 1};
_cnt = DMZ_TKP_rapsheet;
_timeLeft = ((_timer - 3) + (_increase * DMZ_TKP_rapsheet));
_killer setVariable ["DMZ_TKP", true, false];

_text = format["%1 is being punished for total %2 Team kills",(name player),DMZ_TKP_rapsheet];
[nil,nil,rHINT,_text] call RE;

cutText [_message,"BLACK OUT",3];
sleep 3;
while {_timeLeft != 0} do {
_text = format["time left \n %1 \n \n %2",_timeLeft,_message];
cutText [_text,"BLACK FADED",0];
sleep 1;
_timeLeft = _timeLeft - 1;
if (_cnt != DMZ_TKP_rapsheet) then {
	_timeLeft = _timeLeft + (_increase * (DMZ_TKP_rapsheet - _cnt));
	_cnt = DMZ_TKP_rapsheet;
	_text = format["%1 is being punished for total %2 Team kills",(name player),_cnt];
	[nil,nil,rHINT,_text] call RE;
};
};
cutText ["You can now join the game again, be more careful in the future","BLACK IN",5];
_text = format["%1 has finnished his punishment for his %2 Team kills \n \n %1 is now back in play",(name player),_cnt];
[nil,nil,rHINT,_text] call RE;

if (!isNull player) then {disableUserInput false; DMZ_TKP = false};

Edited by Demonized
added A2 only compatibility.

Share this post


Link to post
Share on other sites

Hahaha this day will go down in history as the day teamkillers learn to think before shooting, bravo!!

Nice little script, works well, the only issue I seem to be having is when I try to relocate the script (I keep my mission files tidy) I always get Script "TKP.sqf not found", when I have altered the init path to the correct folder..... seemed to work ok though when I moved it onto the mission folder even though the altered init i.e. "scripts\TKP.sqf" was still present.... :confused:

Edited by VIPER[CWW]

Share this post


Link to post
Share on other sites
;2003506']the only issue I seem to be having is when I try to relocate the script (I keep my mission files tidy) I always get Script "TKP.sqf not found"' date=' when I have altered the init path to the correct folder..... seemed to work ok though when I moved it onto the mission folder even though the altered init i.e. "scripts\TKP.sqf" was still present.... :confused:[/quote']

there is 3 places total you need to change for relocating the script into a folder.

1: the init line of the units.

_null = [this,"start"] execVM [b]"scripts\TKP.sqf"[/b];

2: line 24, the addEventHandler line.

if (local _killer) then {_killer addEventHandler ["killed", {[(_this select 1),(side (group (_this select 0))),(getPos (_this select 0)),"EH"] execVM [b]"scripts\TKP.sqf"[/b]}]};
[/spoiler]

3: line 28, the call RE line.

if (_side == (side (group _killer)) AND _killer == player) then {[nil, _killer, "loc", rEXECVM, [b]"scripts\TKP.sqf"[/b], _killer, _pos] call RE};
[/spoiler]

Share this post


Link to post
Share on other sites

Thats it then, cheers mate!!

All good now, was the line 24 & 28 that needed adjusting :)

Edited by VIPER[CWW]

Share this post


Link to post
Share on other sites

Q1) How do I make the punishment script start after 3 committed teamkills?

Q2) How do I make the script play a sound on client-only? - I got the sound in .ogg format and I know how to define it in the Description.ext file. playMusic "name.ogg"; command will play a sound but I want it to loop until the punishment is complete.

Q3) How do I teleport the teamkiller to a POW camp marker? - Not really needed but it would be nice to do/know.

(Note: A moderator has approved this post)

Share this post


Link to post
Share on other sites

Although i surely welcome every effort to make public play more "safe", some questions arise:

When i'm pilot of a chopper and someone get's in as gunner (door guns in UH-60 as example) and then this stupid guy starts firing at own units (teamkiller), the game usually identifies the pilot as killer. Does this script detect who is really shooting?

And also, when doing a usupported heavy structural integrity check of a choppers hull (aka crashing), killed passengers are usually counted as being killed by pilot. Is this detected and handled correctly aswell?

Share this post


Link to post
Share on other sites
Myke;2123394']Although i surely welcome every effort to make public play more "safe"' date=' some questions arise:

When i'm pilot of a chopper and someone get's in as gunner (door guns in UH-60 as example) and then this stupid guy starts firing at own units (teamkiller), the game usually identifies the pilot as killer. Does this script detect who is really shooting?

And also, when doing a usupported heavy structural integrity check of a choppers hull (aka crashing), killed passengers are usually counted as being killed by pilot. Is this detected and handled correctly aswell?[/quote']

I was going to ask this too. Being credited with teamkills just because you're the pilot/commander of a vehicle that contains teamkillers is a PITA. Likewise if the vehicle crashes.

Share this post


Link to post
Share on other sites

Hm, does this script take in account that "Friendly fire incidents" may also happen and it was a mistake? As in Evolution, where you have for example 5 kills, and then, just as you fired the last shot, the town clears and the guy shot was considered Prisoner -> instant Jail for you, since you got -30 points (killing unarmed men and officer costs points), although you couldn't do anything about it.

The better solution against Teamkillers is having an admin instant-ban every teamkiller, like I do, since sometimes it happens too frequent, and you are not supposed to look somebody in the face and shoot him in said face after 5 seconds; do that in real life (shoot a real person) and you get either the syringe (death penalty), firing squad (as in china still today) or the chair or hanging (Arabic countries).

I'm not a hypocrite, I play arma (and OFP1) since they came out (with OFP that was 2001), well over 10 Years, and played other games before, and NEVER EVER did something stupid just to piss people off. We would have Teamkill parties and other funny hijinx when the maps cleared, sure, but I never looked somebody in the eye and straight up shot them just because they were near me, like most of them Kids nowadays do. Teamkilling somebody because the are there is like beating or killing a guy just because he exists, it's the lowest form of "interaction" one can do, and should be punished by instantly banning them;

there is a difference with people accidentialy killing another one, but there is a difference between getting shot at spawn/in base or in combat (by accident), I only warn those who do it by accident and they apologize to each other and it's cool, but when I spectate on somebody and see that he kills a person just to kill someone, instant ban. No doucheyness from me, that is just how I see it; you being an retardo (by shooting somebody without a damn reason), get the hell out of here and never come back.

Share this post


Link to post
Share on other sites

hello all ,

this seems to be a straight forward clean cut install.. I follow all instructions create marker, INIT line in all playable units....

and it only works for ME ," and only if i kill myself!!"... all other players can team kill .. I can team kill ... but if i kill myself .. i go into lockout.......

this is in a MP game... in SP it works if i kill myself and if i kill a team mate AI...

I would like to add that i also enabled AI .. and tried it with AI disabled.. no difference..

nothing goes into the init.sqf in the mission folder . right!?..

only the TKP.sqf, and the marker and the INIT code..

Anyone have any input on this ..

I am using Vanilla Arma 2 v 1.11

I usually kick TK'ers straight away if it was not an accident!! however it would be good to have them get locked/blacked out after the first TK.. so any survivors can get away and I can properly asses the situation!!

EDIT:

It suddenly worked... HOWEVER,

it worked in reverse!!

the person that was team killed is punished!!! WTF.. i gave up .. its deleated from my mission folder!!

Edited by Lordprimate

Share this post


Link to post
Share on other sites

OK so here is the deal. I'm running Arma 2 FREE. (NOT going to buy the expansions as the game has proven flawed. Waiting for Arma 3)

In the mean time:

I'm trying to implement this script “TK punishment v 1.1†on Co40Domination 2 AI west.

I've customized this map a little where I've added civilians and civilian vehicles in all the towns and a few other vehicles.

I find the server I'm running (From Home) Using TA2DST v1.4 tool. (Dedicated server).

The issue is the instructions.

I'm finding this some what annoying.

1: Make sure you have a functions module on your map.

I've made a module yet “nothing is stated what to put in it. Leave blank?

2: Place a marker called DMZ_TKP_marker in your base or your no TK zone, or change marker name below in options.

I've placed the marker and called it DMZ_TKP and that seems to work fine.

This is the main issue I'm having. “_null = [this,"start"] execVM "TKP.sqf";â€

Where on earth in Co40Domination do I place this code?

I've selected the playable soldiers and pasted the code in the INIT section on each and every one of them. Yet in preview mode it works. BUT in MP mode it only works when you kill your self.

So what I'm asking if at all possible could someone give me the idiots guide please. “step by step instructions!!!! So that I can fully understand what on earth is going on. Thanks!:)

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  

×