|
你的新金钱无上限、掉钱、捡钱及发钱插件[2007年3月24日更新,修正金钱个位数不能为1和6的问题]插件,我想添加一个功能:
在每回合结束时显示一个当局杀人数最多的和金钱最多的玩家的HUD,于是想从别的插件那里分离出这部分代码加上去,可怎么都编译部成功,代码如下:public eEndRound(){
if (g_iRoundEndTriggered) return
g_iRoundEndTriggered=1
Round_Control=0
new i,maxkillcount
maxkillcount=0
new RoundEndMsg[513],ipos
new playerslist[32],playerscount
ipos=0
ipos+=format(RoundEndMsg[ipos],512-ipos,"本局杀敌最多的玩家")
get_players(playerslist,playerscount)//Get Players
for(i=0;i<playerscount;i++){
if(playerkilled[playerslist]&&playerkilled[playerslist]>maxkillcount) maxkillcount=playerkilled[playerslist]
}
if(maxkillcount){
new playername[33],playeradded=0
ipos+=format(RoundEndMsg[ipos],512-ipos," (杀%d人)^n---------------------------------^n",maxkillcount)
for(i=0;i<playerscount;i++){
if(playerkilled[playerslist]==maxkillcount){//WeiGet this players
if (get_user_name(playerslist,playername,32))
ipos+=format(RoundEndMsg[ipos],512-ipos,"%s^n",playername)
else ipos+=format(RoundEndMsg[ipos],512-ipos,"未知或已离开游戏^n")
++playeradded
}
if(playeradded>=2){
ipos+=format(RoundEndMsg[ipos],512-ipos,"......^n")
break;
}
}
}
else{
ipos+=format(RoundEndMsg[ipos],512-ipos,"^n---------------------------------^n大家太客气了,都没有杀敌^n")
}
ipos+=format(RoundEndMsg[ipos],512-ipos,"^n金钱最多的玩家^n---------------------------------^n")
new maxctmoney=0,maxtmoney=0,maxmoneytid=0,maxmoneyctid=0
for(i=0;i<playerscount;i++){
new userid=playerslist
new usermoney
if(!is_user_connected(userid)) continue
if(money_total[userid]) usermoney=money_total[userid]
else usermoney=cs_get_user_money(userid)
if(cs_get_user_team(userid)==CS_TEAM_T){
if(usermoney>maxtmoney){
maxtmoney=usermoney
maxmoneytid=userid
}
}
else {
if(usermoney>maxctmoney){
maxctmoney=usermoney
maxmoneyctid=userid
}
}
}
new ctname[33],tname[33]
if(maxmoneytid)get_user_name(maxmoneytid,tname,32)
else tname="没有人"
if(maxmoneyctid)get_user_name(maxmoneyctid,ctname,32)
else ctname="没有人"
ipos+=format(RoundEndMsg[ipos],512-ipos,"反恐小组^n%s %d^n恐怖分子^n%s %d",ctname,maxctmoney,tname,maxtmoney)
set_hudmessage( 100, 200, 0, 0.05, 0.55, 0, 0.02, 5.0, 0.1, 0.2, 2 )
show_hudmessage(0,RoundEndMsg)
} 呵呵,本人菜鸟一个,不要见笑……
请斑竹帮个忙,或者把它加入AMXX本身的HUD替换掉也行,谢谢! |
|