Kod:
#include <amxmodx>
#include <csx>
#include <engine>
new thetime
new c4 = -1
public plugin_init()
{
register_plugin("C4 Glow Shell","0.2","GordonFreeman") // ICQ: 50429042
register_event("CurWeapon", "bomb_dropped", "be", "1=1", "2=29") // C4 düştüğünde tespit etmek için
}
public bomb_planted(){
thetime = get_cvar_num("mp_c4timer")
set_task(1.0, "c4glow", 8038, "", 0, "b")
}
public bomb_dropped(){
c4 = find_ent_by_model(c4, "grenade", "models/w_c4.mdl")
set_task(1.0, "c4glow_dropped", 8039, "", 0, "b")
}
public c4glow(){
c4 = find_ent_by_model(c4, "grenade", "models/w_c4.mdl")
--thetime // countdown
// Set colors for planted C4
new Float:colors[3]
if(thetime>=40){
colors[0] = 0.0
colors[1] = 128.0
colors[2] = 0.0
}
else if(thetime>=35){
colors[0] = 128.0
colors[1] = 255.0
colors[2] = 0.0
}
else if(thetime>=30){
colors[0] = 255.0
colors[1] = 255.0
colors[2] = 128.0
}
else if(thetime>=25){
colors[0] = 255.0
colors[1] = 255.0
colors[2] = 64.0
}
else if(thetime>=20){
colors[0] = 255.0
colors[1] = 128.0
colors[2] = 0.0
}
else if(thetime>=10){
colors[0] = 255.0
colors[1] = 128.0
colors[2] = 128.0
}
else if(thetime>=0){
colors[0] = 255.0
colors[1] = 0.0
colors[2] = 0.0
}
// Apply colors
entity_set_int(c4,EV_INT_rendermode,kRenderTransColor)
entity_set_int(c4,EV_INT_renderfx,kRenderFxGlowShell)
entity_set_vector(c4,EV_VEC_rendercolor,colors)
entity_set_float(c4,EV_FL_renderamt,128.0) // ammout of glow, try 255.0 or 1.0 ;)
if(thetime==0)
remove_task(8038)
}
public c4glow_dropped(){
c4 = find_ent_by_model(c4, "grenade", "models/w_c4.mdl")
// Set colors for dropped C4 (red)
new Float:colors[3]
colors[0] = 255.0
colors[1] = 0.0
colors[2] = 0.0
// Apply colors
entity_set_int(c4,EV_INT_rendermode,kRenderTransColor)
entity_set_int(c4,EV_INT_renderfx,kRenderFxGlowShell)
entity_set_vector(c4,EV_VEC_rendercolor,colors)
entity_set_float(c4,EV_FL_renderamt,128.0) // ammout of glow, try 255.0 or 1.0 ;)
}