搜索
查看: 5056|回复: 24

【感谢olol老大】浏览网页+死后自动浏览指定页面的插件!

[复制链接]
发表于 2005-1-17 13:55:36 | 显示全部楼层 |阅读模式 来自 中国–湖北–宜昌
基于 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
}
发表于 2005-1-17 14:28:21 | 显示全部楼层 来自 中国–北京–北京
那下一局开始后,玩家还得手动关闭网页吧?多耽误时间

所以还需要设为 当一局结束,马上自动关闭web页。
回复

使用道具 举报

 楼主| 发表于 2005-1-17 14:53:57 | 显示全部楼层 来自 中国–湖北–宜昌
恩,那样就更完美了! :20:
回复

使用道具 举报

 楼主| 发表于 2005-1-17 17:32:03 | 显示全部楼层 来自 中国–湖北–宜昌
感谢olol老大实现了我需要的功能!
回复

使用道具 举报

发表于 2005-1-17 17:53:26 | 显示全部楼层 来自 中国–福建–莆田
把你老大给你的源代码提供给我们呀
回复

使用道具 举报

发表于 2005-1-17 17:53:59 | 显示全部楼层 来自 中国–福建–莆田
要amxx1.0 的哦
回复

使用道具 举报

 楼主| 发表于 2005-1-17 17:57:57 | 显示全部楼层 来自 中国–湖北–宜昌
老大只给了我amx0.99的。。。

我也没有用AMXX。。。。
回复

使用道具 举报

发表于 2005-1-17 21:30:26 | 显示全部楼层 来自 中国–北京–北京
那现在能自动关闭马???

总觉得强行让玩家看网页,效果不好,人家愿意看吗?

两厢情愿才完美。
回复

使用道具 举报

发表于 2005-1-17 21:44:04 | 显示全部楼层 来自 中国–广西–柳州
感觉是:不能强人所难!!!
不是吗????
回复

使用道具 举报

发表于 2005-1-17 23:06:10 | 显示全部楼层 来自 中国–北京–北京
死了---看网页---新一局开始---先关网页---再买枪....好位置都让敌人占了...

楼主的服务器公布一下吧

让有条件的,进去感觉一下。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表