
   /* AMX Mod script.
   *
   * (c) Copyright 2003, f117bomb
   * 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 www.google.com
   *       say /browse http://www.google.com
   *       say /browse http2://www.google.com
   *       say /browse www.google.com
   *       say /browse google.com
   *    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://amxmod.net/"
   new default_title[] = "Amx Web Browser"
   public plugin_init() {
       register_plugin("Web Browser","1.4","f117bomb")
       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&qu
   ery=%s",arg1)
       format(title, 63, "Lookup For Team: %s",arg1)
       show_motd(id, url, title)

       client_cmd(id, "escape")

       return PLUGIN_HANDLED
   }
   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
   }
