麻烦Rulzy斑竹修改下
把那个插件修改成不兼容无限金钱..那些什么奖励都不要..只需要到每局结束的时候只在屏幕中间显示最佳杀人谢谢Rulzy一直的帮助 你应该把源码贴出来!而非上传之下载附件 /* Rewarding
ver 0.1 By Zhao on 2004.12.4
*/
#include <amxmodx>
#include <cstrike>
#include <csstats>
#include <unlimited_money>
#define BIG_MONEY_INDEX 16
new playerkilled
new rewards={50,100,300,500,1000,3000,5000,8000,10000,15000,20000,25000,40000,50000,80000,100000,150000,200000,500000,900000}
new g_firstblood,Round_Control
new g_random,g_roundcount
new rewardedbig,g_iRoundEndTriggered
public client_connect(id){
playerkilled=0;
}
public ramdon_money(params[]){
new killer=params
new oldamount=params
new amount
new killername
new random_range,randomvalue
random_range=(rewardedbig)?BIG_MONEY_INDEX:20//控制大额的奖励不会出现太多次
for(;;){
randomvalue=random(random_range)
amount=rewards
if (amount!=oldamount) break;
}
get_user_name(killer,killername,31)
if (g_random>0){
g_random--
set_hudmessage(0,255,0,0.05,0.25,0, 0.02, 0.4, 0.01, 0.1, 2)
show_hudmessage(0,"%s一马当先,奋勇杀敌,奖励%6d金钱",killername,amount)
new param
param=killer
param=amount
set_task(0.3,"ramdon_money",0,param,1)
}else{
if(randomvalue>=BIG_MONEY_INDEX) rewardedbig=1
//set_hudmessage(0,255,0,0.75,0.18,0, 1.0, 5.0, 0.1, 0.2, 1)
set_hudmessage(0,255,0,0.05, 0.25, 0, 0.02, 6.0, 0.01, 0.1, 2)
show_hudmessage(0,"%s一马当先,奋勇杀敌,奖励%6d金钱",killername,amount)
cs_set_user_money2(killer, cs_get_user_money2(killer)+amount)
new msg
format(msg,511,"^x03%s^x01 一马当先,奋勇杀敌,奖励^x04 %d ^x01金钱",killername,amount)
client_color(0,killer,msg)
}
}
//public client_death(killer,victim,wpnindex,hitplace,TK){
public eDeathMsg(){
new killer,victim,TK
killer=read_data(1)
if(!killer) return PLUGIN_CONTINUE
victim=read_data(2)
TK=(get_user_team(killer)==get_user_team(victim))?1:0
//headshot=read_data(3)
new wpnname
read_data(4,wpnname,3)
new killername
//if (wpnindex==CSW_C4||TK) return PLUGIN_CONTINUE
if(equal(wpnname,"c4")||TK) return PLUGIN_CONTINUE
// new headshot = ( hitplace==HIT_HEAD ) ? 1:0
new selfkill = ( killer==victim ) ? 1:0
if (selfkill) return PLUGIN_CONTINUE
playerkilled++
if(equal(wpnname,"kni")){
cs_set_user_money2(killer, cs_get_user_money2(killer)+10000)
get_user_name(killer,killername,31)
set_hudmessage(0,255,0,0.05,0.25,0, 0.2, 6.0, 0.1, 0.1, 2)
//set_hudmessage(0,255,0,0.75,0.18,0, 1.0, 1.0, 0.1, 0.2, 12)
show_hudmessage(0,"%s使用匕首杀敌,奖励10000金钱",killername)
new msg
format(msg,99,"^x03%s^x01使用匕首杀敌,奖励^x04 10000 ^x01 金钱",killername)
client_color(0,killer,msg)
//log_message("%s使用匕首杀敌,奖励10000金钱",killername)
}
if (g_firstblood){
g_firstblood=0
g_random=6
new param
param=killer
param=0;
ramdon_money(param)
}
return PLUGIN_CONTINUE
}
public client_color(playerid,colorid,msg[]){
message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
public new_round(){
new i
if (!Round_Control){
g_roundcount++
Round_Control = 1
g_firstblood=1
g_iRoundEndTriggered=0
for(i=0;i<=32;i++)playerkilled=0;
}
}
public eEndRound(){
if (g_iRoundEndTriggered) return PLUGIN_CONTINUE
g_iRoundEndTriggered=1
Round_Control=0
new i,maxkillcount
maxkillcount=0
new RoundEndMsg,ipos
new playerslist,playerscount
ipos=0
ipos+=format(RoundEndMsg,512-ipos,"本局杀敌最多的玩家")
get_players(playerslist,playerscount)//GetPlayers
for(i=0;i<playerscount;i++){
if(playerkilled]&&playerkilled]>maxkillcount) maxkillcount=playerkilled]
}
if(maxkillcount){
new playername,playeradded=0
ipos+=format(RoundEndMsg,512-ipos,"(杀%d人)^n---------------------------------^n",maxkillcount)
for(i=0;i<playerscount;i++){
if(playerkilled]==maxkillcount){//WeiGet this players
get_user_name(playerslist,playername,32)
ipos+=format(RoundEndMsg,512-ipos,"%s^n",playername)
++playeradded
if(playeradded>=2){
ipos+=format(RoundEndMsg,512-ipos,"......^n")
break;
}
}
}
}else{
ipos+=format(RoundEndMsg,512-ipos,"^n---------------------------------^n大家太客气了,都没有杀敌^n")
}
ipos+=format(RoundEndMsg,512-ipos,"^n金钱最多的玩家^n---------------------------------^n")
new maxctmoney=0,maxtmoney=0,maxmoneytid=0,maxmoneyctid=0
new id, usermoney
for(i=0;i<playerscount;i++){
id=playerslist
usermoney=cs_get_user_money2(id)
if(cs_get_user_team(id)==CS_TEAM_T){
if(usermoney>maxtmoney){
maxtmoney=usermoney
maxmoneytid=id
}
}else {
if(usermoney>maxctmoney){
maxctmoney=usermoney
maxmoneyctid=id
}
}
}
new ctname,tname
if(maxmoneytid)
get_user_name(maxmoneytid,tname,31)
else
copy(tname, 31, "没有人")
if(maxmoneyctid)
get_user_name(maxmoneyctid,ctname,32)
else
copy(ctname, 31, "没有人")
ipos+=format(RoundEndMsg,512-ipos,"反恐小组^n%s %d^n恐怖分子^n%s %d",ctname,maxctmoney,tname,maxtmoney)
set_hudmessage( 49,179,113, -1.0, 0.55, 2, 0.02, 5.0, 0.01, 0.01, 3 )
show_hudmessage(0,RoundEndMsg)
return PLUGIN_CONTINUE
}
public eRestart()
{
g_roundcount = 0
g_firstblood = 0
Round_Control = 0
rewardedbig = 0
}
public plugin_init(){
register_plugin("First Killer Reward","0.1","Zhao")
register_event("RoundTime", "new_round", "bc")
register_event("DeathMsg","eDeathMsg","a")
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")
g_firstblood=1
rewardedbig = 0
g_roundcount=0
}
/* UTF-8 func by www.DT-Club.net */
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/ 就只需要剩下一个每局最后的时候屏幕中间显示一个
本局杀敌最多的玩家
杀敌X个
ID
ID 你这源码本身就有问题!无法编译 本帖最后由 Rulzy 于 2009-9-27 13:08 编辑
#include <amxmodx>
#include <cstrike>
new g_playerkilled;
new g_maxplayers = 32;
public plugin_init()
{
register_plugin("Best Killer", "1.0", "Rulzy");
register_event("DeathMsg","eDeathMsg", "a", "1>0");
register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
register_logevent("eEndRound", 2, "0=World triggered", "1=Round_End");
g_maxplayers = get_maxplayers();
}
public client_connect(id)
{
g_playerkilled = 0;
}
public eNewRound()
{
for(new i=1; i<=g_maxplayers; i++)
g_playerkilled = 0;
}
public eDeathMsg()
{
new killer=read_data(1);
if(!is_user_connected(killer)) return PLUGIN_CONTINUE;
new victim=read_data(2);
if(!is_user_connected(victim)) return PLUGIN_CONTINUE;
if(get_user_team(killer)==get_user_team(victim)) return PLUGIN_CONTINUE; //TK
g_playerkilled++;
return PLUGIN_CONTINUE;
}
public eEndRound()
{
new msg, maxkillcount = 0, maxkillplayercount = 0;
new ipos=format(msg, 512,"本局杀敌最多的玩家^n");
new maxkillplayerlist;
for(new i=1; i<=g_maxplayers; i++)
{
if(!is_user_connected(i)) continue;
if(g_playerkilled>maxkillcount)
{
maxkillcount = g_playerkilled;
maxkillplayercount = 1;
maxkillplayerlist = i;
}else if(g_playerkilled==maxkillcount){
maxkillplayercount++;
maxkillplayerlist = i;
}
}
if(maxkillcount>0)
{
new name;
ipos+=format(msg,512-ipos,"(杀%d人)^n————————————————^n", maxkillcount);
if(maxkillplayercount<=3)
{
for(new i=0; i<maxkillplayercount; i++)
{
get_user_name(maxkillplayerlist, name, 31);
ipos+=format(msg, 512-ipos, "%s^n", name);
}
}else{
for(new i=0; i<2; i++)
{
get_user_name(maxkillplayerlist, name, 31);
ipos+=format(msg, 512-ipos, "%s^n", name);
}
ipos+=format(msg,512-ipos,"......^n")
}
}else{
ipos+=format(msg,512-ipos,"————————————————^n无伤亡^n")
}
set_hudmessage(80, 180, 101, -1.0, 0.6, 2, 0.02, 4.0, 0.02, 5.0, 2);
show_hudmessage(0, msg);
} 未测试,请自行测试。 R版R版
http://www.dt-club.net/forum/thread-45640-1-1.html 经测试..什么都不显示.. 已修改,请重试。是代码多删了,把注册一局结束事件的代码不小心删除了。
页:
[1]
2