最佳杀手,是寡妇村每局结束后的那个最佳杀手,还有一些插件带的最佳杀手插件(非一般)
不说了,上传吧#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,"本局最佳杀手");
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,"^n(杀%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无伤亡^n")
}
set_hudmessage(80, 180, 101, -1.0, 0.6, 2, 0.02, 4.0, 0.02, 5.0, 2);
show_hudmessage(0, msg);
}
额,我需要有人帮我编译一下,因为我编译的应用到游戏当中是那个不知道是什么文字..... 丶某人的痛才是 发表于 2015-1-21 20:54
对了你怎么弄得,我弄很久都没搞好,难道是你的inc和我的inc不同?给点方法
源码保存格式为UTF-8就不是乱码了。 我帮你弄好了 顶一下啊! {:4_133:}{:4_133:}{:4_133:}{:4_133:} 不知道能不能正常显示呢? sing19 发表于 2015-1-21 08:31
我帮你弄好了
对了你怎么弄得,我弄很久都没搞好,难道是你的inc和我的inc不同?给点方法 裸奔者 发表于 2015-1-22 18:22
源码保存格式为UTF-8就不是乱码了。
对喔,我怎么忘了....可能是平时编写看多了函数都晕了.... 不只带曾能,哈哈 #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,"本局最佳杀手");
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,"^n(杀%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无伤亡^n")
}
set_hudmessage(80, 180, 101, -1.0, 0.6, 2, 0.02, 4.0, 0.02, 5.0, 2);
show_hudmessage(0, msg);
}
页:
[1]
2