ATAC - Advance Team Attack Control
Copyright © 2006-2008 by ATAC Team

ATAC allows you to customise the way you handle Team Attackers/Killers in a variety of different ways for most Half-Life 1 modifications.

Sections:
  1. Installation
  2. Configuration
  3. CVARs
  4. Commands
  5. Natives and Forwards
  6. Scripting examples
  7. Support - External Mods
  8. Credits and copyrights
  9. Changelog

I. Installation

ATAC requires AMX Mod X 1.76c or above with FakeMeta module enabled.

To install the mod, follow these directions:

  1. Extract ATAC package into your addons/amxmodx directory
  2. Open addons/amxmodx/configs/atac directory configure the cfg files to suit your needs
  3. Open addons/amxmodx/configs/atac-plugins.ini file and configure the plugins to suit your needs
  4. Restart your HLDS server, and you're done!

Back to Top

II. Configuration

Configuration is done 98% through atac.cfg file in amxmodx/configs/atac. The other 2% is done in the atac.inc file in amxmodx/scripting/include which just involves changing the defines at the top of the file. This is only required if your not happy with how many registered punishments/hooks are allowed.


Back to Top

III. CVARs

ATAC
Name Information Default Value
atac_disabled Switches ATAC off or on 0
atac_menu Switches punishment menu on or off 1
atac_menu_overwrite Switches menu overwriting on or off 0
atac_show_punishment Shows which punishment was selected 1
atac_immunity_flags Sets the access level flags needed for a player to have immunity a
atac_admins_immune Sets admin immunity type: 0=OFF, 1=NO KICK/BAN, 2=ON (Admins require flag "a") 1
atac_tk_avoidance Increases Team Killers TK's upon disconnect when trying to avoid punishment: 0=OFF, 1=ON 1
atac_store_kills Switches storage of kills per map on or off 1
atac_tk_afterdeath Sets to count a TA/TK when attacker/killer dies beforehand (ie grenades, or other projectiles) 0
atac_ban_type Sets banning type: 0=OFF, 1=IP, 2=AUTHID, 3=AUTO-DETECT 3
atac_ban_time Sets amount of time (minutes) you want to ban a user after their Team Kills have reached the limit (0=PERMANENT BAN) 120
atac_team_attacks Sets amount of Team Attacks you want to be counted as a Team Kill (0=OFF) 5
atac_team_kills Sets amount of Team Kills you want allowed before user is kicked/banned (0=OFF) 3
Punishments
atac_slap_amount Sets how many slaps to give a killer [atac_slap plugin] 10
atac_slap_power Sets how much health to take away from killer, for each slap [atac_slap plugin] 5
atac_jail_time Sets the amount of time you want the killer jailed for, in seconds [atac_jail plugin] 45
atac_bomb_mode Sets whether Time bomber can affect others: 0=Killer *ONLY*, 1=Killer can blow up others [atac_bomb plugin] 0
atac_bomb_range Sets explosion range to kill others [atac_bomb plugin] 1000
atac_fire_mode Sets whether killer who is on Fire can affect others: 0=Killer *ONLY*, 1=Killer can ignite others [atac_fire plugin] 0
Team Attack Addon [atac_ta plugin]
atac_slap_attacker Sets slapping on attacker: 0=OFF, 1=ON (Note: no health is deducted) 0
atac_slayon_maxattacks Sets slaying on maximum Team Attacks: 0=OFF, 1=ON 0
atac_health_restore Sets health restoration on victim: 0=OFF, 1=ON 0
atac_mirror_damage Sets mirror damage on attacker: 0=OFF, 1=ON 0
atac_noattack_within Sets no Team Attack timelimit in seconds from beginning of spawn (0=OFF) 5
Hud Messages Addon [atac_hudmsg plugin]
atac_hudtext Sets hud notification type: 0=HudText (Default), 1=SayText (Yellow), 2=SayText (Green), 3=SayText (Team Colour) 0

Back to Top

IV. Commands

Server Commands
Command Information Version Implemented
atac off - disables ATAC
on - enables ATAC
version - displays ATAC version
settings - displays ATAC settings
players - displays all players team attacks/kills status
punishments - displays punishments registered
addons - displays addons registered
credits - displays credits
team - displays current development team
3.0
3.0
3.0
3.0
3.0
3.0
3.0
3.0
3.0
Client Commands
say /atacstatus Shows your Team Attack and Team Kill status 3.0
atac_addmetk Allows admins to increment their own Team Kills, mainly used for testing purposes [atac_cmds plugin] 3.0

Back to Top

V. Natives

Natives
Command Information Version Implemented
atac_register_punishment() Register a punishment returns -1 on failure. Allows hooking any forward from [Punishments] 3.0
atac_register_addon() Register a addon returns -1 on failure. Allows hooking any forward from [Addons] 3.0
is_punishment_valid( index ) Returns -1 on failure or plugin index if punishment is valid 3.0
get_maxpunishments() Returns maximum amount of punishments registered 3.0
get_atac_attacks( id ) Gets the amount of Team Attacks done by a player 3.0
set_atac_attacks( attacker, victim, amount=-1) Sets the amount of Team Attacks done by a player 3.0
get_atac_kills( id ) Gets the amount of Team Kills done by a player 3.0
set_atac_kills( killer, victim, amount=-1, special=-1 ) Sets the amount of Team Kills done by a player.
special -1 - No action, 0 - Simulate a real team kill longs the killer & victim teams match!, 1 - Fun Menu, 2+ - Activate a specific punishment
3.0
Forwards
atac_punishment_name( victim ) Called when ATAC builds it's Team Kill Menu. You must return with EngFunc_AllocString! [Punishments] 3.0
atac_player_punish( killer, victim ) Called when a punishment is chosen. [Punishments] 3.0
atac_player_reset( killer, victim ) Called when a player dies and just before a player respawns. [Punishments] 3.0
atac_player_spawn( killer, victim ) Called when a player (re)spawns. [Punishments] 3.0
atac_team_attack( attacker, victim, damage ) Called when a team attack occurs. [Addons] 3.0
atac_team_kill( killer, victim ) Called when a team kill occurs. [Addons] 3.0
atac_punished( killer, const name[], const authid[], bantype ) Called when a team kill increment occurs. This forward can supercede ATAC's banning system by:
return PLUGIN_HANDLED [Addons]
3.0
atac_punishment_activated( punishment_id, killer, victim ) Called when a punishment activates. [Addons] 3.0.1

Back to Top

VI. Scripting examples

Example Registering a Punishment:

#include <amxmodx>
#include <fakemeta>
#include <atac>

#define PLUGIN  "Some Name"
#define VERSION "Some Number"
#define AUTHOR  "Some Name"

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	atac_register_punishment()
}

public atac_punishment_name( id )
{
	// Setup menu text
	new text[ 64 ]
	formatex( text, 63, "%L", id, "SOME_MACRO" )
	// You must do this, else ATAC won't decode your string
	return engfunc( EngFunc_AllocString, text )
}

public atac_player_punish( killer, victim )
{
	// Saves duplicating data
	exec_punishment( killer )
	// You don't have to return a hook but it saves catching events
	return ATAC_HOOK_RESET
}

public atac_player_spawn( killer, victim )
{
	// Saves duplicating data
	exec_punishment( killer )
	// You don't have to return a hook but it saves catching events
	return ATAC_HOOK_RESET
}

public atac_player_reset( killer, victim )
{
	client_print( 0, print_chat, "Punishment ended for: %i", killer )
}

exec_punishment(id)
{
	client_print( 0, print_chat, "Executing punishment on: %i", id )
}

Example Registering Team Damage Attack:

#include <amxmodx>
#include <atac>

#define PLUGIN  "Some Name"
#define VERSION "Some Number"
#define AUTHOR  "Some Name"

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	atac_register_addon()
}

public atac_team_attack( attacker, victim, damage )
{
	client_print( 0, print_chat, "Attacker: %i - Victim: %i - Damage: %i", attacker, victim, damage )
}

Back to Top

VII. Support - External Mods

Adding support for external modifications is quite simple. All you need to do is this (Example):

set_pev( id, pev_dmg_inflictor, index )
// FakeMeta Module way
set_pev( id, pev_health, value )
// Fun Module way
set_user_health( id, value )

As soon as health is changed ATAC intercepts the call and checks whether its a team mate attacking.

MODs that enhance gameplay which allows for team mate attacking/killing would need to disable ATAC else it'll just spoil the MOD, here is how:

new atac_active

atac_check()
{
	atac_active = get_cvar_pointer( "atac_disabled" )
	if ( !get_pcvar_num( atac_active ) )
		server_cmd( "atac off" )
}

DO NOT ASK: any ATAC TEAM member to write direct support for your PLUGIN inside of ATAC itself, it will never happen since as of this version ATAC supports near enough any Half-Life 1 modification. Writing direct support for certain PLUGIN's is pointless since they mainly support only one particular MOD!


Back to Top

VIII. Credits and copyrights

* Copyright © 2006-2008, ATAC Team
*
* ATAC (Advanced Team Attack Control) is free software;
* you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ATAC (Advanced Team Attack Control); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.

People who contributed/inspired ATAC are:

ATAC Team:
Lead Developer: Phil "Orangutanz" Poland
Developers: Brad Jones, Christoph "DevconeS" Amrein
Translations: Orangutanz (English), arkshine (French), |PJ| Shorty (German), KWo (Polish), Deviance (Swedish),
              Nem0 (Romanian), Cofeiini (Finnish), guilherme (Portuguese - Brazil), Dav3 (Hungarian), thedavis (Spanish)
              BlackMilk (Dutch), iggy_bus (Serbian), Arion (Portuguese), and Strelomet (Russian)
Testers: KWo (PODBot developer), M249-M4A1, AMX Mod X community
Pre ATAC 3:
Aaron "f117bomb" Drabeck - original co-author of ATAC
Phil "T(+)rget" Poland - original co-author of ATAC
teame06 & {NM}Jason - converting and improving ATAC 2.5.x for AMX Mod X
Misc:
David "BAILOPAN" Anderson - if it wasn't for this guy ATAC 3 wouldn't of been possible
Aleksander "OLO" Naszko - if it wasn't for this guy ATAC would of never existed

Back to Top

IX. Changelog

 3.0.1: 28/03/08
	Updated documentation, added Back to Top at the end of each section. Added missing cvars to the table.
	Fixed an issue with Jail punishment, where in rare instances you maynot spawn with any weapons.
	Added CVAR "atac_hudtext" to atac_hudmsg plugin as requested by Jay-izi. Allows using SayText, read addons.cfg for more details.
	Changed forward: "atac_punished(killer, const name[], const authid[])" to "atac_punished(killer, const name[], const authid[], bantype)".
	Added new forward "atac_punishment_activated(punishment_id, killer, victim)". Called when a punishment activates.
	Fixed punishments: atac_slap2one, atac_slap, and atac_slay. They shouldn't return ATAC_HOOK_RESET.
	Added CVAR "atac_tk_avoidance". Increase Team Killers TK's upon disconnect when trying to avoid punishment.
	Updated addon "atac_cmds" due to native changes.
	Changed native "set_atac_kills(killer, amount=-1, victim=0, item=0)" to "set_atac_kills(killer, victim, amount=-1, special=-1)".
	Changed native "set_atac_attacks(attacker, amount, victim=0)" to "set_atac_attacks(attacker, victim, amount=-1)".
	Added CVAR "atac_show_punishment". Allows you to see which punishment was selected.
	Updated addon "atac_cmds" so you can define your own access flags, see "atac_commands.cfg" for more details.
	Changed CVAR "atac_nocount_death" to "atac_tk_afterdeath".
	Fixed victim menu so if 2+ victims are looking at the same killer record, it now updates.
	Fixed victim menu so it auto-closes when the killer disconnects.
	Fixed punishments not being saved on disconnecting client if they were dead.
	Removed multi_print function, not required due to console_print.
	Changed register_clcmd and register_srvcmd into one register_concmd (Thx DevconeS for pointing this out).
	Added CVAR "atac_immunity_flags". Users can now specify the specific flags they want to have immunity.
	Updated the kick message for when a player is kicked or banned (not via AMXBans).
	Added the killer's current Team Kill count to the title of the punishment menu.
	Fixed possible menu exploit which a victim could expose.
	Updated Polish translation thanks to Sn!ff3r.
	Fixed multiple issues when a player reaches max Team Kills and the "kick" option is chosen.
	Minor change to atac_version CVAR so the version immediately changes upon map change.
	Added Portuguese - Brazil (pt) thanks to guilherme.
	Added Finnish (fi) thanks to Cofeiini.
	Added Romanian (ro) thanks to Nem0.
	Added Portuguese (bp) thanks to Arion.
	Fixed IP banning system.
	Fixed Polish translation thanks to zuk4u.
	Updated ATAC Timebomb to 1.1 which fixes potential double death icon bug.
	Updated ATAC Badaim to 1.1 which is now converted to FakeMeta scheme.
	Updated ATAC AMXBans to 1.1 which fixes possible incorrect banning procedure.

 3.0:	04/10/07
	Public Release for Series 3.
Back to Top