权限问题
求助,帮忙加个ADMIN_IMMUNITY权限,非常感谢!~#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
const m_fGrenadeState = 114;
new exp;
new cvar_radius;
public plugin_init()
{
register_plugin("GrenadeEffect", "1.0", "xxx");
cvar_radius = register_cvar("explosion_radius", "200");//爆炸半径
RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade");
}
public plugin_precache()
exp = precache_model("sprites/shockwave.spr");
public fw_ThinkGrenade(ent)
{
// Invalid entity 无效的实体
if (!pev_valid(ent))
return HAM_IGNORED;
if (get_pdata_int(ent, m_fGrenadeState) & (1<<0))
{
blastcircles(ent);
}
return HAM_IGNORED;
}
public blastcircles(id)
{
client_print(0,print_center,"集束炫丽烈性手雷");//客户端打印信息给那个玩家。0是所有人 print_chat 左下角聊天区域,print_center 中心
new Float:forigin;
pev(id, pev_origin, forigin);
new blast = get_pcvar_num(cvar_radius);
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, forigin)
write_byte(TE_BEAMCYLINDER) //圆筒
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16 + blast)
write_short(exp)
write_byte(6)
write_byte(2)
write_byte(6)
write_byte(90)//
write_byte(4) //
write_byte(238) //
write_byte(130) //
write_byte(238)
write_byte(250)
write_byte(5)
message_end()
}
#include <amxmodx>
#include <engine>
#include <fakemeta>
new exp;
new cvar_radius;
public plugin_init()
{
register_plugin("GrenadeEffect", "1.0", "xxx");
cvar_radius = register_cvar("explosion_radius", "200");//爆炸半径
}
public plugin_precache()
exp = precache_model("sprites/shockwave.spr");
public grenade_throw(id,greindex,wpn)
{
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
blastcircles(greindex);
}
return PLUGIN_CONTINUE;
}
public blastcircles(id)
{
client_print(0,print_center,"集束炫丽烈性手雷");//客户端打印信息给那个玩家。0是所有人 print_chat 左下角聊天区域,print_center 中心
new Float:forigin;
pev(id, pev_origin, forigin);
new blast = get_pcvar_num(cvar_radius);
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, forigin)
write_byte(TE_BEAMCYLINDER) //圆筒
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16 + blast)
write_short(exp)
write_byte(6)
write_byte(2)
write_byte(6)
write_byte(90)//
write_byte(4) //
write_byte(238) //
write_byte(130) //
write_byte(238)
write_byte(250)
write_byte(5)
message_end()
}
楼上正解,但是我建议在if(get_user_flags(id) & ADMIN_IMMUNITY)后面加上if(get_user_flags(id) &ADMIN_IMMUNITY && is_user_alive),不然死了也会有特效. {:6_199:} 感谢管理员的帮助!
原本是扔手雷光环插件,加权限后不知道是什么样子的,下班后测试看看。
机子卡大叔 发表于 2016-8-25 08:14
楼上正解,但是我建议在if(get_user_flags(id) & ADMIN_IMMUNITY)后面加上if(get_user_flags(id) &ADMIN_IMM ...
{:6_195:}是扔手雷特效,没必要加验证死/活吧!
难道玩家活着扔出去有特效,在手雷爆炸前玩家死了,特效会消失吗?
下班后试试看! tly111222 发表于 2016-8-25 09:31
是扔手雷特效,没必要加验证死/活吧!
难道玩家活着扔出去有特效,在手雷爆炸前玩家死了,特效 ...
这只是个建议,你爱听不听 机子卡大叔 发表于 2016-8-25 12:42
这只是个建议,你爱听不听
{:6_180:} .......................... k1nader 发表于 2016-8-25 00:28
#include
#include
#include
插件原版是手雷特效光环,加了权限后,变成了管理员扔手雷自己发光环--手雷的光环没了{:6_180:}
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
const m_fGrenadeState = 114;
new exp;
new cvar_radius;
public plugin_init()
{
register_plugin("GrenadeEffect", "1.0", "xxx");
cvar_radius = register_cvar("explosion_radius", "200");//爆炸半径
RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade");
}
public plugin_precache()
exp = precache_model("sprites/shockwave.spr");
public fw_ThinkGrenade(ent)
{
// Invalid entity 无效的实体
if (!pev_valid(ent))
return HAM_IGNORED;
if (get_pdata_int(ent, m_fGrenadeState) & (1<<0))
{
new id = pev(ent, pev_owner);
if (is_user_connected(id) && get_user_flags(id) & ADMIN_IMMUNITY)
{
blastcircles(ent);
}
}
return HAM_IGNORED;
}
public blastcircles(id)
{
client_print(0,print_center,"集束炫丽烈性手雷");//客户端打印信息给那个玩家。0是所有人 print_chat 左下角聊天区域,print_center 中心
new Float:forigin;
pev(id, pev_origin, forigin);
new blast = get_pcvar_num(cvar_radius);
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, forigin)
write_byte(TE_BEAMCYLINDER) //圆筒
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin)
engfunc(EngFunc_WriteCoord,forigin - 16 + blast)
write_short(exp)
write_byte(6)
write_byte(2)
write_byte(6)
write_byte(90)//
write_byte(4) //
write_byte(238) //
write_byte(130) //
write_byte(238)
write_byte(250)
write_byte(5)
message_end()
}
k1nader 发表于 2016-8-25 19:54
#include
#include
#include
{:6_191:} ! 谢谢!非常感谢!
页:
[1]
2