|
不说了,上传吧
#include <amxmodx>
#include <cstrike>
new g_playerkilled[33];
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[id] = 0;
}
public eNewRound()
{
for(new i=1; i<=g_maxplayers; i++)
g_playerkilled[i] = 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[killer]++;
return PLUGIN_CONTINUE;
}
public eEndRound()
{
new msg[513], maxkillcount = 0, maxkillplayercount = 0;
new ipos=format(msg, 512,"本局最佳杀手");
new maxkillplayerlist[32];
for(new i=1; i<=g_maxplayers; i++)
{
if(!is_user_connected(i)) continue;
if(g_playerkilled[i]>maxkillcount)
{
maxkillcount = g_playerkilled[i];
maxkillplayercount = 1;
maxkillplayerlist[maxkillplayercount-1] = i;
}else if(g_playerkilled[i]==maxkillcount){
maxkillplayercount++;
maxkillplayerlist[maxkillplayercount-1] = i;
}
}
if(maxkillcount>0)
{
new name[33];
ipos+=format(msg[ipos],512-ipos,"^n(杀%d人)^n————————————————^n", maxkillcount);
if(maxkillplayercount<=3)
{
for(new i=0; i<maxkillplayercount; i++)
{
get_user_name(maxkillplayerlist[i], name, 31);
ipos+=format(msg[ipos], 512-ipos, "%s^n", name);
}
}else{
for(new i=0; i<2; i++)
{
get_user_name(maxkillplayerlist[i], name, 31);
ipos+=format(msg[ipos], 512-ipos, "%s^n", name);
}
ipos+=format(msg[ipos],512-ipos,"......^n")
}
}else{
ipos+=format(msg[ipos],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);
}
额,我需要有人帮我编译一下,因为我编译的应用到游戏当中是那个不知道是什么文字..... |
|