|
发表于 2009-8-20 23:44:35
|
显示全部楼层
来自 中国–广东–惠州–惠城区
本帖最后由 zwfgdlc 于 2009-8-21 18:50 编辑
我没试过,你自己试吧。理论上可行。
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <hamsandwich>
- #define PLUGIN_NAME "New Plug-In"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "zwfgdlc"
- new pcvar_mp_freezetime;
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1);
- }
- public fwd_PlayerSpawn( id )
- {
- if( is_user_alive(id) )
- {
- if(get_user_flags(id)&ADMIN_RESERVATION)
- {
- //如果冻结时间是1秒,直接解冻玩家
- if(get_pcvar_float(pcvar_mp_freezetime) == 1)
- set_player_flags(id)
- else //有B权限的玩家比其他玩家少一秒冻结时间,按自己需求修改
- set_task(get_pcvar_float(pcvar_mp_freezetime) - 1, "set_player_flags",id);
- }
- }
-
- return HAM_IGNORED;
- }
- public plugin_cfg()
- {
- pcvar_mp_freezetime=get_cvar_pointer("mp_freezetime");
- }
- public set_player_flags(id)
- {
- set_pev(id,pev_flags,pev(id,pev_flags)&~FL_FROZEN);
- }
复制代码 |
|