ItsMods

Full Version: Disabling Custom Classes NOT CHOOSE CLASS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys I got a question for some of you GSC guys. I need a function/code that disables the Custom Classes not CHOOSE CLASS as in zxz's _menus.gsc (found it on mpgh, posted by @Yamato). As in Custom Class 1,2,3,4,5,etc. any ideas? (The reason being I want to use my own classtable.csv and not to be interrupted by other kids.) In MW3 there's a DVAR: pm_gamesetup_options_customclassrestrictions or something like this.
_menus.gsc.

Original:
Code:
self [[level.class]](response);

New:
Code:
if(isSubStr(response, "custom"))
    response = "demolitions_mp,0";
self [[level.class]](response);

Will override any custom class choices, not sure if disabling them is an option.
You need to edit _playerlogic.gsc and _menus.gsc ( or _Teams.gsc, not sure ).
There's functions before 'self notify("spawned_player");', you need to delete 'em. Then find beginClassChoose() and clear this function ( Not sure, menus,gsc or teams.gsc )
Thanks will check.
Couldn't find beginClassChoose in any GSC
(01-09-2013, 01:44)DidUknowiPwn Wrote: [ -> ]Couldn't find beginClassChoose in any GSC

It's beginClassChoice( forceNewChoice ) .
Function itsself is in _menus.gsc.


But i don't see how that'd help to just disable custom classes tbh.
I doubt you can avoid that they show up without access to the appropriate .menu file.

So what master suggested seems to be the best solution.
You could change it a bit though, so that the class menu re-opens when they choose a custom class. Something like this:

Code:
            if(isSubStr(response, "custom")) {
                self iprintlnBold("You have to choose a ^3default class!");
                wait 1.0;
                self openpopupMenu( game["menu_changeclass"] );
                continue;
            }    
            //doesn't matter if this part is above the response check or below, menu will close anyway as soon as a class is clicked on...
            self closepopupMenu();
            self closeInGameMenu();
            //
            self.selectedClass = true;
    
            self [[level.class]](response);