|
发表于 2009-5-23 15:06:45
|
显示全部楼层
来自 中国–广东–广州
楼主这个插件好像在官方网见过!
好像是要与网站挂勾的吧!
大家不防看看!- #include <amxmodx>
- public plugin_init() {
- register_plugin("PSRank", "3.x", "From DynAstY - Edited by Kill4Free")
- register_clcmd("say", "HandleSay", 0, "N/A")
- register_cvar("amx_psrank_url", "http://www.google.com")
- register_cvar("amx_psrank_steamid", "0")
- }
- public client_putinserver(id) {
- if (!is_user_bot(id)) {
- new param[1]
- param[0] = id
- set_task(120.0, "showinfo", id, param, 1)
- }
- return PLUGIN_CONTINUE
- }
- public showinfo(param[]) {
- client_print(param[0], print_chat, "[AMXX] Say Commands: /mystats, /ranks, /topclan and /search [playername]")
- return PLUGIN_CONTINUE
- }
- public HandleSay(id) {
- new sBaseURL[256]
- get_cvar_string("amx_psrank_url",sBaseURL,255)
- new args[256]
- read_argv(1, args, 256)
-
- // SAY /ranks or /top10
- if(containi(args, "/ranks")!=-1 || containi(args, "/top10")!=-1) {
- show_motd(id, sBaseURL, "")
- return PLUGIN_HANDLED
- }
-
- // SAY /mystats
- if(containi(args, "/mystats")!=-1) {
- new gRankURL[256]
- new search[33]
- if (get_cvar_num("amx_psrank_steamid") == 0) {
- get_user_name(id, search, 32)
- } else {
- get_user_authid(id, search, 32)
- }
- format(gRankURL, 255,"%sindex.php?submit=1&sort=skill&order=desc&search=%s", sBaseURL, search)
- show_motd(id, gRankURL, "")
- return PLUGIN_HANDLED
- }
-
- // if(containi(args, "/skill")!=-1) {
-
-
- // return PLUGIN_HANDLED
- // }
- // SAY /search processing trailing argument
- if(containi(args, "/search")!=-1) {
- new t1[32]
- new t2[32]
- parse(args,t1,32,t2,32)
- new gRankURL[256]
- format(gRankURL, 255,"%sindex.php?submit=1&sort=skill&order=desc&search=%s", sBaseURL, t2)
- show_motd(id, gRankURL, "")
- return PLUGIN_HANDLED
- }
-
- //SAY /topclan
- if (containi(args, "/topclan")!=-1) {
- new gRankURL[256]
- format(gRankURL, 255,"%sclans.php", sBaseURL)
- show_motd(id, gRankURL, "")
- return PLUGIN_HANDLED
- }
-
- return PLUGIN_CONTINUE
- }
复制代码 |
|