Александр Руднев
Участник
- Сообщения
- 15
- Реакции
- 7
Убираем дым после взрыва замораживающей гранаты. (smoke_grenade)
Требуется: http://hlmod.ru/forum/zombie-reloaded/4071-grenade-effects-v1-7-a.html (желательно последней версии)
Требуется: http://hlmod.ru/forum/zombie-reloaded/4071-grenade-effects-v1-7-a.html (желательно последней версии)
PHP:
#include <sdktools>
#include <sdkhooks>
public OnPluginStart()
{HookEvent("smokegrenade_detonate", smoke_detonate, EventHookMode_Pre); AddNormalSoundHook(NormalSHook); AddTempEntHook("EffectDispatch", effect_smoke);}
public Action:smoke_detonate(Handle:event, const String:name[], bool:dontBroadcast)
{new ent = GetEventInt(event, "entid"); if(IsValidEdict(ent)) AcceptEntityInput(ent, "Kill"); SetEventBroadcast(event, true); dontBroadcast = true; return Plugin_Changed;}
public Action:NormalSHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &ent, &channel, &Float:volume, &level, &pitch, &flags)
{if(StrEqual(sample, ")weapons/smokegrenade/sg_explode.wav")) return Plugin_Stop; return Plugin_Continue;}
public Action:effect_smoke(const String:te_name[], const Players[], numClients, Float:delay)
{new ef_index = TE_ReadNum("m_iEffectName"); new String:ef_n[64]; GetEffectName(ef_index, ef_n, sizeof(ef_n)); new nHitBox = TE_ReadNum("m_nHitBox"); if(StrEqual(ef_n, "ParticleEffect"))
{new String:ef_part[64]; GetParticleEffectName(nHitBox, ef_part, sizeof(ef_part)); if(StrEqual(ef_part, "explosion_smokegrenade", false)) return Plugin_Handled;} return Plugin_Continue;}
stock GetEffectName(index, String:ef_n[], maxlen)
{static table = INVALID_STRING_TABLE;if (table == INVALID_STRING_TABLE) table = FindStringTable("EffectDispatch"); ReadStringTable(table, index, ef_n, maxlen);}
stock GetParticleEffectName(index, String:ef_n[], maxlen)
{static table = INVALID_STRING_TABLE; if (table == INVALID_STRING_TABLE) table = FindStringTable("ParticleEffectNames"); ReadStringTable(table, index, ef_n, maxlen);}