|
如题.
我自己手上有段源码,但里面有些地方出错了,第2局本来是手枪局,他自动切换成刀了,请哪位高手帮我编译下...
还有加上提示哪局用什么武器.比如第一局就在屏幕提示本局只能用刀,第2局提示只能用手枪,第3局恢复正常模式...下面是源码.
[html]#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Jim"
new current_round = 0
new const weapon_banned[7] = {CSW_USP, CSW_GLOCK18, CSW_DEAGLE, CSW_ELITE, CSW_FIVESEVEN, CSW_P228, CSW_HEGRENADE}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("round_count", 2, "1=Round_Start")
register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
register_event("CurWeapon", "hook_weapon", "b", "2!29")
}
public round_count()
{
current_round ++
}
public round_restart()
{
current_round = 0
}
public hook_weapon(id)
{
if(current_round >2)
return PLUGIN_CONTINUE
new wpid = read_data(2)
if(current_round == 1)
engclient_cmd(id, "weapon_knife")
//else if(current_round == 2 && wpid != CSW_HEGRENADE)
//engclient_cmd(id, "weapon_knife")
else if(current_round == 2 && !IsValidWeapon(wpid))
engclient_cmd(id, "weapon_knife")
return PLUGIN_CONTINUE
}
bool:IsValidWeapon(wpid)
{
for(new i=0; i<7; i++)
{
if(wpid == weapon_banned)
return true
}
return false
}
[/html] |
|