|
基于 f117bomb 的web_browse 1.4 由 olol 老大修改为玩家死后打开指定网页
下面是原码,For AMX0.99,再次谢谢olol老大!
/* AMX Mod script.
*
* (c) Copyright 2005, f117bomb&olol
* This file is provided as is (no warranties).
*/
#include <amxmod>
#include <amxmisc>
/*
* Commands:
* say /browse <url>
* amx_browse <url> - Opens specified website
* amx_whois <authid, nick or #userid> - Looks up player by steamid on steamid.elite-pimps.com
* amx_whoisteam <team name> - Looks up team on steamid.elite-pimps.com
*
* Usage:
* amx_browse http://forum.dt-club.net
* say /browse http://forum.dt-club.net
* say /browse http2://forum.dt-club.net
* say /browse http://forum.dt-club.net
* say /browse http://forum.dt-club.net
* amx_whois player (Looks up player by steamid on steamid.elite-pimps.com)
* amx_whois #11 (Looks up player by steamid on steamid.elite-pimps.com)
* amx_whoisteam 3d (Looks up team on steamid.elite-pimps.com)
*/
new default_website[] = "http://forum.dt-club.net"
new default_title[] = "DT Web Browser"
public plugin_init() {
register_plugin("Web Browser","1.5","f117bomb&olol")
register_event("DeathMsg", "start_dg", "a")
register_concmd("amx_browse","amx_browse",0,"<url> - Opens specified website")
register_concmd("amx_whois","amx_whois",0,"<authid, nick or #userid> - Looks up player by steamid on steamid.elite-pimps.com")
register_concmd("amx_whoisteam","amx_whoisteam",0,"<team name> - Looks up team on steamid.elite-pimps.com")
register_clcmd("say","event_say")
return PLUGIN_CONTINUE
}
public amx_browse(id, level, cid) {
new url[32], temp[64]
read_argv(1,url,31)
if( contain(url, "://")!=-1 )
url[0] ? show_motd(id, url, default_title) : show_motd(id, default_website, default_title)
else {
format(temp, 63, "http://%s",url)
url[0] ? show_motd(id, temp, default_title) : show_motd(id, default_website, default_title)
}
client_cmd(id, "escape")
show_motd(id, temp, default_title)
return PLUGIN_HANDLED
}
public amx_whois(id, level, cid) {
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new arg1[32]
read_argv(1,arg1,31)
new player = cmd_target(id,arg1,10)
if (!player)
return PLUGIN_HANDLED
new authid[32], name[64], url[128], title[64]
get_user_authid(player, authid, 31)
get_user_name(player, name, 31)
replace(authid,31, "STEAM_0", "0")
format(url, 127, "http://steamid.elite-pimps.com/?action=search&type=single&key=steamid&query=%s",authid)
format(title, 63, "Lookup For Player: %s",name)
show_motd(id, url, title)
client_cmd(id, "escape")
return PLUGIN_HANDLED
}
public amx_whoisteam(id, level, cid) {
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new arg1[32], url[128], title[64]
read_argv(1,arg1,31)
format(url, 127, "http://steamid.elite-pimps.com/?action=search&type=single&key=team&query=%s",arg1)
format(title, 63, "Lookup For Team: %s",arg1)
show_motd(id, url, title)
client_cmd(id, "escape")
return PLUGIN_HANDLED
}
public start_dg() {
new pv = read_data(2)
client_cmd(pv,"amx_browse http://forum.dt-club.net")
}
public event_say(id) {
new text[64], cmd[32], url[32], temp[128]
read_args(text,63)
remove_quotes(text)
parse(text, cmd, 31, url, 31)
if(equal(cmd, "/browse") || equal(cmd, "/web")) {
if( contain(url, "://")!=-1 )
url[0] ? show_motd(id, url, default_title) : show_motd(id, default_website, default_title)
else {
format(temp, 63, "http://%s",url)
url[0] ? show_motd(id, temp, default_title) : show_motd(id, default_website, default_title)
}
}
return PLUGIN_CONTINUE
} |
|