AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   TF2 Class Restrictions 0.6 (Updated 08/13/09) (https://forums.alliedmods.net/showthread.php?t=73104)

ColdFire 06-24-2008 04:27

Re: TF2 Class Restrictions
 
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?

willy1234x1 06-24-2008 05:16

Re: TF2 Class Restrictions
 
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

DJ Tsunami 06-24-2008 12:00

Re: TF2 Class Restrictions
 
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.

chundo 06-25-2008 00:40

Re: TF2 Class Restrictions
 
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.

ColdFire 06-25-2008 05:19

Re: TF2 Class Restrictions
 
Quote:

Originally Posted by DJ Tsunami (Post 643166)
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

bl4nk 06-25-2008 06:16

Re: TF2 Class Restrictions
 
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.

ColdFire 06-25-2008 07:19

Re: TF2 Class Restrictions
 
Guess I'll have to try, thank you bl4nk!

ColdFire 06-26-2008 04:12

Re: TF2 Class Restrictions
 
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 ?

flubber 06-26-2008 13:05

Re: TF2 Class Restrictions
 
Quote:

Originally Posted by chundo (Post 643429)
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).

willy1234x1 06-27-2008 04:16

Re: TF2 Class Restrictions
 
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.)


All times are GMT -4. The time now is 14:21.

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