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

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


Post New Thread Reply   
 
Thread Tools Display Modes
ColdFire
Member
Join Date: Jan 2008
Old 06-24-2008 , 04:27   Re: TF2 Class Restrictions
Reply With Quote #21

Hi

Would it be possible to add this kind of cvar:

sm_classrestrict_enabled_on_suddendeath so if used on the same time with suddendeath melee redux plugin, classrestrict can be disabled, and we can have all players in the same class during sudden death?
ColdFire is offline
willy1234x1
Senior Member
Join Date: Jun 2008
Old 06-24-2008 , 05:16   Re: TF2 Class Restrictions
Reply With Quote #22

Ran into a problem. I tried setting it so that each team can have only six pyros and six soldiers in a map config file (the map is pyro_tennis_a1) but people can still go as any other class if they want I had set each one to 0 but it ignored the value as a null I think
willy1234x1 is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 06-24-2008 , 12:00   Re: TF2 Class Restrictions
Reply With Quote #23

ColdFire: sudden death melee redux already has a feature to set everyone's class to the same class. In fact, it sets everyone's class to scout by default...

@willy: setting it to 0 worked fine for me while testing, so.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
chundo
Senior Member
Join Date: May 2008
Old 06-25-2008 , 00:40   Re: TF2 Class Restrictions
Reply With Quote #24

Something funny is happening with this on my server. It must be missing some events somewhere that's screwing up the running class tally. At one point tonight one team was limited to 1 pyro, and the other 2, even though they were both set to 3. It would probably be more reliable to just recalculate the class counts every time someone joins/changes class rather than keep a running tally. A little more computation, but worth it given how infrequently it will be run.

Also, hooking "joinclass" may be better than "equip" - joinclass only gets called once, equip gets called three or more times on spawn.
__________________
chundo is offline
ColdFire
Member
Join Date: Jan 2008
Old 06-25-2008 , 05:19   Re: TF2 Class Restrictions
Reply With Quote #25

Quote:
Originally Posted by DJ Tsunami View Post
ColdFire: sudden death melee redux already has a feature to set everyone's class to the same class. In fact, it sets everyone's class to scout by default...

@willy: setting it to 0 worked fine for me while testing, so.
Yes, but I wanted to know if your plugin will force restrictions when SDMR sets everyone in the same class or if there will be no problem
ColdFire is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-25-2008 , 06:16   Re: TF2 Class Restrictions
Reply With Quote #26

SDMR forces the class, when his plugin blocks the client trying to change class. There shouldn't be any problems.

[edit]

Actually, now that I look at the source of his plugin, there might be some problems. You can always try it out and see how it works.

Last edited by bl4nk; 06-25-2008 at 06:18.
bl4nk is offline
ColdFire
Member
Join Date: Jan 2008
Old 06-25-2008 , 07:19   Re: TF2 Class Restrictions
Reply With Quote #27

Guess I'll have to try, thank you bl4nk!
ColdFire is offline
ColdFire
Member
Join Date: Jan 2008
Old 06-26-2008 , 04:12   Re: TF2 Class Restrictions
Reply With Quote #28

I was wondering (I did not have time to test ClassRestrict with SDMR and see what happens in sudden death)

Would it work if:

- I add this global var: decl g_iSuddenDeath = 0 ;
- I hook teamplay_suddendeath_begin and set g_iSuddenDeath = 1
- I hook teamplay_suddendeath_end and set g_iSuddenDeath = 0
- Add a check in Event_ChangeClass and make it do nothing if g_iSuddenDeath = 1?
- and add a cvar saying if we want to do no-class-restrict in sudden death

Edit: or maybe check g_iSuddenDeath in "PickClass (iTeam)" instead of Event_ChangeClass ?
ColdFire is offline
flubber
Senior Member
Join Date: Oct 2007
Old 06-26-2008 , 13:05   Re: TF2 Class Restrictions
Reply With Quote #29

Quote:
Originally Posted by chundo View Post
Something funny is happening with this on my server. It must be missing some events somewhere that's screwing up the running class tally. At one point tonight one team was limited to 1 pyro, and the other 2, even though they were both set to 3. It would probably be more reliable to just recalculate the class counts every time someone joins/changes class rather than keep a running tally. A little more computation, but worth it given how infrequently it will be run.

Also, hooking "joinclass" may be better than "equip" - joinclass only gets called once, equip gets called three or more times on spawn.
Same problem here, one team had 1 pyro no sniper. The other had 2 pyro and 1 sniper (which is the authorized limit for us).
flubber is offline
willy1234x1
Senior Member
Join Date: Jun 2008
Old 06-27-2008 , 04:16   Re: TF2 Class Restrictions
Reply With Quote #30

So for a map config such as rocket_tennis_beta.cfg I'd place it in the /tf/cfg folder and it'd look like this
Code:
//Restriction settings for the map rocket_tennis_beta

//Restriction command 0 default for the map
sm_classrestrict_enabled 1

// Restrictions per class

sm_classrestrict_red_demomen 0
sm_classrestrict_red_engineers 0
sm_classrestrict_red_heavies 0
sm_classrestrict_red_medics 0
sm_classrestrict_red_pyros 6
sm_classrestrict_red_scouts 0
sm_classrestrict_red_snipers 0
sm_classrestrict_red_soldiers 6
sm_classrestrict_red_spies 0

sm_classrestrict_blu_demomen 0
sm_classrestrict_blu_engineers 0
sm_classrestrict_blu_heavies 0 
sm_classrestrict_blu_medics 0
sm_classrestrict_blu_pyros 6
sm_classrestrict_blu_scouts 0
sm_classrestrict_blu_snipers 0
sm_classrestrict_blu_soldiers 6
sm_classrestrict_blu_spies 0
Or is there something I'm doing wrong? This is a fun map I throw in every so often and it gets ruined by jackasses going other classes (even demoman.)

Last edited by willy1234x1; 06-27-2008 at 04:22.
willy1234x1 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 10:24.


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