View Single Post
Author Message
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 10-29-2014 , 00:41   [TF2] Custom Backpack Viewer
Reply With Quote #1

[TF2] Custom Backpack Viewer

v1.1.3

Description:
Implements the !bp (and !backpack) command which is ubiquitous across TF2 trade servers, but allows players to customize their viewer preference with the !settings menu. By default it supports Backpack.tf, Bazaar.tf, Steam, TF2B, and TF2Items.

You can add your own viewers if your preference isn't already implemented. The backpack_viewer.txt file (which goes under /addons/sourcemod/data) defines the available viewers. If you wish to customize it, copy it to /addons/sourcemod/configs first or else it may be overwritten when you update the plugin. Each viewer is defined in a section like this:

Code:
"internalname" // The internal name of the viewer, used in the backpack_viewer_default cvar and the client's cookie
{
    "name"    "Viewer Name" // The displayed name of the viewer
    "url"     "http://example.com/backpack/{ID}" // The URL to open. {ID} will be replaced with the target's Steam ID, {NAME} will be replaced with the target's name, and {SERVER_IP} will be replaced with the server's IP (or anonymous if backpack_viewer_allow_tracking is off)
    "idtype"   "3" // The type of Steam ID to replace {ID} with
}
Valid values for idtype are 0 (the format shown in the status command), 1 (STEAM_0:0:23071901 format), 2 ([U:1:46143802] format), and 3 (76561198006409530 format).

This plugin requires SourceMod version 1.6.3 or later.

Commands:
sm_backpack - View the backpack of the player named in the command arguments, or the player you're aiming at. Opens a menu if no match.
sm_bp - Same as above

Cvars:
backpack_viewer_version - plugin version
backpack_viewer_auto_update (default 1) - enables automatic updating (has no effect if Updater is not installed)
backpack_viewer_default (default "backpacktf") - the default viewer to use for clients who haven't customized their preference (value should be the internal name of one of the available viewers)
backpack_viewer_allow_tracking (default 1) - if enabled, your server's IP will be sent to backpack viewer sites if the site being used is configured to receive it. No built-in viewers are configured to receive your server IP, so this is mainly for a custom viewer you might have for your community.

The internal names of the built-in viewers are backpacktf, bazaar, steam, tf2b, and tf2items.

Installation:
Extract backpack_viewer.zip, upload its contents to your /addons/sourcemod directory, and reboot your server or type "sm plugins load backpack_viewer" into your console or rcon.

Auto Update:
Install Updater. The plugin will be auto-updated according to your Updater settings. It'll work without Updater.

Changelog:
  • v1.0.0 (10/29/12)
    • Initial release

Download Plugin (backpack_viewer.zip)
__________________

Last edited by Dr. McKay; 07-07-2022 at 19:19.
Dr. McKay is offline