|
发表于 2010-6-17 11:47:38
|
显示全部楼层
来自 中国–广西–百色–凌云县
本帖最后由 心静如水 于 2010-6-18 22:19 编辑
帮你做个吧........代码需要回复-_- ............
也许不能尽善美.............
#include <amxmodx>
#include <hamsandwich>
#include <fun>
new tatimes[33]
new msg[64]
public plugin_init(){
register_plugin("dddzzz","2.0","A.MI")
RegisterHam(Ham_TakeDamage, "player", "player_damage");
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
}
public end_round(){
new maxplayers = get_maxplayers()
for( new i = 1; i <= maxplayers; i++){
new id=i
if( is_user_connected(id) && tatimes[id]>0 )tatimes[id]=0
}
}
public client_putinserver(id){
tatimes[id] = 0
return PLUGIN_CONTINUE
}
public client_disconnect(id){
tatimes[id] = 0
return PLUGIN_CONTINUE
}
public player_damage(victim, inflictor, attacker, Float:damage, damagebits){
if( damagebits && get_user_team(attacker)==get_user_team(victim) ){
tatimes[attacker]++
set_user_health( attacker, get_user_health(attacker)-18 );
SetHamParamFloat( 4, 0.0 );
format(msg,63,"警 告 : 那 是 队 友, 请 你 小 心 !")
set_hudmessage(248, 248, 255, -1.0, 0.6, 0, 3.0, 4.0, 0.1, 1.0, 8)
show_hudmessage(attacker, msg)
client_cmd(attacker, "spk misc/zhong");//打中队员声音文件//
if( get_user_health(attacker) < 1 ){
format(msg,63,"多 次 打 伤 队 友 只 能 处 死 你 !")
set_hudmessage(0, 248, 255, -1.0, 0.6, 0, 3.0, 4.0, 0.1, 1.0, 8)
show_hudmessage(attacker, msg)
client_cmd(0, "spk misc/zhong");//打中队员死后声音文件//
}
if( tatimes[attacker]>=5 ){
new userid = get_user_userid(attacker)
server_cmd("kick #%d ^"你爱伤害队友所以把你踢除.^"", userid)
}
return HAM_HANDLED
}
return HAM_IGNORED
}
public plugin_precache() {
precache_sound("misc/zhong.wav");
return PLUGIN_CONTINUE
} |
|