Raised This Month: $159 Target: $400
 39% 

[TF2]MOTD backpack(With player menu)


Post New Thread Reply   
 
Thread Tools Display Modes
Munra
Senior Member
Join Date: May 2004
Old 08-10-2011 , 17:47   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #31

Quote:
Originally Posted by KyleS View Post
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.
__________________
http://anbservers.net
My Plugins
PMs for support will be ignored please use the plugin topic for support.
Munra is offline
markg
Senior Member
Join Date: Jan 2009
Old 08-26-2011 , 02:56   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #32

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
markg is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 08-28-2011 , 05:29   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #33

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 is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 09-01-2011 , 16:38   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #34

Munra may be able to fix the bug within a week.
CoolJosh3k is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 09-05-2011 , 13:11   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #35

Quote:
Originally Posted by CoolJosh3k View Post
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.

Last edited by 11530; 03-06-2012 at 06:06.
11530 is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 09-06-2011 , 03:57   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #36

Thankyou.
CoolJosh3k is offline
Ipoxide
New Member
Join Date: Nov 2011
Old 11-13-2011 , 18:41   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #37

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 ?

Last edited by Ipoxide; 11-13-2011 at 19:08.
Ipoxide is offline
Munra
Senior Member
Join Date: May 2004
Old 11-13-2011 , 21:06   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #38

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.
__________________
http://anbservers.net
My Plugins
PMs for support will be ignored please use the plugin topic for support.
Munra is offline
Ipoxide
New Member
Join Date: Nov 2011
Old 11-14-2011 , 05:26   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #39

Quote:
Originally Posted by Munra View Post
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 ^^

Last edited by Ipoxide; 11-14-2011 at 05:41.
Ipoxide is offline
byteframe
Member
Join Date: Jul 2011
Location: Pitcairn Island
Old 12-19-2011 , 05:49   Re: [TF2]TF2items.com MOTD backpack(With player menu)
Reply With Quote #40

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.
byteframe is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:41.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode