|
本帖最后由 kk阿朗 于 2009-8-19 10:33 编辑
- #include <amxmodx>
- #include <amxmisc>
- #include <csstats>
- #include <cstrike>
- #include <li_geoip>
- new players[33][32], motd[2048], iLen, inum, szstate[4], name[32], stats[8], body[8]
- 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[128]
- get_cvar_string("hostname", host_name, 127)
-
- get_players(players[id], 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[iLen], 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[16], country[40], area[64]
- get_user_ip(players[id][a], ipaddress, 16, 1)
- geoip_info(ipaddress, country, area, 39, 63)
-
- get_user_name(players[id][a], name, 31)
- new rank_pos = get_user_stats(players[id][a], stats, body)
-
- iLen += format(motd[iLen], 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[128]
- get_cvar_string("hostname", host_name, 127)
- get_players(players[id], 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[iLen], 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[16], country[40], area[64]
- get_user_ip(players[id][a], ipaddress, 16, 1)
- geoip_info(ipaddress, country, area, 39, 63)
-
- get_user_name(players[id][a], name, 31)
- new rank_pos = get_user_stats(players[id][a], stats, body)
-
- iLen += format(motd[iLen], 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[32]
- 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
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|