Настроек нет |
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "C4 GIBS"
#define VERSION "1.0"
#define AUTHOR "Garey"
#define C4_GIBS "models/c4_gibs/c4_gibs.mdl"
new iGibModels = 0;
new bool:b_CanReplaceGIBS = false;
public plugin_init( )
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "Player_Gibs");
register_message(SVC_TEMPENTITY, "C4_Gibs");
register_event("HLTV", "Hook_Gibs", "a", "1=0", "2=0");
register_logevent("Show_Gibs", 2, "1=Round_End");
}
public plugin_precache()
{
iGibModels = precache_model(C4_GIBS);
}
public Hook_Gibs()
{
b_CanReplaceGIBS = false;
}
public Show_Gibs()
{
b_CanReplaceGIBS = true;
}
public Player_Gibs(victim, inflictor, attacker, Float:damage, damagebits)
{
#define DMG_BLAST (1<<6)
#define DMG_ALWAYSGIB (1<<13)
if(damagebits & DMG_BLAST)
{
SetHamParamInteger(5, damagebits | DMG_ALWAYSGIB);
}
return HAM_IGNORED;
}
public C4_Gibs()
{
if(!b_CanReplaceGIBS)
return PLUGIN_CONTINUE;
new iMessageType = get_msg_arg_int( 1 );
if(iMessageType == TE_SPRITE)
{
new Float:origin[3];
origin[0] = get_msg_arg_float(2);
origin[1] = get_msg_arg_float(3);
origin[2] = get_msg_arg_float(4);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY,{0,0,0},0);
{
write_byte(TE_BREAKMODEL)
write_coord_f(origin[0]+random_float(-11.0, 11.0))
write_coord_f(origin[1]-random_float(-11.0, 11.0))
write_coord_f(origin[2]+random_float(1.0, 75.0))
write_coord_f(16.0)
write_coord_f(16.0)
write_coord_f(16.0)
write_coord(random_num(-1500, 10000))
write_coord(random_num(-1500, 10000))
write_coord(75)
write_byte(200)
write_short(iGibModels)
write_byte(random_num(40, 150))
write_byte(100)
write_byte(0x10)
}
message_end();
}
return PLUGIN_CONTINUE;
}