请KK帮个忙,帮忙修改下此插件 谢谢
#include <amxmodx>#include <fakemeta>
#include <hamsandwich>
new check = 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 == 1) //检查过的就不检查
return PLUGIN_HANDLED;
check = 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==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 = 0
}
public client_disconnect(id)
{
remove_task(id)
}之前已经开过贴了,这次再请KK帮个忙修改下次插件,插件本意是限制玩家首局开局固定玩家7秒不能走动,但现在插件却每句都限制玩家走动。。 麻烦KK修改下,做成玩家进入首局固定7秒不能动!谢谢了 本帖最后由 kk阿朗 于 2009-6-30 23:08 编辑
你试试吧!#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new check = 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 == 1)
return PLUGIN_HANDLED
else if (check == 0)
{
set_pev(id, pev_flags, pev(id,pev_flags) | FL_FROZEN)
set_hudmessage(255, 0, 0, X_POS, Y_POS, 1, 0.5, HOLE_TIME, 0.1, 0.1, -1)
show_hudmessage(id, "you can't move")
set_task(7.0,"remove",id)
}
return PLUGIN_CONTINUE
}
public Player_Spawn(id)
{
if(check==1)
return PLUGIN_HANDLED
else if (check == 0)
{
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, "you can't move")
}
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)
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)
check = 1
}
public client_putinserver(id)
{
if (is_user_alive(id))
check = 0
}
public client_disconnect(id)
{
remove_task(id)
} 谢谢KK帮助,我去试下. 刚测试完,把插件加载上去,换图生效,玩家进入首局会卡着,但如果retry再进去 就无效了。 现在是不是就剩下retry这个问题了??
我会再帮你调试一下!
由于昨天刚喝了几杯小酒!!嘻嘻!不好意思!!!:lol 没错 刚才我是加到混战的,但目前发现的就是retry问题,其他暂时没发现问题..需要测试才知道 希望尽快能解决此问题 :lol 今天终于考完试了!!
这个你再测试一下!记住,什么情况都要测试!!#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new check = 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")
register_event("TextMsg", "eStart_Game", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
}
public EventRoundStart(id)
{
if(check == 1)
return PLUGIN_HANDLED
set_pev(id, pev_flags, pev(id,pev_flags) | FL_FROZEN)
set_hudmessage(255, 0, 0, X_POS, Y_POS, 1, 0.5, HOLE_TIME, 0.1, 0.1, -1)
show_hudmessage(id, "you can't move!^nPlease waite for 7 Seconds!")
set_task(7.0,"remove",id)
return PLUGIN_CONTINUE
}
public Player_Spawn(id)
{
if(check==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, "you can't move!^nPlease waite for 7 Seconds!")
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)
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)
check = 1
}
public client_putinserver(id)
{
if (is_user_alive(id))
check = 0
}
public client_disconnect(id)
{
remove_task(id)
check = 0
}
public eStart_Game(id)
{
check = 0
}
我会尽快测试出来,会提到详细的细节 KK,测试基本成功了,但我有个疑问,为什么了刷新一次服务器,HUD信息会显示,但玩家不会被卡住,其他一切正常,但没真正应用到混战服
页:
[1]
2