AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2]MOTD backpack(With player menu) (https://forums.alliedmods.net/showthread.php?t=141963)

Munra 10-30-2010 22:17

[TF2]MOTD backpack(With player menu)
 
1 Attachment(s)
Description
This plugin brings up a player's backpack in an MOTD window, with player menu

Say Commands
!backpack
!bp
!sbp

ConVars
motdbp_version - Plugin Version
motdbp_advert - Enable or disable the plugin advert (Disabled by default)
motdbp_adtime - Time between adverts Min: 5 seconds Max: 15 minutes
motdbp_fullscreen - Enable or disable fullscreen windows (Enabled by Default)
motdbp_message - Set a custom advert message You can use any RGBA or RGB color {#RRGGBB} or {DEFAULT}, {TEAM}, {GREEN}, {LIGHTGREEN} and \n to start a new line
motdbp_site - Choose a BackPack Site, 0 = TF2OutPost.com, 1 = TF2B.com, 2 = TF2items.com

How to use advert colors
You can use any RGB(A) color with {#RRGGBB} or {DEFAULT}, {TEAM}, {GREEN}, {LIGHTGREEN}
Here is an online color picker.
Using /n will start a new line


Example 1:
Code:

{TEAM}View a backpack by typing {DEFAULT}!bp {TEAM}or {DEFAULT}!bp [playername]
Example 2:
Code:

{#0B7A7A}View a backpack by typing {#C1E823}!bp {#0B7A7A}or {#C1E823}!bp [playername] \n{#9E1145}View STEAM Inventory by typing {#C1E823}!sbp {#9E1145}or {#C1E823}!sbp [playername]
This plugin will now auto create a config file. plugin.motd.backpack.cfg can be found in your cfg/sourcemod folder
It is recommended, when updating that you delete the current cfg file, upload the smx, and restart the server. If you change the map or reload the plugin, sourcemod will recreate the old cfg in memory.

Spoiler


Usage
Type !backpack <players name>
Brings up the players backpack in an MOTD window
Type !sbp <players name>
Brings up the players steam inventory in an MOTD window
Type !bp or !sbp
Displays a menu listing players.

Special Thanks
psychonic
Tony "Drunken F00l" Paloma for creating and maintaining TF2items.com
Sneeza for maintaining TF2Outpost
bottiger for his much neater code and removing the extension requirement.
11530 for adding additional features.

ToDo
Add Avert[Done in 1.0.1]
Allow Custom Advert [Done in 2.2]
Add Player menu [Done in 2.0]

Notes
Only Tested on a windows server.
Setting your steam profile to private will also make your backpack private.
Alternate support and download topic
Test server: 216.231.142.5:27015
Test server: 216.231.142.60:27015

History
1.0.0 Initial Release
1.0.1 Added plugin advert
2.0
Added playermenu
Removed CSsteamid extension requirement
defaulted adverts to 0
Added bottiger as co-author

2.1
Added bug fixes by 11530 in post #35 and Post #46
2.2
Added fullscreen MOTD support (Thanks to 11530)
Added Custom advert message (Thanks to 11530)
Auto Creates a config file
Removed some obsolete code
Changed RegConsoleCmd to RegAdminCmd so admins overrides could still be used (Thanks 11530)
Changed obsolete variable names to more accurately represent the current version (Thanks 11530)

3.0
Added TF2Outpost.com and TF2B.com as additional backpack sites
Added !sbp which loads the user's Steam Inventory from TF2Outpost.com
Blocks the MOTD refreshing upon death. Comment Out line 12 to allow MOTD refresh (Thanks 11530)
The custom advert now allows for colors (Thanks 11530)
The custom advert now allows for new lines (Thanks 11530)
Added 11530's calculation for community id found in this post (Thanks 11530)


Previous views 903

[AiF] Biggs 10-30-2010 22:52

Re: [TF2]Player's TF2items.com backpack
 
Nice.

Invader Amoto 10-31-2010 03:16

Re: [TF2]Player's TF2items.com backpack
 
I just tried this out on my linux server. It works excellently.

Thank you so much for this.
The many people in my servers thank you.

EDIT: I do find it occasionally says "invalid target" even though it will work on the same guy the next time I type it, but it's rare. As it is, this plugin is excellent.

danmon 10-31-2010 15:23

Re: [TF2]Player's TF2items.com backpack
 
Results:
Filename: MotdBackPack.smx
Load error: Unable to load plugin (error 1: Unrecognizable file format)

And i cant recompile it since there is no source for the plugin attached :cry:

Munra 10-31-2010 16:15

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by danmon (Post 1338517)
Results:
Filename: MotdBackPack.smx
Load error: Unable to load plugin (error 1: Unrecognizable file format)

And i cant recompile it since there is no source for the plugin attached :cry:

Source is attached at the top. It would be illegal for me to supply a compiled plugin without supplying its source code.

Don't forget to add the CSsteamID.inc to your scripting/includes

Skyrider 10-31-2010 16:40

Re: [TF2]Player's TF2items.com backpack
 
Rather a coincidence when I requested this on the TF2Items channels a few days ago.. and tada, now someone has created it, hah.

TimeShift 10-31-2010 17:51

Re: [TF2]Player's TF2items.com backpack
 
Excellent plugin, and here's a suggestion:

Make the !backpack/!bp command open a menu with the players list, then you choose the player you want to see the backpack.

;)

Munra 10-31-2010 18:16

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by TimeShift (Post 1338658)
Excellent plugin, and here's a suggestion:

Make the !backpack/!bp command open a menu with the players list, then you choose the player you want to see the backpack.

;)

Thank you its on the todo list

In the mean time you can make your own custom menu.

Also you don't have to use the full players name,

Like for me you could just do !backpack Mun and it should still bring up my backpack

Munra 10-31-2010 19:44

Re: [TF2]Player's TF2items.com backpack
 
Plugin updated

Added an Advert

Skyrider 11-01-2010 06:55

Re: [TF2]Player's TF2items.com backpack
 
Make the advert as a plugin cvar so it can be disabled :).

Munra 11-01-2010 08:13

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by FF|Skyrider (Post 1339024)
Make the advert as a plugin cvar so it can be disabled :).

It is as listed at the top

motdbp_advert - Enable or disable the plugin advert

Rigges 11-02-2010 10:17

Re: [TF2]Player's TF2items.com backpack
 
:crab: My Server HMFICC wants to Know were a server is he can see with this mod working and see what it does and how it works before he will add it to our servers.

thanks :mrgreen:

Munra 11-02-2010 10:43

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by Rigges (Post 1340085)
:crab: My Server HMFICC wants to Know were a server is he can see with this mod working and see what it does and how it works before he will add it to our servers.

thanks :mrgreen:

I have a test server listed in the first post

Test server: 205.234.203.86:27015

Skyrider 11-02-2010 11:50

Re: [TF2]Player's TF2items.com backpack
 
195.242.237.116:29090
85.234.148.4:27065
207.210.252.207:27015

All my trade servers are using it as well. You are welcome to test away.

Rigges 11-02-2010 13:26

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by Munra (Post 1340115)
I have a test server listed in the first post

Test server: 205.234.203.86:27015

Thank you
I meant to edit my post as I seen it just after I posted

Quote:

Originally Posted by FF|Skyrider (Post 1340174)
195.242.237.116:29090
85.234.148.4:27065
207.210.252.207:27015

All my trade servers are using it as well. You are welcome to test away.

Also thank you for posting your servers we will check it out on several of them.

I have all ready looked at it on Munras test server.
For me it Looks pretty darn good so hopefully the powers that be will allow it.
As it seems some times that I am 2nd in command and at other times that I have little to no Powers. LMAO but Hatty is the man and Munra is the Server GOD for these things Thumbs up my Friend good work. :avast:

danmon 11-04-2010 17:29

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by Munra (Post 1338573)
Source is attached at the top. It would be illegal for me to supply a compiled plugin without supplying its source code.

Don't forget to add the CSsteamID.inc to your scripting/includes

warning 217: loose indentation

edit: it works after i recompiled but a completely harmless warning came up while recompiling: warning 217: loose indentation

Munra 11-04-2010 18:57

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by danmon (Post 1342078)
warning 217: loose indentation

edit: it works after i recompiled but a completely harmless warning came up while recompiling: warning 217: loose indentation



Yes I know I tried for an hour to find out why cause in notepad++ it looks fine. I will fix it in the next update.

naris 11-04-2010 23:52

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by danmon (Post 1342078)
warning 217: loose indentation

That is often a tabs vs. spaces thing.

Tylerst 11-05-2010 01:00

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by naris (Post 1342249)
That is often a tabs vs. spaces thing.

Indeed, if you open it in regular notepad you can see the plugin version and enable cvars are indented with spaces instead of a tab, fix that and the warning goes away

Munra 11-06-2010 00:40

Re: [TF2]Player's TF2items.com backpack
 
Thanks I noticed the problems in pastebin.

Like I said it will be fixed most likely this weekend when I add the player menu.

Sniper214 11-06-2010 14:04

Re: [TF2]Player's TF2items.com backpack
 
Works great on both my linux boxes, thanks :)

imbullg0d 11-19-2010 20:27

Re: [TF2]Player's TF2items.com backpack
 
Quick question.. I've loaded the plugin on my Linux server, but it pops up a blank motd window, any idea why? Did I miss something?


**Edit- Nevermind.. server restart fixed it, works fine. Thanks!

Munra 11-20-2010 17:24

Re: [TF2]Player's TF2items.com backpack
 
Quote:

Originally Posted by imbullg0d (Post 1352659)
Quick question.. I've loaded the plugin on my Linux server, but it pops up a blank motd window, any idea why? Did I miss something?


**Edit- Nevermind.. server restart fixed it, works fine. Thanks!

Thank you for using

cameltoe Joe 11-25-2010 05:27

Re: [TF2]Player's TF2items.com backpack
 
GREAT PLUGIN THANNKS

HellsCook 12-17-2010 00:35

Re: [TF2]Player's TF2items.com backpack
 
I was trying to add an option to access the plugin to my menu. When I try to use it, it tells me "No matching client was found". Any idea how to make it work?

Code:

        "View Backpack"
        {
            "cmd"            "sm_backpack #1"
            "execute"        "player"
            "1"
            {
                "type"        "player"
                "method"    "name"
                "title"        "Player to Examine"

            }
        }


Munra 04-15-2011 10:07

Re: [TF2]TF2items.com MOTD backpack
 
updated

2.0

Added playermenu
Removed CSsteamid extension requirement
defaulted adverts to 0

CoolJosh3k 04-17-2011 15:56

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Nice.

Now if tf2b would adapt thier site, that could be added in too.

Thankyou for this great plugin.

Munra 04-19-2011 10:09

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Quote:

Originally Posted by CoolJosh3k (Post 1452287)
Nice.

Now if tf2b would adapt thier site, that could be added in too.

Thankyou for this great plugin.

Cool

Are you using it?

I didnt really test it to much hopefully its working ok.

Munra 07-08-2011 08:34

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Any Way I can get this approved? Its been working for 8 months now.

KyleS 08-10-2011 05:00

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Hello.

1.) On line 58 you have the right idea as this will error out if the console runs the command. However, you never return Plugin_Handled so execution continues.

2.) If the target is invalid you're displaying the clients own backpack. Are you sure about this?

3.) In DisplayBackpack you get the targets Auth String, however the functions that you're using to select targets doesn't guarantee they're authorized (FindTarget). So you have the potential of filling itemsurl with garbage.

4.) Adverts default to disabled. If the value isn't changed, the timer is still running with the way it's currently setup.

5.) Why is this labeled as TF2? Wouldn't this work on any game?

Hope this helps, PM me if you fix these.

Munra 08-10-2011 16:47

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Quote:

Originally Posted by KyleS (Post 1529423)
Hello.

1.) On line 58 you have the right idea as this will error out if the console runs the command. However, you never return Plugin_Handled so execution continues.

I will look into it

Quote:

2.) If the target is invalid you're displaying the clients own backpack. Are you sure about this?
Yes
Quote:

3.) In DisplayBackpack you get the targets Auth String, however the functions that you're using to select targets doesn't guarantee they're authorized (FindTarget). So you have the potential of filling itemsurl with garbage.
I don't really know any other way to do it.

Quote:

4.) Adverts default to disabled. If the value isn't changed, the timer is still running with the way it's currently setup.
OK

Quote:

5.) Why is this labeled as TF2? Wouldn't this work on any game?
TF2 is the only game with a back pack so it would work will all games but it would be pointless. (Portal 2 has a backpack but no dedicated servers)
Quote:

Hope this helps, PM me if you fix these.
Will do.

markg 08-26-2011 01:56

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
works great, thanks!

one issue; it keeps printing the advertisement, every 30 seconds or so.

it does this with the cvar set to 600 seconds, and even with advert disabled entirely.

any ideas? on windows server

CoolJosh3k 08-28-2011 04:29

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
I just noticed an issue with the adverts too. You made a mistake in the code.

You forgot to tell the plugin to read the state of the cvar controlling the advert state.

Code:

//Timer for adverts
public Action:Adverttimer(Handle:timer)
{
        PrintToChatAll("\x03 Aim at someone and type !bp or !backpack [playername]");
        return Plugin_Continue;
}

should be:

Code:

//Timer for adverts
public Action:Adverttimer(Handle:timer)
{
        if (adsOn == 1)
        {
                PrintToChatAll("\x03 Aim at someone and type !bp or !backpack [playername]");
        }
        return Plugin_Continue;
}

I could be very wrong though, as I don't know how to write plugins yet.

CoolJosh3k 09-01-2011 15:38

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Munra may be able to fix the bug within a week.

11530 09-05-2011 12:11

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Quote:

Originally Posted by CoolJosh3k (Post 1542434)
I just noticed an issue with the adverts too. You made a mistake in the code.

You forgot to tell the plugin to read the state of the cvar controlling the advert state.

Code:

//Timer for adverts
public Action:Adverttimer(Handle:timer)
{
        PrintToChatAll("\x03 Aim at someone and type !bp or !backpack [playername]");
        return Plugin_Continue;
}

should be:

Code:

//Timer for adverts
public Action:Adverttimer(Handle:timer)
{
        if (adsOn == 1)
        {
                PrintToChatAll("\x03 Aim at someone and type !bp or !backpack [playername]");
        }
        return Plugin_Continue;
}

I could be very wrong though, as I don't know how to write plugins yet.

You're pretty much there CoolJosh, but it's best to wrap the evaluation around StartTimer() in the OnPluginStart() function, so the timer never starts until it's needed:

Code:

        if (GetConVarBool(g_Adverts))
                StartTimer();

Also I added a line to remove the handle from a stopped timer in OnAdtimeChange() purely for cleanup:

Code:

                if (g_Adtimer != INVALID_HANDLE)
                {
                        KillTimer(g_Adtimer);
                        g_Adtimer = INVALID_HANDLE;
                }

Also changed default time between adverts to 300 seconds.


Edit: See Post #46 for the latest edits.

CoolJosh3k 09-06-2011 02:57

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Thankyou.

Ipoxide 11-13-2011 17:41

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Hi i am having some problems installing this plugin on my server.

I use a Windows Tf2 server and have installed the :

Sourcemod - sourcemod-1.4.0-windows

Metamod - mmsource-1.8.7-windows

I downloaded the plugin and installed it on the plugins folder, and restarted completly my server.
I can see the advertisings and the player menu, but when i choose the player the motd appears but with nothing inside.
Also i am aiming to a player and say !bp , but instead show the motd with the player backpack it shows the menu

Can someone help me please ?

Munra 11-13-2011 20:06

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
I just checked it works in my server just give it a minute or 2 to to load the motd the first time then it should be good. That part of it is out of my hands.

Ipoxide 11-14-2011 04:26

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
Quote:

Originally Posted by Munra (Post 1596277)
I just checked it works in my server just give it a minute or 2 to to load the motd the first time then it should be good. That part of it is out of my hands.

Thanks for the tip, but it was my mistake.....

I FORGOT to enable HTML in my steam...

Its cool now, thanks for this cool plugin ^^

byteframe 12-19-2011 04:49

Re: [TF2]TF2items.com MOTD backpack(With player menu)
 
until the bug is fixed, it seems turning the adverts on and then off in your config file will work around this issue. thank you.


All times are GMT -4. The time now is 19:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.