|
楼主 |
发表于 2006-11-19 10:33:41
|
显示全部楼层
来自 中国–北京–北京–朝阳区
回复: 求1.76b下的显示人名字的插件
Post by et007
能把原来这个代码发上来吗?或许能改一改
原代码
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
new freezetime=0
new p_amx_allow_centerhud
new p_amx_show_player
public plugin_init() {
register_plugin("Notcenterhud", "1.0", "Sprite")
register_concmd("amx_check_hud","cmdHUD",ADMIN_SLAY,"-- cheak all players HUD view mode")
p_amx_allow_centerhud = register_cvar("amx_allow_centerhud", "0")
p_amx_show_player = register_cvar("amx_show_player", "1")
register_event("StatusValue","showStatus","be","1=2","2!0")
register_logevent("freezetimedone",2,"0=World triggered","1=Round_Start")
register_logevent("end_round",2,"0=World triggered","1=Round_End")
}
public chkHUD(id){
if(is_user_bot(id))
return PLUGIN_HANDLED
if(get_pcvar_num(p_amx_allow_centerhud)==0)
client_cmd(id,"hud_centerid 0")
set_task(2.0,"chkHUD",id)
return PLUGIN_CONTINUE
}
public cmdHUD(id ,level,cid){
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
if(get_pcvar_num(p_amx_allow_centerhud)==1) {
console_print(id,"amx_allow_centerhud was set to 1, don't need to check it now!")
return PLUGIN_HANDLED
}
set_task(0.5,"chkHUD")
return PLUGIN_HANDLED
}
public client_connect(id){
set_task(2.0,"chkHUD",id)
return PLUGIN_CONTINUE
}
public showStatus(id){
if(is_user_bot(id))
return PLUGIN_CONTINUE
new pid = read_data(2)
if(get_pcvar_num(p_amx_show_player) && !freezetime){
new name[32]
get_user_name(pid,name,31)
new color1 = 0,color2 = 0
if ( get_user_team(pid)==1 )
color1 = 205
else
color2 = 205
if ( get_user_team(id) == get_user_team(pid) ) { // friend
new clip, ammo, wpnid = get_user_weapon(pid,clip,ammo)
new wpnname[32]
get_weaponname(wpnid,wpnname,31)
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
new health = get_user_health(pid)
//if(health>1500)
// health=health-2048
//else if (health>500)
// health = health-1024
show_hudmessage(id,"%s -- %d HP / %d AP / %s",name,health,get_user_armor(pid),wpnname[7])
}
else {
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
show_hudmessage(id,name)
}
}
return PLUGIN_CONTINUE
// if (get_user_team(id)==get_user_team(pid) && is_user_alive(pid))
// client_print(id,print_center,"He's on your team, DON'T SHOOT")
}
public freezetimedone() {
freezetime = 0
}
public end_round(){
freezetime = 1
} |
|