Raised This Month: $51 Target: $400
 12% 

TF2 Class Restrictions 0.6 (Updated 08/13/09)


Post New Thread Reply   
 
Thread Tools Display Modes
Leontar
Junior Member
Join Date: Jul 2010
Old 07-31-2011 , 02:24   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #371

How you set percentage limits ?
Leontar is offline
scso1502
Senior Member
Join Date: Dec 2007
Location: Windsor, CA USA
Old 08-04-2011 , 16:21   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #372

Is anyone else having trouble running this plugin on a Windows-based server box? I have the below settings in the /cfg/sourcemod.cfg file of each server and every class I try to limit is completely restricted and no players can choose those classes at all. The only setting I can use is the default -1 setting, which allows unlimited use of each class again.

I running MM:Source 1.9.0 dev-v and SM 1.4.0-dev

Any help would be appreciated.

Settings used:

sm_classrestrict_enabled 1 // Enable/disable restricting classes in TF2 (0/1, default 1)
sm_classrestrict_flags "" // Admin flags for restricted classes in TF2 (default "")
sm_classrestrict_immunity 1 // Enable/disable admins being immune for restricted classes in TF2. (0/1 default 0)

//Limits for Blue classes in TF2. (-1 for no limit, anything higher will be the limit for that class. Default -1)
sm_classrestrict_blu_demomen -1
sm_classrestrict_blu_engineers -5
sm_classrestrict_blu_heavies -1
sm_classrestrict_blu_medics -1
sm_classrestrict_blu_pyros -1
sm_classrestrict_blu_scouts -1
sm_classrestrict_blu_snipers -4
sm_classrestrict_blu_soldiers -1
sm_classrestrict_blu_spies -4

// Limits for Red classes in TF2. (-1 for no limit, anything higher will be the limit for that class. Default -1)
sm_classrestrict_red_demomen -1
sm_classrestrict_red_engineers -5
sm_classrestrict_red_heavies -1
sm_classrestrict_red_medics -1
sm_classrestrict_red_pyros -1
sm_classrestrict_red_scouts -1
sm_classrestrict_red_snipers -4
sm_classrestrict_red_soldiers -1
sm_classrestrict_red_spies -4
__________________

Lt. Maverick
BOOM! Gaming & Technology Community
www.boomgaming.net

Last edited by scso1502; 08-04-2011 at 18:56.
scso1502 is offline
Nicholas
New Member
Join Date: Aug 2011
Old 08-05-2011 , 01:29   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #373

Quote:
Originally Posted by scso1502 View Post
Is anyone else having trouble running this plugin on a Windows-based server box? I have the below settings in the /cfg/sourcemod.cfg file of each server and every class I try to limit is completely restricted and no players can choose those classes at all. The only setting I can use is the default -1 setting, which allows unlimited use of each class again.

I running MM:Source 1.9.0 dev-v and SM 1.4.0-dev

Any help would be appreciated.

Settings used:

sm_classrestrict_enabled 1 // Enable/disable restricting classes in TF2 (0/1, default 1)
sm_classrestrict_flags "" // Admin flags for restricted classes in TF2 (default "")
sm_classrestrict_immunity 1 // Enable/disable admins being immune for restricted classes in TF2. (0/1 default 0)

//Limits for Blue classes in TF2. (-1 for no limit, anything higher will be the limit for that class. Default -1)
sm_classrestrict_blu_demomen -1
sm_classrestrict_blu_engineers -5
sm_classrestrict_blu_heavies -1
sm_classrestrict_blu_medics -1
sm_classrestrict_blu_pyros -1
sm_classrestrict_blu_scouts -1
sm_classrestrict_blu_snipers -4
sm_classrestrict_blu_soldiers -1
sm_classrestrict_blu_spies -4

// Limits for Red classes in TF2. (-1 for no limit, anything higher will be the limit for that class. Default -1)
sm_classrestrict_red_demomen -1
sm_classrestrict_red_engineers -5
sm_classrestrict_red_heavies -1
sm_classrestrict_red_medics -1
sm_classrestrict_red_pyros -1
sm_classrestrict_red_scouts -1
sm_classrestrict_red_snipers -4
sm_classrestrict_red_soldiers -1
sm_classrestrict_red_spies -4
Your problem is that you are putting a the negative sign in front of the class limits. -1 means no limit. If you want to limit engineers then it is 5, not -5. The same goes for the rest. It should work when you fix this.

I would appreciate a explanation of percentage limits work as well. Do we put ##%?
Nicholas is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 08-05-2011 , 01:48   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #374

This plugin works fine for me on my servers.
Drixevel is offline
deathcurse
Senior Member
Join Date: Jun 2006
Location: UK
Old 08-08-2011 , 11:57   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #375

Is it possible to hand the class limits immunity slightly differently? If there is a limit of 2 on a certain class, can immune players add to the count rather than kicking someone who isn't immune from the class (until they change class). If that makes sense...
__________________
Clan of Doom: www.clanofdoom.co.uk
deathcurse is offline
Nicholas
New Member
Join Date: Aug 2011
Old 08-11-2011 , 03:14   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #376

For those of you attempting to get the percentages working:

Enter them as fractions. Ex: .4, .5, .1, .8, .13, .24, ETC.

The fraction is multiplied by the number of players on your team. Then rounded to the nearest whole number.

So. Say you have a 24 man server. 12 people on each team.

Class limit = (Fraction * Amount of Team Members)
Class limit = (.1 * 12)
Class limit = 1.2
Class Limit = 1 max.

I hope this helps.
Nicholas is offline
heffebaycay
Junior Member
Join Date: Nov 2010
Old 08-14-2011 , 17:00   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #377

I've modified this plugin a tiny bit to add a feature I think was missing: ignoring admins when checking whether a team is full. The idea behind it is that admins can pick a class without annoying the other players.

It works by setting sm_classrestrict_ignoreadmins to 1.

I attached the source code to this message, if anyone is interested.
Attached Files
File Type: sp Get Plugin or Get Source (classrestrict.sp - 292 views - 8.2 KB)
heffebaycay is offline
m4x
Junior Member
Join Date: Sep 2008
Old 08-16-2011 , 06:00   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #378

Great work for ignoreadmins!

Tsunami, I love the percentage settings, but then, it would need some improvements. Could somebody think/script it?

When I use percenatage settings, no snipers at all are allowed until there are 3 players in team. Now, when 5 players are playing, the stronger team has stronger classes and thus even more power than the smaller team (it is not just about the snipers).

Could somebody add a few variables? So that it would be possible to set the minimal limit (set snipers to 1, for example) - and so the actual limit would be 1 ore bigger, depending on number of players, but never 0.

If I just set fix limits, then in small teams there are too many snipers and spies... I would really enjoy if it starts with 1 pro team and only with enough players on the server the limit goes up.

Please! Please!
m4x is offline
qkrehfdl
New Member
Join Date: Sep 2010
Old 08-20-2011 , 00:48   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #379

This plugin dosen't works at all.
Any conflicted plugins that i'm using? :

plugins
=======

admin-flatfile
adminhelp
adminmenu
afk_manager
antiflood
basebans
basechat
basecomm
basecommands
basetriggers
basevotes
classrestrict
clientprefs
countrynick
deadchat_tf
funcommands
funvotes
gscramble
hpk_lite
mapchooser
MotdBackPack
nextmap
playercommands
reservedslots
rockthevote
sounds
TF2_Stats










or config problem?

class.cfg:

"sm_classrestrict_red_spies" = "2"
"sm_classrestrict_red_soldiers" = "-1"
"sm_classrestrict_red_snipers" = "0.35"
"sm_classrestrict_red_scouts" = "0.4"
"sm_classrestrict_red_pyros" = "-1"
"sm_classrestrict_red_medics" = "-1"
"sm_classrestrict_red_heavies" = "-1"
"sm_classrestrict_red_engineers" = "2"
"sm_classrestrict_red_demomen" = "-1"

"sm_classrestrict_blu_spies" = "2"
"sm_classrestrict_blu_soldiers" = "-1"
"sm_classrestrict_blu_snipers" = "0.35"
"sm_classrestrict_blu_scouts" = "0.4"
"sm_classrestrict_blu_pyros" = "-1"
"sm_classrestrict_blu_medics" = "-1"
"sm_classrestrict_blu_heavies" = "-1"
"sm_classrestrict_blu_engineers" = "2"
"sm_classrestrict_blu_demomen" = "0"

"sm_classrestrict_immunity" = "0"
"sm_classrestrict_flags" = ""
"sm_classrestrict_enabled" = "1"
qkrehfdl is offline
Zynaga
New Member
Join Date: Aug 2011
Old 08-22-2011 , 15:29   Re: TF2 Class Restrictions 0.6 (Updated 08/13/09)
Reply With Quote #380

This mod is awsome!

However it posseses one flaw with the percentages.

1st example:
12 Players
Each class restriction set to 25% (.25)
Allows:
3 Demos
3 Snipers
3 Spys
3 Pyros

2nd example:
8 Players
Each class restriction set to 25% (.25)
Allows:
2 Demos
2 Snipers
2 Spys
2 Pyros

3nd example:
4 Players
Each class restriction set to 25% (.25)
Allows:
1 Demos
1 Snipers
1 Spys
1 Pyros

Untill here the math is perfecly applied, even on the next step, that's the problem.

When there is less than 2 players (since it's rounded, 3 and 4 will give 1 player) or no players at all, people simply can't join bacuse 25% of 0 to 2 is... 0.

You can say i could set fixed 3 players to each class, however that would allow me 3 demos to a 4 player team, which I dont want, and it's not the same thing aswell.

I suggest adding a condition to when all are percentages and the highest percentage calculation result is lower than "1", it will be "1" untill there are enough players for the regular calculation.

I've a bit trouble explaining math in english so i hope everyone can understand me.

Thank you.

Last edited by Zynaga; 08-22-2011 at 15:35.
Zynaga is offline
Reply



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 12:55.


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