|
发表于 2025-6-6 09:08:48
|
显示全部楼层
来自 中国–香港
以下是烟雾强化的源代码,我在原有基础上新增一个参数,控制烟雾强化开关和强弱。
amx_somkeex "2"
0:关闭烟雾强化
1:烟雾强化等级1
2:烟雾强化等级2 (默认)
3:烟雾强化等级3
原链接:github.com/d3m37r4/AMXX_Plugins/blob/master/smoke_ex.sma
- #include <amxmodx>
- #include <fakemeta>
- #include <reapi>
- new g_SomkeEX
- public plugin_init()
- {
- register_plugin("SomkeEX", "1.0", "d3m37r4");
- //烟雾强化
- g_SomkeEX = register_cvar("amx_somkeex", "2");
- RegisterHookChain(RG_CGrenade_ExplodeSmokeGrenade, "CGrenade_ExplodeSmokeGrenade_Post", true);
- }
- //烟雾强化
- public CGrenade_ExplodeSmokeGrenade_Post(const ent)
- {
- new iSomkeEX = get_pcvar_num(g_SomkeEX)
- if(!iSomkeEX) return HC_CONTINUE
- if(iSomkeEX > 3) iSomkeEX = 3
- new Float:origin[3];
- get_entvar(ent, var_origin, origin);
- new m_usEvent = get_member(ent, m_Grenade_usEvent);
- if(m_usEvent)
- {
- for(new i = 0; i < iSomkeEX; i++)
- engfunc(EngFunc_PlaybackEvent, FEV_GLOBAL, 0, m_usEvent, 0.0, origin, Float:{0.0, 0.0, 0.0}, 0.0, 0.0, 0, 1, 1, 0);
- }
- return HC_CONTINUE;
- }
复制代码 |
|