Неверный раздел форума
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Bomb Blast"
#define VERSION "0.4"
#define AUTHOR "K.K.Lv"
new HamHook:g_BombThink
new g_Bomb
new g_SpriteCircle
new Float:g_fExplodeTime
new Float:g_fNextBlastGameTime
new g_pCvarColor, bool:bla[33], bool:end;
public plugin_precache()
{
g_SpriteCircle = precache_model( "sprites/shockwave.spr" )
}
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
g_pCvarColor = register_cvar( "bb_color", "250250250" ) //RRRGGGBBB
register_clcmd("say /eftest","efek");
if( find_ent_by_class( FM_NULLENT, "func_bomb_target" ) || find_ent_by_class( FM_NULLENT, "info_bomb_target" ) )
{
g_BombThink = RegisterHam( Ham_Think, "grenade", "Bomb_Think", 1 )
register_event( "HLTV", "Stop", "a", "1=0", "2=0" )
register_logevent( "Stop", 2, "1=Round_End" )
register_logevent( "PlantedBomb", 3, "2=Planted_The_Bomb" )
}
}
public Stop()
{
g_Bomb = 0
end = false
DisableHamForward( g_BombThink)
}
public client_disconnected(id){
if(bla[id]) bla[id] = false;
}
public efek(id){
client_print_color(id, id, "^4* ^1Bomba Efek^3 %s", bla[id] ? "Pasif" : "Aktif");
bla[id] ^= true;
}
public PlantedBomb()
{
new C4 = FM_NULLENT
while( ( C4 = find_ent_by_class( C4, "grenade" ) ) )
{
if ( get_pdata_int( C4, 96 ) & ( 1<<8 ) )
{
g_Bomb = C4
g_fExplodeTime = get_pdata_float( g_Bomb, 100 )
EnableHamForward( g_BombThink )
g_fNextBlastGameTime = 0.0
break
}
}
}
public Bomb_Think( iEnt )
{
if ( g_Bomb != iEnt )
return
new Float:fGameTime = get_gametime()
if( g_fNextBlastGameTime > fGameTime )
return
new Float:fTime, iTime, Float:fThinkTime
fTime = g_fExplodeTime - fGameTime
iTime = floatround( fTime )
if ( iTime > 13 ) fThinkTime = 1.0
else if ( iTime > 7 ) fThinkTime = 0.5
else fThinkTime = 0.3,end = true
g_fNextBlastGameTime = fGameTime + fThinkTime
create_blast_circle( iEnt )
}
public create_blast_circle( iEnt ) {
for(new i = 1; i < MaxClients; i++)
{
if(bla[i] && is_user_alive(i)){
new Float:fOrigin[ 3 ]
pev( iEnt, pev_origin, fOrigin )
new szColor[ 12 ], iColor[ 3 ]
get_pcvar_string( g_pCvarColor, szColor, charsmax( szColor ) )
iColor[ 2 ] = str_to_num( szColor[ 6 ] )
szColor[ 6 ] = 0
iColor[ 1 ] = str_to_num( szColor[ 3 ] )
szColor[ 3 ] = 0
iColor[ 0 ] = str_to_num( szColor[ 0 ] )
engfunc( EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0 )
write_byte( TE_BEAMCYLINDER )
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] )
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] )
if(!end) engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 185 )
else engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] + 120 )
write_short( g_SpriteCircle )
write_byte( 0 )
write_byte( 1 )
write_byte( 6 )
write_byte( 8 )
write_byte( 1 )
if(!end){
write_byte( iColor[ 0 ] )
write_byte( iColor[ 1 ] )
write_byte( iColor[ 2 ] )
write_byte( 128 )
}else{
write_byte( 254 )
write_byte( 0 )
write_byte( 0 )
write_byte( 108 )
}
write_byte( 5 )
message_end()
}
}
}