ATAC requires AMX Mod X 1.76 or above with FakeMeta module enabled.
To install the mod, follow these directions:
Configuration is done 97% through atac.cfg file in amxmodx/configs/atac. The other 3% is done in the atac.sma file in amxmodx/scripting 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.
| CVARs | ||
|---|---|---|
| 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_admins_immune | Sets admin immunity type: 0=OFF, 1=NO KICK/BAN, 2=ON (Admins require flag "a") | 1 |
| atac_store_kills | Switches storage of kills per map on or off | 1 |
| atac_nocount_death | Do not count TA/TK when a user 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 |
| Team Attack Addon (atac_ta.amxx) | ||
| 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 |
| 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 |
| 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, amount, victim=0 ) | 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, amount, victim=0, item=0 ) | Sets the amount of Team Kills done by a player. item 0 - Show/Do nothing, 1 - Show Menu to Victim, anything higher activates a specific punishment ignoring TeamKills |
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[] ) | Called when a team kill increment occurs. This forward can supercede ATAC's banning system by: return PLUGIN_HANDLED [Addons] |
3.0 |
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 )
}
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!
* Copyright © 2006-2007, 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:
3.0: 04/10/07 Public Release for Series 3