#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fun >
#define PLUGIN_NAME "Fan :: System&CSDMLOL"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "mdLpaPA"
#pragma tabsize 0
static szMap[ 32 ]
public plugin_init( )
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
register_logevent( "PlayerRespawn", 3, "1=joined team" )
register_event( "DeathMsg", "EventKilling", "a" )
get_mapname(szMap, 31)
}
public EventKilling( )
{
new iKiller = read_data( 1 )
new iVictim = read_data( 2 )
new iWeapon = get_user_weapon( iKiller )
cs_set_user_bpammo( iKiller, iWeapon, 90 )
set_task( 2.0, "function_spawn", iVictim )
message_begin( MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, iKiller )
write_short( 1<<10 )
write_short( 1<<10 )
write_short( 0x0000 )
write_byte( random_num( 1, 255 ) )
write_byte( random_num( 1, 255 ) )
write_byte( random_num( 1, 255 ) )
write_byte( 75 )
message_end( )
}
public PlayerRespawn( )
{
new szLog[ 256 ]
new szName[ 32 ], szTeam[ 12 ]
read_logargv( 0, szLog, charsmax( szLog ) )
read_logargv( 2, szTeam, charsmax( szTeam ) )
parse_loguser( szLog, szName, charsmax( szName ) )
new id = get_user_index( szName )
if( is_user_connected( id ) && szTeam[ 0 ] != 'S' )
{
set_task( 2.0, "function_spawn", id )
}
}
public bomb_planted( id )
{
new players[ 32 ], pnum
get_players( players, pnum ,"ae", "TERRORIST" )
for( new i = 0; i < pnum; i++ )
{
if( user_has_weapon( players[ i ], CSW_C4 ) )
{
engclient_cmd( players[ i ], "weapon_c4" )
cs_set_user_bpammo( players[ i ], CSW_C4, 0 )
engclient_cmd( players[i], "lastinv" )
message_begin( MSG_ONE, get_user_msgid( "StatusIcon" ), _, players[ i ] )
write_byte( 0 )
write_string( "c4" )
message_end( )
}
}
}
public function_spawn( id )
{
static team
new MapName[ 32 ]
get_mapname( MapName, 31 )
if( !is_user_alive( id ) && ( team = get_user_team( id ) ) != 3 && team != 0 )
ExecuteHamB( Ham_CS_RoundRespawn, id )
if( is_user_alive( id ) )
{
set_user_godmode( id, 1 )
if( get_user_team(id) == 1 )
{
set_user_rendering( id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 50 )
} else
if( get_user_team(id) == 2 )
{
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 50 )
}
bomb_planted( id )
set_task( 1.0, "ProtectionOff", id )
}
return PLUGIN_CONTINUE
}
public ProtectionOff(id)
{
if( !is_user_alive( id ) )
return PLUGIN_CONTINUE
set_user_godmode( id, 0 )
set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 )
return PLUGIN_CONTINUE
}