Плагин добавляет глоустики в игру. Это такие маленькие светящиеся палочки.
Для использования нужно взять в руки нож, и нажать клавишу перезарядки [R]
Модели были взяты из карты zm_2trains_night, за что большое спасибо автору.
Рекомендую посетить группу http://vk.com/cs_rain - там вы найдете много моих плагинов.
Также я пишу плагины на заказ, обращайтесь: http://vk.com/id64427766
const PEV_FLARE_COLOR = pev_punchangle
new const sound_glowstick_activated[] = { "items/nvg_on.wav" } // Звук Активации
new g_radius_light = 6, g_frequency = 15, g_duration = 60, g_round_sticks = 4, g_limit = 64
new cv_radius_light, cv_frequency, cv_duration, cv_round_sticks, cv_limit, cv_round_remove
new bool:g_is_alive[33], i_glowsticks[33], user_weapon[33]
///// ///// ///// ///// ///// ///// ///// ///// /////
new g_model_glowstick[][] =
"models/deadstrike/maps/light/glowstick01.mdl",
"models/deadstrike/maps/light/glowstick02.mdl",
"models/deadstrike/maps/light/glowstick03.mdl",
"models/deadstrike/maps/light/glowstick04.mdl"
for(new i = 0; i < sizeof(g_model_glowstick); i++)
precache_model(g_model_glowstick[i])
precache_sound(sound_glowstick_activated)
///// ///// ///// ///// ///// ///// ///// ///// /////
register_plugin("Glowsticks", VERSION, "Leo_[BH]")
register_dictionary("glowsticks.txt")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("CurWeapon","CurWeapon","be","1=1")
register_clcmd("glowstick", "cmd_place_glowstick")
register_clcmd("say /glowstick", "cmd_place_glowstick")
register_clcmd("say_team /glowstick", "cmd_place_glowstick")
register_forward(FM_PlayerPreThink, "fw_clientPreThink", 0)
// register_think ( GLOWSTICK_CLASSNAME, "Glowstick_Think")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
// RegisterHamBots(Ham_Spawn, "fw_PlayerSpawn_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
// RegisterHamBots(Ham_Killed, "fw_PlayerKilled")
cv_radius_light = register_cvar("glowsticks_radius_light", "6")
cv_frequency = register_cvar("glowsticks_frequency", "15")
cv_duration = register_cvar("glowsticks_duration", "60")
cv_round_sticks = register_cvar("glowsticks_round_limit", "4")
cv_limit = register_cvar("glowsticks_map_limit", "64")
cv_round_remove = register_cvar("glowsticks_round_remove", "0")
register_cvar("glowsticks", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
server_cmd("exec addons/amxmodx/configs/glowsticks.cfg")
g_radius_light = get_pcvar_num(cv_radius_light)
g_frequency = get_pcvar_num(cv_frequency)
g_duration = get_pcvar_num(cv_duration)
g_round_sticks = get_pcvar_num(cv_round_sticks)
g_limit = get_pcvar_num(cv_limit)
if(g_duration < g_frequency * 2)
g_duration = g_frequency * 2
public fw_clientPreThink(id)
if(!g_is_alive[id]) return;
if(user_weapon[id] != CSW_KNIFE) return;
if(pev(id, pev_button) & IN_RELOAD)
if(!(pev(id, pev_oldbuttons) & IN_RELOAD))
public cmd_place_glowstick(id)
if(active_sticks > g_limit)
client_print(id, print_center, "%L", id, "GLOWSTICKS_LIMIT")
client_print(id, print_center, "%L", id, "GLOWSTICKS_REMAINING", i_glowsticks[id])
client_print(id, print_center, "%L", id, "GLOWSTICKS_NULL")
public the_place_glowstick(id)
place_glowstick(id, random_num(1, 4))
///// ///// ///// ///// ///// ///// ///// ///// /////
public place_glowstick(id, color)
entity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
set_pev(entity, pev_classname, GLOWSTICK_CLASSNAME)
engfunc(EngFunc_SetModel, entity, g_model_glowstick[color-1])
set_pev(entity, pev_mins, Float:{ -0.660000, -0.660000, 0.000000 } )
set_pev(entity, pev_maxs, Float:{ 0.660000, 0.660000, 10.170000 } )
set_pev(entity, pev_size, Float:{ -0.660000, -0.660000, 0.000000, 0.660000, 0.660000, 10.170000 } )
set_pev(entity, pev_solid, SOLID_TRIGGER)
set_pev(entity, pev_movetype, MOVETYPE_TOSS)
set_pev(entity, PEV_FLARE_COLOR, rgb)
static Float:my_origin[3], Float:my_angles[3]
pev(id, pev_origin, my_origin)
pev(id, pev_angles, my_angles)
set_pev(entity, pev_origin, my_origin)
set_pev(entity, pev_angles, my_angles)
set_task(1.5, "activate_stick", entity)
public activate_stick(entity)
pev(entity, pev_origin, origin)
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
write_byte(TE_SPARKS) // TE id
engfunc(EngFunc_WriteCoord, origin[0]) // x
engfunc(EngFunc_WriteCoord, origin[1]) // y
engfunc(EngFunc_WriteCoord, origin[2]) // z
emit_sound(entity, CHAN_WEAPON, sound_glowstick_activated, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(float(g_frequency), "flare_lighting", entity, _, _, "a", g_duration / g_frequency - 1)
set_task(float(g_duration), "last_light", entity)
set_task(float(g_duration) + float(g_frequency / 3), "remove_glowstick", entity)
///// ///// ///// ///// ///// ///// ///// ///// /////
public flare_lighting(entity)
if(!pev_valid(entity)) return;
static Float:origin[3], color[3]
pev(entity, pev_origin, origin)
pev(entity, PEV_FLARE_COLOR, color)
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, origin, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, origin[0]) // x
engfunc(EngFunc_WriteCoord, origin[1]) // y
engfunc(EngFunc_WriteCoord, origin[2]) // z
write_byte(g_radius_light) // radius
write_byte(color[0]) // r
write_byte(color[1]) // g
write_byte(color[2]) // b
write_byte(g_frequency * 10) // life //
write_byte(0) // decay rate
public last_light(entity)
if(!pev_valid(entity)) return;
static Float:origin[3], color[3]
pev(entity, pev_origin, origin)
pev(entity, PEV_FLARE_COLOR, color)
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, origin, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, origin[0]) // x
engfunc(EngFunc_WriteCoord, origin[1]) // y
engfunc(EngFunc_WriteCoord, origin[2]) // z
write_byte(g_radius_light) // radius
write_byte(color[0]) // r
write_byte(color[1]) // g
write_byte(color[2]) // b
write_byte(g_frequency) // life
write_byte(3) // decay rate
public remove_glowstick(entity)
if(!pev_valid(entity)) return;
engfunc(EngFunc_RemoveEntity, entity)
///// ///// ///// ///// ///// ///// ///// ///// /////
public event_round_start()
arrayset(i_glowsticks, g_round_sticks, 33)
if(get_pcvar_num(cv_round_remove))
public remove_all_glowsticks()
static entity; entity = -1
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", GLOWSTICK_CLASSNAME)))
engfunc(EngFunc_RemoveEntity, entity)
public client_connect(id)
i_glowsticks[id] = g_round_sticks
public client_disconnect(id)
user_weapon[id] = read_data(2)
public fw_PlayerSpawn_Post(id)
public fw_PlayerKilled(id)
///// ///// ///// ///// ///// ///// ///// ///// /////
register_native("glowstick", "native_glowstick", 1)
public native_glowstick(id)
if(active_sticks > g_limit) return 0
if(!g_is_alive[id]) return 0
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Автор плагина: Leo_[BH]
// Мои плагины: http://vk.com/cs_rain
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Я предоставляю услуги в сфере Amx Mod X
// Написание плагинов на заказ: https://goo.gl/forms/7DwrBdaTnc0pJRqy2
// Создание сборки сервера под ключ: https://goo.gl/forms/GIyvSAw1IJ48szDn2
// Магазин плагинов: https://vk.com/cs_rain
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =