这个插件可能很多人都在找源码!
本帖最后由 kk阿朗 于 2009-8-19 10:33 编辑#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <cstrike>
#include <li_geoip>
new players, motd, iLen, inum, szstate, name, stats, body
public plugin_init()
{
register_plugin("Motd info of player", "1.0", "K.K.Lv")
register_clcmd("say", "checksay")
register_clcmd("say_team", "checksay")
}
public showinfoa(id, pos)
{
if (pos < 0)
return PLUGIN_HANDLED
new k = 0, star = pos * 32
new host_name
get_cvar_string("hostname", host_name, 127)
get_players(players, inum)
iLen = format(motd, 2047,"<meta charset=UTF-8><style>body{color:#ccFFFF;background-color:#445555;margin-top:5}.one{background-color:#aa9963}.two{background-color:#447866}td{font-size:12px}</style><center><b><font size=4>玩家信息来源表 一</b><table width=650>");
iLen += format(motd, 2047-iLen, "%s","<tr bgcolor=#000065><td>#<td>昵称<td>玩家排名<td>玩家IP<td>所在城市</tr>");
new end = star + 32
if (end > inum)
end = inum
new b = inum - 16
if (b < 0)
b = 0
for (new a = star; a < inum - b; ++a)
{
if (equal(szstate,"one")) copy(szstate,3,"two")
else copy(szstate,3,"one")
new ipaddress, country, area
get_user_ip(players, ipaddress, 16, 1)
geoip_info(ipaddress, country, area, 39, 63)
get_user_name(players, name, 31)
new rank_pos = get_user_stats(players, stats, body)
iLen += format(motd, 2047-iLen,"<tr class=%s><td>%d<td>%s<td>%d<td>%s<td>%s-%s^n", szstate, ++k, name, rank_pos, ipaddress, country, area)
}
show_motd(id, motd, host_name)
return 0;
}
public showinfob(id, pos)
{
if (pos < 0)
return PLUGIN_HANDLED
new k = 16, star = pos * 32
new host_name
get_cvar_string("hostname", host_name, 127)
get_players(players, inum)
iLen = format(motd, 2047,"<meta charset=UTF-8><style>body{color:#ccFFFF;background-color:#445555;margin-top:5}.one{background-color:#aa9963}.two{background-color:#447866}td{font-size:12px}</style><center><b><font size=4>玩家信息来源表 二</b><table width=650>")
iLen += format(motd, 2047-iLen, "%s","<tr bgcolor=#000065><td>#<td>昵称<td>玩家排名<td>玩家IP<td>所在城市</tr>")
new end = star + 32
if (end > inum)
end = inum
for (new a = star + 16; a < end; ++a)
{
if (equal(szstate,"one")) copy(szstate,3,"two")
else copy(szstate,3,"one")
new ipaddress, country, area
get_user_ip(players, ipaddress, 16, 1)
geoip_info(ipaddress, country, area, 39, 63)
get_user_name(players, name, 31)
new rank_pos = get_user_stats(players, stats, body)
iLen += format(motd, 2047-iLen,"<tr class=%s><td>%d<td>%s<td>%d<td>%s<td>%s-%s^n", szstate, ++k, name, rank_pos, ipaddress, country, area)
}
show_motd(id, motd, host_name)
return 0;
}
public cmdShowInfocheck(id, pos)
{
new playersunm = get_playersnum()
if (!(playersunm > 16))
return PLUGIN_HANDLED
showinfob(id, pos)
return PLUGIN_CONTINUE
}
public checksay(id, pos)
{
new said
read_args(said, 31)
if (equali(said, "^"/info1^"") || equali(said, "^"info1^""))
showinfoa(id, pos)
else if (equali(said, "^"/info2^"") || equali(said, "^"info2^""))
cmdShowInfocheck(id, pos)
return PLUGIN_CONTINUE
}
本帖最后由 yangxi2008 于 2009-5-17 21:20 编辑
顶一下, 精神可佳
需要那么多函数么 郁闷看得眼花
什么原因啊 2# yangxi2008
是因为你的源码格式没有保存为utf-8格式,所以才这样!! :loveliness:
看不明白是什么
但好像很有意思
是TOP15还是类似的东东
不过在那个显示玩家IP有是怎么记录的呢,是记录最后一次登陆IP还是什么
不过我建议最好不好显示IP地址,因为泄漏IP地址总不是什么好事 4# wan482
这个显示的是当前在服务器上的玩家信息! 最多可以显示多少人?? 6# Hebe
32个人!!! 不错,有点意思 不可能哟绝对的UTF-8 无ROM 格式 很不错,方便大伙