I want to have a chat message when a team is slay(in different options). And players of dying with thunder. Here it plugin :
PHP Code:
#include <amxmodx>
#include <engine>
#define MAX_PLAYERS 32
new const g_szTsObjectives[][] =
{
"func_bomb_target",
"info_bomb_target",
"func_escapezone"
}
new const g_szCtsObjectives[][] =
{
"func_hostage_rescue",
"info_hostage_rescue",
"func_vip_safetyzone"
}
enum
{
None,
Ts,
CTs
}
new g_iTeamObjectiveMap
public plugin_init()
{
register_plugin( "Slay Loosers", "0.0.1", "ConnorMcLeod" )
new iEnt, i
for( i = 0; i<sizeof( g_szTsObjectives ); i++ )
{
if( find_ent_by_class( iEnt, g_szTsObjectives[ i ] ) > 0 )
{
g_iTeamObjectiveMap = Ts
break
}
}
for( i = 0; i<sizeof( g_szCtsObjectives ); i++ )
{
if( find_ent_by_class( iEnt, g_szCtsObjectives[ i ] ) > 0 )
{
if( g_iTeamObjectiveMap == Ts )
{
g_iTeamObjectiveMap = None
}
else
{
g_iTeamObjectiveMap = CTs
}
break
}
}
if( g_iTeamObjectiveMap != None )
{
register_event( "SendAudio", "Event_SendAudio_RoundEnd", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw" )
}
}
public Event_SendAudio_RoundEnd()
{
new szParm[ 9 ], iTeam
read_data( 2, szParm, charsmax( szParm ) )
switch( szParm[ 7 ] )
{
case 't':iTeam = CTs
case 'c':iTeam = Ts
case 'r':iTeam = g_iTeamObjectiveMap
}
new iPlayers[ MAX_PLAYERS ], iNum, id
get_players( iPlayers, iNum )
for( new i; i<iNum; i++ )
{
id = iPlayers[ i ]
if( is_user_alive( id ) && get_user_team( id ) == iTeam )
{
user_kill( id, 1 )
}
}
}