搜索
查看: 2253|回复: 3

求助右上角显示时间的插件问题.

[复制链接]
发表于 2006-10-10 11:34:12 | 显示全部楼层 |阅读模式 来自 中国–广东–广州–荔湾区
它显示时和蹲坑的提示语和死亡后显示玩家IP地址冲突..一闪一闪的显示..如:蹲坑的提示:"可以蹲坑"一闪又显示右上角的时间....我的是AMXX1.60的.那位大哥帮我看看是怎么回事.
[PHP]/* AMX Mod X script.
*
* Knife Arena  
*              == last edited by KinSprite ==
*
* amx_knives 1 - restricts weapons to knives
*            0 - enables all weapons
*
*/
#include <amxmodx>
#include <amxmisc>
new bool:KnifeEnabled = true
new option[2]
new round
public amx_enableknife(id,level,cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new arg1[4]
read_argv(1,arg1,3)
if (equal(arg1,"1")||equali(arg1,"on"))
{
  KnifeEnabled = true
}
else
{
  if (equal(arg1,"0")||equali(arg1,"off"))
  {
   KnifeEnabled = false
  }
  else
  {
   console_print(id,"Knives Only Mode is %s",KnifeEnabled ? "enabled" : "disabled")
   return PLUGIN_HANDLED
  }
}
console_print(id,"Knives Only Mode %s",KnifeEnabled ? "enabled" : "disabled")
client_print(0,print_center,"Knives Only Mode Has Been %s!",KnifeEnabled ? "Enabled" : "Disabled")
engclient_cmd(0,"weapon_knife")
set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,KnifeEnabled ? "Knives Only Allowed" : "All Guns Allowed" )
return PLUGIN_HANDLED
}
public switchweapon(id)
{
if (round<1 || !KnifeEnabled)
  return PLUGIN_CONTINUE
new wpn = read_data(2)
if (wpn == CSW_C4)
  return PLUGIN_CONTINUE
if (round < get_cvar_num("amx_kniferound") && (wpn == CSW_HEGRENADE || wpn == CSW_SMOKEGRENADE || wpn == CSW_FLASHBANG))
  return PLUGIN_CONTINUE
engclient_cmd(id,"weapon_knife")
return PLUGIN_CONTINUE
}
new votepistols[] = "\yAMX %s Knives Only Mode?\w^n^n1. Yes^n2. No"
public vote_knives(id)
{
new Float:voting = get_cvar_float("amx_last_voting")
if (voting > get_gametime())
{
  client_print(id,print_chat,"* There is already one voting...")
  return PLUGIN_HANDLED
}
if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime())
{
  client_print(id,print_chat,"* Voting not allowed at this time...")
  return PLUGIN_HANDLED
}
new menu_msg[256]
format(menu_msg,255,votepistols,KnifeEnabled ? "Disable" : "Enable")
new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
set_cvar_float("amx_last_voting", get_gametime() + vote_time )
show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(vote_time))
set_task(vote_time,"check_votes")
client_print(0,print_chat,"* Voting has started...")
option[0]=option[1]=0
return PLUGIN_HANDLED
}
public vote_count(id,key)
{
if ( get_cvar_float("amx_vote_answers") )
{
  new name[32]
  get_user_name(id,name,31)
  client_print(0,print_chat,"* %s voted %s", name, key ? "against" : "for" )
}
++option[key]
return PLUGIN_HANDLED
}
public check_votes(id)
{
if (option[0] > option[1])
{
  server_cmd( "amx_knives %s", KnifeEnabled ? "off" : "on" )
  client_print(0,print_chat,"* Voting successful (yes ^"%d^") (no ^"%d^").",option[0],option[1])
}
else
{
  client_print(0,print_chat,"* Voting failed (yes ^"%d^") (no ^"%d^").",option[0],option[1])
}
return PLUGIN_CONTINUE
}
public end_round()
{
if (round >0)
  round --
else
  round = 0
return PLUGIN_CONTINUE
}
public reset_round()
{
round = get_cvar_num("amx_kniferound")
return PLUGIN_CONTINUE
}
public reset_player(id)
{
if (round>0 && KnifeEnabled)
{
  new sz[90]
  new len = format(sz,89," 杩樻湁%i灞€涓哄垁鎴樻ā寮忋€?,round)
  if (round < get_cvar_num("amx_kniferound"))
   format(sz[len],89-len,"^n 浣嗘槸鏈眬鎮ㄥ彲浠ヤ娇鐢ㄦ墜闆?")
  set_hudmessage(200,0,0,-1.0,0.35,1,6.0,12.0,0.3,0.3,5)
  show_hudmessage(id,sz)
}
}
public plugin_init()
{
register_plugin("Knife Arena","1.0","tcquest78 & KinSprite")
register_cvar("amx_kniferound","2")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_concmd("amx_knives","amx_enableknife",ADMIN_LEVEL_B,"<1|0> - knives only mode")
register_clcmd("say /voteknives","vote_knives",0,"- start voting session for knives only mode")
register_menucmd(register_menuid("Knives Only Mode?"),(1<<0)|(1<<1),"vote_count")
register_event("SendAudio", "end_round", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw")
register_event("TextMsg", "reset_round", "a", "2&#Game_C", "2&#Game_w")
register_event("ResetHUD","reset_player","b")
round = get_cvar_num("amx_kniferound")
return PLUGIN_CONTINUE
}  [/PHP]
发表于 2006-10-10 12:05:13 | 显示全部楼层 来自 中国–天津–天津

回复: 求助右上角显示时间的插件问题.

蹲坑插件、时间插件,每个都一直占用一个hudmessage频道,频道一共才 4 个!
所以,建议: 不要使用 或 同时使用这类插件。
回复

使用道具 举报

发表于 2006-10-10 12:28:49 | 显示全部楼层 来自 中国–广东–广州–海珠区

回复: 求助右上角显示时间的插件问题.

跟我一样郁闷这些问题…… 建议使用半小时报时就OK
回复

使用道具 举报

发表于 2006-10-10 12:52:43 | 显示全部楼层 来自 中国–山西–忻州

回复: 求助右上角显示时间的插件问题.

靠........我的AMXX不知道怎么了.
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表