|
发表于 2014-12-8 15:06:43
|
显示全部楼层
|阅读模式
来自 中国–河北–秦皇岛
编译不成功显示错误
[mw_shl_code=pawn,true]#include <amxmodx>
#include <cstrike>
new g_kills[33] //每人杀人记数
public plugin_init(){
register_plugin("kills","1.0", "A.MI")
register_event("DeathMsg", "death_kills", "a")
register_logevent("newRound", 2, "0=World triggered", "1=Round_Start") // 回合
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
}
public client_connect(id){
g_kills[id] = 0
return PLUGIN_CONTINUE
}
public client_disconnect(id){
g_kills[id] = 0
return PLUGIN_CONTINUE
}
public newRound(){
new maxppl = get_maxplayers()
for(new i=0; i<= maxppl; ++i){
if( is_user_connected(i) )g_kills = 0
}
}
public death_kills(){
new killer = read_data(1)
if( is_user_connected(killer) ){
g_kills[killer]++
}
return PLUGIN_CONTINUE
}
public end_round(){
new twho = 0, tnub = 0, tkills
new maxppl = get_maxplayers()
for(new i=0; i<= maxppl; ++i){
if( is_user_connected(i)&& get_user_team(i)==1 ){
tkills = g_kills
if( tkills > tnub ){
tnub = tkills
twho = i
}
}
}
if( twho ){
new name[32], newmony = 1000*tnub
get_user_name(twho,name,31)
cs_set_user_money( twho, (cs_get_user_money(twho) + newmony) );
client_print(0,print_chat,"* 本局徒匪杀人最多者: %s .共 %d 人,奖励 %d .",name,tnub,newmony)
}
set_task(0.5,"REFBXX");
return
}
public REFBXX(){
new ctwho = 0, ctnub = 0, ctkills
new maxppl = get_maxplayers()
for(new i=0; i<= maxppl; ++i){
if( is_user_connected(i)&& get_user_team(i)==2 ){
ctkills = g_kills
if( ctkills > ctnub ){
ctnub = ctkills
ctwho = i
}
}
}
if( ctwho ){
new iname[32], ctnewmony = 1000*ctnub
get_user_name(ctwho,iname,31)
cs_set_user_money( ctwho, (cs_get_user_money(ctwho) + ctnewmony) );
client_print(0,print_chat,"* 本局警察杀人最多者: %s .共 %d 人,奖励 %d .",iname,ctnub,ctnewmony)
}
return
}[/mw_shl_code] |
|