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

TF2 Class limit


Post New Thread Reply   
 
Thread Tools Display Modes
The009
Member
Join Date: Feb 2007
Old 06-20-2008 , 16:25   Re: TF2 Class limit
Reply With Quote #161

Quote:
Originally Posted by blik View Post
First post?
http://www.sourcemod.net/vbcompiler.php?file_id=24438

It's the second one down on the first post.
__________________
The009 is offline
Send a message via AIM to The009 Send a message via MSN to The009 Send a message via Yahoo to The009 Send a message via Skype™ to The009
Downtown1
Veteran Member
Join Date: Mar 2004
Old 06-21-2008 , 02:52   Re: TF2 Class limit
Reply With Quote #162

I am using this on my server to limit pyros to 3 right now, works great!

I also wanted admins to be able to switch to pyros at any time, but wanted admins to count towards the limit (i.e. admin can become pyro when there are 3 pubbers playing pyro, but pubbers can't become pyro if 3 admins are playing pyro).

So I made this little tweak, it was really just one extra line of code, obvious to anyone who scripts, but might be helpful to someone who doesn't.
Attached Files
File Type: sp Get Plugin or Get Source (MaxClass_beta2.sp - 293 views - 12.5 KB)
Downtown1 is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 06-21-2008 , 10:30   Re: TF2 Class limit
Reply With Quote #163

Quote:
Originally Posted by Downtown1 View Post
I am using this on my server to limit pyros to 3 right now, works great!

I also wanted admins to be able to switch to pyros at any time, but wanted admins to count towards the limit (i.e. admin can become pyro when there are 3 pubbers playing pyro, but pubbers can't become pyro if 3 admins are playing pyro).

So I made this little tweak, it was really just one extra line of code, obvious to anyone who scripts, but might be helpful to someone who doesn't.
Yes, I did not want to count people with that flag because I am tired of seeing messages of the type: "Someone more powerful or more rich then you wants to have the fun that you are having, therefore we are removing you from this class and adding him."

Maybe donators should be able to remove other people from their classes, but not admins.
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
BaronFelX
Member
Join Date: Apr 2007
Old 06-21-2008 , 20:25   Re: TF2 Class limit
Reply With Quote #164

Well, I'm not quite sure why this isn't working for me, then. I have this in my maxclass.txt file, in addons/sourcemod/configs folder:
Code:
"MaxClassPlayers"
{
    //Default config if the map tree is not found
    "default"
    {
            //When there is 1 to 5 players in the server
            "1-24"
            {
                 //Team2 = red AND team3 = blue
                 //set to 0 if you want this to only work on one team
                 "red"        "1"
                 "blue"        "1"
             
                //Put -1 for no limit, 0 for disalowed, and any other number to set the limit
                "scout"        "-1"
                "sniper"    "-1"
                "soldier"    "-1"
                "demoman"    "-1"
                "medic"        "-1"
                "heavy"        "-1"
                "pyro"        "6"
                "spy"        "-1"
                "engineer"    "-1"
            }
    }
}
I know this is loaded, because the plugin is running and when I use sm_classlimit, it shows information consistent with what I have there. In addition, I have sm_maxclass_allow set to 1 in my server.cfg. I hear rumors that one team is limited, but not the other, but I haven't confirmed that yet.
BaronFelX is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 06-21-2008 , 20:28   Re: TF2 Class limit
Reply With Quote #165

Quote:
Originally Posted by BaronFelX View Post
Well, I'm not quite sure why this isn't working for me, then. I have this in my maxclass.txt file, in addons/sourcemod/configs folder:
Code:
"MaxClassPlayers"
{
    //Default config if the map tree is not found
    "default"
    {
            //When there is 1 to 5 players in the server
            "1-24"
            {
                 //Team2 = red AND team3 = blue
                 //set to 0 if you want this to only work on one team
                 "red"        "1"
                 "blue"        "1"
             
                //Put -1 for no limit, 0 for disalowed, and any other number to set the limit
                "scout"        "-1"
                "sniper"    "-1"
                "soldier"    "-1"
                "demoman"    "-1"
                "medic"        "-1"
                "heavy"        "-1"
                "pyro"        "6"
                "spy"        "-1"
                "engineer"    "-1"
            }
    }
}
I know this is loaded, because the plugin is running and when I use sm_classlimit, it shows information consistent with what I have there. In addition, I have sm_maxclass_allow set to 1 in my server.cfg. I hear rumors that one team is limited, but not the other, but I haven't confirmed that yet.
What is your server maxplayers?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
BaronFelX
Member
Join Date: Apr 2007
Old 06-21-2008 , 20:38   Re: TF2 Class limit
Reply With Quote #166

22, 24 if you count the reserved slots.
BaronFelX is offline
Downtown1
Veteran Member
Join Date: Mar 2004
Old 06-22-2008 , 01:48   Re: TF2 Class limit
Reply With Quote #167

Quote:
Originally Posted by Nican View Post
Yes, I did not want to count people with that flag because I am tired of seeing messages of the type: "Someone more powerful or more rich then you wants to have the fun that you are having, therefore we are removing you from this class and adding him."

Maybe donators should be able to remove other people from their classes, but not admins.
Well on mine most of the admins are donators, so it works out. Plus I don't know about other admins of mine, but when I switch to Pyro its to train up my skills (one day gonna use Pyro in a league match!)
Downtown1 is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 07-12-2008 , 14:22   Re: TF2 Class limit
Reply With Quote #168

I altered this plugin to use the TF2 extension and stock functions.

It also chooses a random class to change to instead of always picking scout, then the next one, etc.

I changed the ADMIN settings to use ConVars instead of #if defined code, include the count admins code mentioned above.

It will now also bring up the change class menu (using the function posted in the Snippet section. It still chooses a random class 1st so the player's can't just cancel the screen to remain the limited class.
Attached Files
File Type: sp Get Plugin or Get Source (MaxClass.sp - 234 views - 15.6 KB)
naris is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 07-12-2008 , 14:40   Re: TF2 Class limit
Reply With Quote #169

Hm, Can I put that on the first page?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
naris
AlliedModders Donor
Join Date: Dec 2006
Old 07-12-2008 , 14:44   Re: TF2 Class limit
Reply With Quote #170

Sure, No problem
Actually, that is a real good idea, thanks.
naris 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 05:59.


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