|
发表于 2009-6-26 19:49:31
|
显示全部楼层
|阅读模式
来自 中国–广东–深圳–宝安区
本帖最后由 eason39 于 2009-6-26 19:52 编辑
类似于DK和175进入后固定玩家。。那位提供下?谢谢- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- new check[33] = 0
- #define X_POS -1.0
- #define Y_POS 0.5
- #define HOLE_TIME 7.0
- public plugin_init()
- {
- register_plugin("block player","1.0","anzzy")
- RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
- register_logevent("EventRoundStart", 2, "1=Round_Start");
- }
- public EventRoundStart(id) //情况一:死了等待开局检查
- {
- if(check[id] == 1) //检查过的就不检查
- return PLUGIN_HANDLED;
- check[id] = 1
- set_pev(id,pev_flags,pev(id,pev_flags) | FL_FROZEN) //block player
- set_hudmessage(255,0, 0, X_POS, Y_POS, 1, 0.5, HOLE_TIME, 0.1, 0.1, -1);
- show_hudmessage(id,"进入服务器 7 秒内不能走动.")
- set_task(7.0,"remove",id)
- return PLUGIN_CONTINUE;
- }
- public Player_Spawn(id) //情况二:开局后才进入出生的,不排除刚进入等待开局
- {
- if(check[id]==1) //检查过的就不检查
- return PLUGIN_HANDLED;
- set_task(1.0,"checks",id)
- set_hudmessage(255,0, 0, X_POS, Y_POS, 1, 0.5, HOLE_TIME, 0.1, 0.1, -1);
- show_hudmessage(id,"进入服务器 7 秒内不能走动.")
- return PLUGIN_CONTINUE;
- }
- public checks(id)
- {
- if(!is_user_alive(id)) //地图夹死的,跳过
- return PLUGIN_HANDLED;
- set_pev(id,pev_flags,pev(id,pev_flags) | FL_FROZEN) //block player
- set_task(6.0,"remove",id)
- return PLUGIN_CONTINUE;
- }
- public remove(id)
- {
- new flags = pev(id,pev_flags)
- flags &= ~FL_FROZEN
- set_pev(id,pev_flags,flags)
- }
- public client_connect(id)
- {
- check[id] = 0
- }
- public client_disconnect(id)
- {
- remove_task(id)
- }
复制代码 这个是ANZZY帮我写的,但有个BUG,就是每局都会卡7秒,能否修改为首局限制7秒,其他局不限制? |
|