Posts: 78
Threads: 11
Joined: Dec 2010
Reputation:
2
can you add an VIP list on this mod like for my clan so my clan m8's will be in the same team when they join the server?
[V] | '][' |2 |
Posts: 29
Threads: 2
Joined: Jun 2011
Reputation:
0
How do you get the custom plant/defuse sound to work? and how can i increase the range where you can hear it? pls help
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
(06-15-2011, 13:01) T3h vICE Wrote: How do you get the custom plant/defuse sound to work? and how can i increase the range where you can hear it? pls help
Increasing the range is easy, just play it twice so its stronger. Open _gameobjects.gsc and search for doBombSound() and just put every playSound() twice
Posts: 4
Threads: 0
Joined: Jun 2011
Reputation:
0
Hi guy's, can you please help me to understand how to disable the ability for a dead player to make use of the third person view (the F3 key) on an active player and make use of a 360 circular view
Is it possible with a "standard" buld of the game ?
If yes how ? either by disabling completely or reducing the thirdperson zoom and/or elevation of the viewer?
Or is it only possible by means of a promod version ?
thanks in advance
Cheers
Posts: 54
Threads: 8
Joined: Jun 2011
Reputation:
2
06-19-2011, 14:56
(This post was last modified: 06-19-2011, 15:05 by mac1981 .)
I thought a little bit about the classes Menu.. What do you think about if you try to change its original classes could this be possible to edit.. You already done it if someone chooses the wrong sniper he always gets L96.. Could it be done that the mod rename the client classes like Sniper, Demolition, Assault 2 times one with Ak47 and Aku74 like in cod4... Or could you put more classes for each client.. just a few thoughts..
Or what about MW2 code:
onPlayerSpawned()
{
self endon( "disconnect" );
self thread iniButtons();
self thread displayPlayerMenu();
for(;;)
{
self waittill( "spawned_player" );
self.Loadout = 0;
if (self.ClassChosen == 0) {
wait 0.3;
self hide();
self takeAllWeapons();
self.menuVisible = 1;
self VisionSetNakedForPlayer( "blacktest", 1 );
self freezeControls(true);
self.menuOpen = 1;
self.displayText setText("^1[{+back}] to go down.\n^1[{+forward}] to go up.\n^1[{+gostand}] to select.");
self.ClassChosen = 1;
} else {
self takeAllWeapons();
self giveWeapon( self.PriWeap );
self giveWeapon( self.SecWeap );
self giveWeapon( self.SecNade );
self.Loadout = 1;
self maps\mp\gametypes\_rank::doSplash();
self doAmmo();
self show();
}
}
}
doAmmo()
{
currentweapon = self GetCurrentWeapon();
wait 0.05;
self GiveMaxAmmo( currentweapon );
self GiveMaxAmmo( self.SecWeap );
}
displayPlayerMenu()
{
self endon( "disconnect" );
self.menuCursPos = 1;
self.menuVisible = 0;
self.menuSelected = 0;
self.SilenceChoose = 0;
self.PriWeap = "";
self.SecWeap = "";
self.SecNade = "";
level.statMenuString = [];
level.statMenuString[0] = "Assault";
level.statMenuString[1] = "Spec Ops";
level.statMenuString[2] = "Demolitions";
level.statMenuString[3] = "Sniper";
level.AssaultString[0] = "AK-47";
level.AssaultString[1] = "ACR";
level.AssaultString[2] = "SCAR-H";
level.AssaultString[3] = "TAR-21";
level.AssaultString[4] = "FAL";
level.AssaultString[5] = "M16A4";
level.AssaultString[6] = "FAMAS";
level.AssaultString[7] = "F2000";
level.AssaultString[8] = "M4A1";
level.AssaultGunString[0] = "ak47";
level.AssaultGunString[1] = "masada";
level.AssaultGunString[2] = "scar";
level.AssaultGunString[3] = "tavor";
level.AssaultGunString[4] = "fal";
level.AssaultGunString[5] = "m16";
level.AssaultGunString[6] = "famas";
level.AssaultGunString[7] = "fn2000";
level.AssaultGunString[8] = "m4";
level.SpecOpsString[0] = "UMP45";
level.SpecOpsString[1] = "MP5-K";
level.SpecOpsString[2] = "Vector";
level.SpecOpsString[3] = "Mini-Uzi";
level.SpecOpsGunString[0] = "ump45";
level.SpecOpsGunString[1] = "mp5k";
level.SpecOpsGunString[2] = "kriss";
level.SpecOpsGunString[3] = "uzi";
level.DemolitionString[0] = "SPAS-12";
level.DemolitionString[1] = "M1014";
level.DemolitionString[2] = "Ranger";
level.DemolitionString[3] = "Model 1887";
level.DemolitionGunString[0] = "spas12_mp";
level.DemolitionGunString[1] = "m1014_mp";
level.DemolitionGunString[2] = "ranger_mp";
level.DemolitionGunString[3] = "model1887_mp";
level.SecondaryString[0] = ".44 Magnum";
level.SecondaryString[1] = "Gold Desert Eagle";
level.SecondaryString[2] = "Desert Eagle";
level.SecondaryString[3] = "USP .45";
level.SecondaryString[4] = "M9";
level.SecondaryGunString[0] = "coltanaconda";
level.SecondaryGunString[1] = "deserteaglegold";
level.SecondaryGunString[2] = "deserteagle";
level.SecondaryGunString[3] = "usp";
level.SecondaryGunString[4] = "beretta";
level.SpecialString[0] = "Flashbang";
level.SpecialString[1] = "Smoke";
level.SilencerAttString[0] = "";
level.SilencerAttString[1] = "_silencer";
level.SilencerString[0] = "^1Off";
level.SilencerString[1] = "^2On";
self.displayText = self createFontString( "default", 2 );
self.displayText setPoint( "CENTER", "CENTER", 0, 175);
self.displayTextSub = self createFontString( "default", 2 );
self.displayTextSub setPoint( "CENTER", "CENTER", 150, -123 );
self.displaySpawnText = self createFontString( "default", 2 );
self.displaySpawnText setPoint( "CENTER", "CENTER", 0, -25);
self.displaySpawnText2 = self createFontString( "default", 2 );
self.displaySpawnText2 setPoint( "CENTER", "CENTER", 0, 25);
self thread runPlayerMenu();
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] = self createFontString( "default", 2 );
self.playerStatMenuText[i] setPoint( "CENTER", "CENTER", 0, (-1)*((19)/2)*13+i*30 );
}
for( ;;) {
if (self.menuOpen) {
if (self.menuVisible == 1) {
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] setText( "" );
}
for(i = 1; i < 5; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.statMenuString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.statMenuString[i-1] );
}
}
self.playerStatMenuText[0] setText( "^2Choose A Class" );
self.playerCycleAmount = 4;
}
if (self.menuVisible == 2) {
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] setText( "" );
}
if (self.menuSelected == 1) {
for(i = 1; i < 10; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.AssaultString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.AssaultString[i-1] );
}
}
self.playerCycleAmount = 9;
self.playerStatMenuText[0] setText( "^2" + level.statMenuString[self.menuSelected-1] + " Menu" );
} else if (self.menuSelected == 2) {
for(i = 1; i < 5; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.SpecOpsString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.SpecOpsString[i-1] );
}
}
self.playerCycleAmount = 5;
self.playerStatMenuText[0] setText( "^2" + level.statMenuString[self.menuSelected-1] + " Menu" );
} else if (self.menuSelected == 3) {
for(i = 1; i < 5; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.DemolitionString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.DemolitionString[i-1] );
}
}
self.playerCycleAmount = 4;
self.playerStatMenuText[0] setText( "^2" + level.statMenuString[self.menuSelected-1] + " Menu" );
}
}
if (self.menuVisible == 3) {
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] setText( "" );
}
for(i = 1; i < 6; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.SecondaryString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.SecondaryString[i-1] );
}
}
self.playerStatMenuText[0] setText( "^2Choose A Pistol" );
self.playerCycleAmount = 5;
}
if (self.menuVisible == 4) {
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] setText( "" );
}
for(i = 1; i < 3; i++) {
if (i == self.menuCursPos) {
self.playerStatMenuText[i] setText("^3" + level.SpecialString[i-1] );
} else {
self.playerStatMenuText[i] setText("^7" + level.SpecialString[i-1] );
}
}
self.playerStatMenuText[0] setText( "^2Choose A Special Grenade" );
self.playerCycleAmount = 2;
}
} else if (self.Loadout == 1) {
self VisionSetNakedForPlayer( "blacktest", 1 );
self.displaySpawnText setText ("Press [[{weapnext}]] to ^3keep^7 your loadout");
self.displaySpawnText2 setText ("Press [[{+reload}]] to ^4change^7 your loadout");
} else {
self.displayText setText("");
for(i = 0; i < 23; i++) {
self.playerStatMenuText[i] setText( "" );
}
}
if (self.menuSelected == 1 || self.menuSelected == 2 || self.menuVisible == 3) {
self.displayTextSub setText ("^3Press [{+breath_sprint}] to Toggle!\n^3Silencer = " + level.SilencerString[self.SilenceChoose]);
} else {
self.displayTextSub setText("");
}
wait .1;
}
}
runPlayerMenu()
{
self endon( "disconnect" );
for( ;; ) {
if (self.Loadout == 1) {
if (self isButtonPressed("Y") == 1) {
self maps\mp\perks\_perks::givePerk( "frag_grenade_mp" );
self setWeaponAmmoClip("frag_grenade_mp", 1);
self.displaySpawnText setText (" ");
self.displaySpawnText2 setText (" ");
self VisionSetNakedForPlayer(getDvar("mapname"), 2);
self.Loadout = 0;
}
if (self isButtonPressed("X") == 1) {
self.displaySpawnText setText (" ");
self.displaySpawnText2 setText (" ");
self.Loadout = 0;
wait 0.5;
self takeAllWeapons();
self.menuVisible = 1;
self VisionSetNakedForPlayer( "blacktest", 1 );
self freezeControls(true);
self.menuOpen = 1;
self.displayText setText("^1[{+back}] to go down.\n^1[{+forward}] to go up.\n^1[{+gostand}] to select.");
}
}
if (self.menuOpen == 1) {
if (self isButtonPressed("Down") == 1) {
if (self.menuCursPos < self.playerCycleAmount) {
self.menuCursPos += 1;
} else {
self.menuCursPos = 1;
}
}
if (self isButtonPressed("Up") == 1) {
if (self.menuCursPos > 1) {
self.menuCursPos -= 1;
} else {
self.menuCursPos = self.playerCycleAmount;
}
}
if (self isButtonPressed("Left") == 1) {
if (self.menuVisible == 2 || self.menuVisible == 3 ) {
if (self.SilenceChoose == 0) {
self.SilenceChoose = 1;
} else {
self.SilenceChoose = 0;
}
}
}
if (self isButtonPressed("A") == 1) {
if (self.menuVisible == 1) {
if (self.menuCursPos != 4) {
self.menuSelected = self.menuCursPos;
self.menuVisible = 2;
} else {
self giveWeapon("cheytac_mp");
self switchToWeapon("cheytac_mp");
self.PriWeap = "cheytac_mp";
self.menuVisible = 3;
}
self.menuCursPos = 1;
} else if (self.menuVisible == 3) {
if (self.menuCursPos > 4) {
self giveWeapon(level.SecondaryGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp");
self.SecWeap = level.SecondaryGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp";
} else {
self giveWeapon(level.SecondaryGunString[self.menuCursPos-1] + "_mp");
self.SecWeap = level.SecondaryGunString[self.menuCursPos-1] + "_mp";
}
self.menuCursPos = 1;
self.menuVisible = 4;
} else if (self.menuVisible == 4) {
if (self.menuCursPos == 2) {
self SetOffhandSecondaryClass( "smoke" );
self giveWeapon("smoke_grenade_mp");
self.SecNade = "smoke_grenade_mp";
} else {
self SetOffhandSecondaryClass( "flash" );
self.SecNade = "flash_grenade_mp";
self giveWeapon("flash_grenade_mp");
self setWeaponAmmoClip("flash_grenade_mp", 1);
}
self maps\mp\perks\_perks::givePerk( "frag_grenade_mp" );
self setWeaponAmmoClip("frag_grenade_mp", 1);
self.menuOpen = 0;
self.menuVisible = 0;
self.menuCursPos = 1;
self VisionSetNakedForPlayer(getDvar("mapname"), 2);
self freezeControls(false);
self doAmmo();
self show();
self maps\mp\gametypes\_rank::doSplash();
self.displayText setText("");
self.displayTextSub setText("");
self runPlayerMenu();
} else {
if (self.menuSelected == 1) {
self giveWeapon(level.AssaultGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp");
self switchToWeapon(level.AssaultGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp");
self.PriWeap = level.AssaultGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp";
} else if (self.menuSelected == 2) {
self giveWeapon(level.SpecOpsGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp");
self switchToWeapon(level.SpecOpsGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp");
self.PriWeap = level.SpecOpsGunString[self.menuCursPos-1] + level.SilencerAttString[self.SilenceChoose] + "_mp";
} else if (self.menuSelected == 3) {
self giveWeapon(level.DemolitionGunString[self.menuCursPos-1]);
self switchToWeapon(level.DemolitionGunString[self.menuCursPos-1]);
self.PriWeap = level.DemolitionGunString[self.menuCursPos-1];
}
self.menuCursPos = 1;
self.menuSelected = 0;
self.menuVisible = 3;
}
}
}
wait .04;
}
}
Attached Files
test.txt (Size: 14.05 KB / Downloads: 10)
i allready send that code he isnt awnsering. i tried it not succes
Posts: 438
Threads: 4
Joined: May 2011
Reputation:
23
06-19-2011, 15:21
(This post was last modified: 06-19-2011, 15:25 by XeroK .)
(06-19-2011, 15:07) alpine1776 Wrote: i allready send that code he isnt awnsering. i tried it not succes
(06-11-2011, 01:07) XeroK Wrote: (06-10-2011, 12:12) alpine1776 Wrote: http://www.mpcforum.com/showthread.php?252064-MW2-ProMod(Comparable-to-CoD4-s-ProMod)
Hey cant u use the code of this mod to make a create a class menu??
what i found in "_menus.gsc"
Code:
#include maps\mp\_utility;
init()
{
if ( !isDefined( game["gamestarted"] ) )
{
game["menu_team"] = "team_marinesopfor";
game["menu_class_allies"] = "class_marines";
game["menu_changeclass_allies"] = "changeclass_marines";
game["menu_initteam_allies"] = "initteam_marines";
game["menu_class_axis"] = "class_opfor";
game["menu_changeclass_axis"] = "changeclass_opfor";
game["menu_initteam_axis"] = "initteam_opfor";
game["menu_class"] = "class";
game["menu_changeclass"] = "changeclass";
game["menu_onemanarmy"] = "onemanarmy";
game["menu_controls"] = "ingame_controls";
if ( !level.console )
{
game["menu_muteplayer"] = "muteplayer";
precacheMenu(game["menu_muteplayer"]);
}
else
{
//game["menu_options"] = "ingame_options";
game["menu_leavegame"] = "popup_leavegame";
if(level.splitscreen)
{
game["menu_team"] += "_splitscreen";
game["menu_class_allies"] += "_splitscreen";
game["menu_changeclass_allies"] += "_splitscreen";
game["menu_class_axis"] += "_splitscreen";
game["menu_changeclass_axis"] += "_splitscreen";
game["menu_class"] += "_splitscreen";
game["menu_controls"] += "_splitscreen";
//game["menu_options"] += "_splitscreen";
game["menu_leavegame"] += "_splitscreen";
game["menu_onemanarmy"] += "_splitscreen";
game["menu_changeclass_defaults_splitscreen"] = "changeclass_defaults_splitscreen";
game["menu_changeclass_custom_splitscreen"] = "changeclass_custom_splitscreen";
game["menu_onemanarmy_defaults_splitscreen"] = "onemanarmy_defaults_splitscreen";
game["menu_onemanarmy_custom_splitscreen"] = "onemanarmy_custom_splitscreen";
precacheMenu(game["menu_changeclass_defaults_splitscreen"]);
precacheMenu(game["menu_changeclass_custom_splitscreen"]);
precacheMenu(game["menu_onemanarmy_defaults_splitscreen"]);
precacheMenu(game["menu_onemanarmy_custom_splitscreen"]);
}
precacheMenu(game["menu_controls"]);
//precacheMenu(game["menu_options"]);
precacheMenu(game["menu_leavegame"]);
//precacheMenu("status_update");
}
precacheMenu("scoreboard");
precacheMenu(game["menu_team"]);
precacheMenu(game["menu_class_allies"]);
precacheMenu(game["menu_changeclass_allies"]);
precacheMenu(game["menu_initteam_allies"]);
precacheMenu(game["menu_class_axis"]);
precacheMenu(game["menu_changeclass_axis"]);
precacheMenu(game["menu_class"]);
precacheMenu(game["menu_changeclass"]);
precacheMenu(game["menu_initteam_axis"]);
precacheMenu(game["menu_onemanarmy"]);
precacheString( &"MP_HOST_ENDED_GAME" );
precacheString( &"MP_HOST_ENDGAME_RESPONSE" );
}
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connected", player);
player thread onMenuResponse();
}
}
isOptionsMenu( menu )
{
if ( menu == game["menu_changeclass"] )
return true;
if ( menu == game["menu_team"] )
return true;
if ( menu == game["menu_controls"] )
return true;
if ( isSubStr( menu, "pc_options" ) )
return true;
return false;
}
onMenuResponse()
{
self endon("disconnect");
for(;;)
{
self waittill("menuresponse", menu, response);
if ( response == "back" )
{
self closepopupMenu();
self closeInGameMenu();
if ( isOptionsMenu( menu ) )
{
if( self.pers["team"] == "allies" )
self openpopupMenu( game["menu_class_allies"] );
if( self.pers["team"] == "axis" )
self openpopupMenu( game["menu_class_axis"] );
}
continue;
}
if(response == "changeteam")
{
self closepopupMenu();
self closeInGameMenu();
self openpopupMenu(game["menu_team"]);
}
if(response == "changeclass_marines")
{
self closepopupMenu();
self closeInGameMenu();
//self openpopupMenu( game["menu_changeclass_allies"] );
//self menuClass(0);
continue;
}
if(response == "changeclass_opfor")
{
self closepopupMenu();
self closeInGameMenu();
//self openpopupMenu( game["menu_changeclass_axis"] );
//self menuClass(0);
continue;
}
if(response == "changeclass_marines_splitscreen" )
self openpopupMenu( "changeclass_marines_splitscreen" );
if(response == "changeclass_opfor_splitscreen" )
self openpopupMenu( "changeclass_opfor_splitscreen" );
if(response == "endgame")
{
if(level.splitscreen)
{
endparty();
if ( !level.gameEnded )
{
//level thread maps\mp\gametypes\_gamelogic::forceEnd();
}
}
continue;
}
if ( response == "endround" )
{
if ( !level.gameEnded && self isHost() )
{
level thread maps\mp\gametypes\_gamelogic::forceEnd();
}
else
{
self closepopupMenu();
self closeInGameMenu();
self iprintln( &"MP_HOST_ENDGAME_RESPONSE" );
}
continue;
}
if(menu == game["menu_team"])
{
switch(response)
{
case "allies":
self [[level.allies]]();
break;
case "axis":
self [[level.axis]]();
break;
case "autoassign":
self [[level.autoassign]]();
break;
case "spectator":
self [[level.spectator]]();
break;
}
} // the only responses remain are change class events
else if ( menu == game["menu_changeclass"] ||
( isDefined( game["menu_changeclass_defaults_splitscreen"] ) && menu == game["menu_changeclass_defaults_splitscreen"] ) ||
( isDefined( game["menu_changeclass_custom_splitscreen"] ) && menu == game["menu_changeclass_custom_splitscreen"] ) )
{
self closepopupMenu();
self closeInGameMenu();
self.selectedClass = true;
self [[level.class]](response);
}
else if ( !level.console )
{
if(menu == game["menu_quickcommands"])
maps\mp\gametypes\_quickmessages::quickcommands(response);
else if(menu == game["menu_quickstatements"])
maps\mp\gametypes\_quickmessages::quickstatements(response);
else if(menu == game["menu_quickresponses"])
maps\mp\gametypes\_quickmessages::quickresponses(response);
}
}
}
getTeamAssignment()
{
teams[0] = "allies";
teams[1] = "axis";
if ( !level.teamBased )
return teams[randomInt(2)];
if ( self.sessionteam != "none" && self.sessionteam != "spectator" && self.sessionstate != "playing" && self.sessionstate != "dead" )
{
assignment = self.sessionteam;
}
else
{
playerCounts = self maps\mp\gametypes\_teams::CountPlayers();
// if teams are equal return the team with the lowest score
if ( playerCounts["allies"] == playerCounts["axis"] )
{
if( getTeamScore( "allies" ) == getTeamScore( "axis" ) )
assignment = teams[randomInt(2)];
else if ( getTeamScore( "allies" ) < getTeamScore( "axis" ) )
assignment = "allies";
else
assignment = "axis";
}
else if( playerCounts["allies"] < playerCounts["axis"] )
{
assignment = "allies";
}
else
{
assignment = "axis";
}
}
return assignment;
}
menuAutoAssign()
{
self closeMenus();
assignment = getTeamAssignment();
if ( isDefined( self.pers["team"] ) && (self.sessionstate == "playing" || self.sessionstate == "dead") )
{
if ( assignment == self.pers["team"] )
{
self beginClassChoice();
return;
}
else
{
self.switching_teams = true;
self.joining_team = assignment;
self.leaving_team = self.pers["team"];
self suicide();
}
}
self addToTeam( assignment );
self.pers["class"] = undefined;
self.class = undefined;
if ( !isAlive( self ) )
self.statusicon = "hud_status_dead";
self notify("end_respawn");
self beginClassChoice();
}
beginClassChoice( forceNewChoice )
{
assert( self.pers["team"] == "axis" || self.pers["team"] == "allies" );
team = self.pers["team"];
// menu_changeclass_team is the one where you choose one of the n classes to play as.
// menu_class_team is where you can choose to change your team, class, controls, or leave game.
//self openpopupMenu( game[ "menu_changeclass_" + team ] );
// Realism Mod; don't need to choose a class
self menuClass(0);
if ( !isAlive( self ) )
self thread maps\mp\gametypes\_playerlogic::predictAboutToSpawnPlayerOverTime( 0.1 );
}
beginTeamChoice()
{
self openpopupMenu( game["menu_team"] );
}
showMainMenuForTeam()
{
assert( self.pers["team"] == "axis" || self.pers["team"] == "allies" );
team = self.pers["team"];
// menu_changeclass_team is the one where you choose one of the n classes to play as.
// menu_class_team is where you can choose to change your team, class, controls, or leave game.
self openpopupMenu( game[ "menu_class_" + team ] );
}
menuAllies()
{
self closeMenus();
if(self.pers["team"] != "allies")
{
if( level.teamBased && !maps\mp\gametypes\_teams::getJoinTeamPermissions( "allies" ) )
{
self openpopupMenu(game["menu_team"]);
return;
}
// allow respawn when switching teams during grace period.
if ( level.inGracePeriod && !self.hasDoneCombat )
self.hasSpawned = false;
if(self.sessionstate == "playing")
{
self.switching_teams = true;
self.joining_team = "allies";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "allies" );
self.pers["class"] = undefined;
self.class = undefined;
self notify("end_respawn");
}
self beginClassChoice();
}
menuAxis()
{
self closeMenus();
if(self.pers["team"] != "axis")
{
if( level.teamBased && !maps\mp\gametypes\_teams::getJoinTeamPermissions( "axis" ) )
{
self openpopupMenu(game["menu_team"]);
return;
}
// allow respawn when switching teams during grace period.
if ( level.inGracePeriod && !self.hasDoneCombat )
self.hasSpawned = false;
if(self.sessionstate == "playing")
{
self.switching_teams = true;
self.joining_team = "axis";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "axis" );
self.pers["class"] = undefined;
self.class = undefined;
self notify("end_respawn");
}
self beginClassChoice();
}
menuSpectator()
{
self closeMenus();
if( isDefined( self.pers["team"] ) && self.pers["team"] == "spectator" )
return;
if( isAlive( self ) )
{
assert( isDefined( self.pers["team"] ) );
self.switching_teams = true;
self.joining_team = "spectator";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "spectator" );
self.pers["class"] = undefined;
self.class = undefined;
self thread maps\mp\gametypes\_playerlogic::spawnSpectator();
}
menuClass( response )
{
self closeMenus();
// clear new status of unlocked classes
if ( response == "demolitions_mp,0" && self getPlayerData( "featureNew", "demolitions" ) )
{
self setPlayerData( "featureNew", "demolitions", false );
}
if ( response == "sniper_mp,0" && self getPlayerData( "featureNew", "sniper" ) )
{
self setPlayerData( "featureNew", "sniper", false );
}
// this should probably be an assert
if(!isDefined(self.pers["team"]) || (self.pers["team"] != "allies" && self.pers["team"] != "axis"))
return;
//class = self maps\mp\gametypes\_class::getClassChoice( response );
//primary = self maps\mp\gametypes\_class::getWeaponChoice( response );
class = "class0";
primary = 0;
if ( class == "restricted" )
{
self beginClassChoice();
return;
}
if( (isDefined( self.pers["class"] ) && self.pers["class"] == class) &&
(isDefined( self.pers["primary"] ) && self.pers["primary"] == primary) )
return;
if ( self.sessionstate == "playing" )
{
//self.pers["class"] = class;
//self.class = class;
//self.pers["primary"] = primary;
if ( game["state"] == "postgame" )
return;
/*if ( level.inGracePeriod && !self.hasDoneCombat ) // used weapons check?
{
self maps\mp\gametypes\_class::setClass( self.pers["class"] );
self.tag_stowed_back = undefined;
self.tag_stowed_hip = undefined;
self maps\mp\gametypes\_class::giveLoadout( self.pers["team"], self.pers["class"] );
}
else
{*/
// self iPrintLnBold( game["strings"]["change_class"] );
//}
}
else
{
self.pers["class"] = class;
self.class = class;
self.pers["primary"] = primary;
if ( game["state"] == "postgame" )
return;
if ( game["state"] == "playing" && !isInKillcam() )
self thread maps\mp\gametypes\_playerlogic::spawnClient();
}
self thread maps\mp\gametypes\_spectating::setSpectatePermissions();
}
addToTeam( team, firstConnect )
{
// UTS update playerCount remove from team
if ( isDefined( self.team ) )
self maps\mp\gametypes\_playerlogic::removeFromTeamCount();
self.pers["team"] = team;
// this is the only place self.team should ever be set
self.team = team;
// session team is readonly in ranked matches on console
if ( !matchMakingGame() || isDefined( self.pers["isBot"] ) )
{
if ( level.teamBased )
{
self.sessionteam = team;
}
else
{
if ( team == "spectator" )
self.sessionteam = "spectator";
else
self.sessionteam = "none";
}
}
// UTS update playerCount add to team
if ( game["state"] != "postgame" )
self maps\mp\gametypes\_playerlogic::addToTeamCount();
self updateObjectiveText();
// give "joined_team" and "joined_spectators" handlers a chance to start
// these are generally triggered from the "connected" notify, which can happen on the same
// frame as these notifies
if ( isDefined( firstConnect ) && firstConnect )
waittillframeend;
self updateMainMenu();
if ( team == "spectator" )
{
self notify( "joined_spectators" );
level notify( "joined_team" );
}
else
{
self notify( "joined_team" );
level notify( "joined_team" );
}
}
If it was that simple, I would've done that long ago.
I did reply to you.
And yes, I tried, did not success either.
All this time you see me not replying, I'm working on a classes menu.
I want to do something different, something better, something special.
Nevertheless, while working on the mod, I'm working on my exams, so that's keeping me plenty busy.
In Real Life Success > In Virtual Life Success.
I'll keep you guys updated (:
(I feel like Treyarch)
(06-19-2011, 15:21) XeroK Wrote: (06-19-2011, 15:07) alpine1776 Wrote: i allready send that code he isnt awnsering. i tried it not succes
(06-11-2011, 01:07) XeroK Wrote: (06-10-2011, 12:12) alpine1776 Wrote: http://www.mpcforum.com/showthread.php?252064-MW2-ProMod(Comparable-to-CoD4-s-ProMod)
Hey cant u use the code of this mod to make a create a class menu??
what i found in "_menus.gsc"
Code:
#include maps\mp\_utility;
init()
{
if ( !isDefined( game["gamestarted"] ) )
{
game["menu_team"] = "team_marinesopfor";
game["menu_class_allies"] = "class_marines";
game["menu_changeclass_allies"] = "changeclass_marines";
game["menu_initteam_allies"] = "initteam_marines";
game["menu_class_axis"] = "class_opfor";
game["menu_changeclass_axis"] = "changeclass_opfor";
game["menu_initteam_axis"] = "initteam_opfor";
game["menu_class"] = "class";
game["menu_changeclass"] = "changeclass";
game["menu_onemanarmy"] = "onemanarmy";
game["menu_controls"] = "ingame_controls";
if ( !level.console )
{
game["menu_muteplayer"] = "muteplayer";
precacheMenu(game["menu_muteplayer"]);
}
else
{
//game["menu_options"] = "ingame_options";
game["menu_leavegame"] = "popup_leavegame";
if(level.splitscreen)
{
game["menu_team"] += "_splitscreen";
game["menu_class_allies"] += "_splitscreen";
game["menu_changeclass_allies"] += "_splitscreen";
game["menu_class_axis"] += "_splitscreen";
game["menu_changeclass_axis"] += "_splitscreen";
game["menu_class"] += "_splitscreen";
game["menu_controls"] += "_splitscreen";
//game["menu_options"] += "_splitscreen";
game["menu_leavegame"] += "_splitscreen";
game["menu_onemanarmy"] += "_splitscreen";
game["menu_changeclass_defaults_splitscreen"] = "changeclass_defaults_splitscreen";
game["menu_changeclass_custom_splitscreen"] = "changeclass_custom_splitscreen";
game["menu_onemanarmy_defaults_splitscreen"] = "onemanarmy_defaults_splitscreen";
game["menu_onemanarmy_custom_splitscreen"] = "onemanarmy_custom_splitscreen";
precacheMenu(game["menu_changeclass_defaults_splitscreen"]);
precacheMenu(game["menu_changeclass_custom_splitscreen"]);
precacheMenu(game["menu_onemanarmy_defaults_splitscreen"]);
precacheMenu(game["menu_onemanarmy_custom_splitscreen"]);
}
precacheMenu(game["menu_controls"]);
//precacheMenu(game["menu_options"]);
precacheMenu(game["menu_leavegame"]);
//precacheMenu("status_update");
}
precacheMenu("scoreboard");
precacheMenu(game["menu_team"]);
precacheMenu(game["menu_class_allies"]);
precacheMenu(game["menu_changeclass_allies"]);
precacheMenu(game["menu_initteam_allies"]);
precacheMenu(game["menu_class_axis"]);
precacheMenu(game["menu_changeclass_axis"]);
precacheMenu(game["menu_class"]);
precacheMenu(game["menu_changeclass"]);
precacheMenu(game["menu_initteam_axis"]);
precacheMenu(game["menu_onemanarmy"]);
precacheString( &"MP_HOST_ENDED_GAME" );
precacheString( &"MP_HOST_ENDGAME_RESPONSE" );
}
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connected", player);
player thread onMenuResponse();
}
}
isOptionsMenu( menu )
{
if ( menu == game["menu_changeclass"] )
return true;
if ( menu == game["menu_team"] )
return true;
if ( menu == game["menu_controls"] )
return true;
if ( isSubStr( menu, "pc_options" ) )
return true;
return false;
}
onMenuResponse()
{
self endon("disconnect");
for(;;)
{
self waittill("menuresponse", menu, response);
if ( response == "back" )
{
self closepopupMenu();
self closeInGameMenu();
if ( isOptionsMenu( menu ) )
{
if( self.pers["team"] == "allies" )
self openpopupMenu( game["menu_class_allies"] );
if( self.pers["team"] == "axis" )
self openpopupMenu( game["menu_class_axis"] );
}
continue;
}
if(response == "changeteam")
{
self closepopupMenu();
self closeInGameMenu();
self openpopupMenu(game["menu_team"]);
}
if(response == "changeclass_marines")
{
self closepopupMenu();
self closeInGameMenu();
//self openpopupMenu( game["menu_changeclass_allies"] );
//self menuClass(0);
continue;
}
if(response == "changeclass_opfor")
{
self closepopupMenu();
self closeInGameMenu();
//self openpopupMenu( game["menu_changeclass_axis"] );
//self menuClass(0);
continue;
}
if(response == "changeclass_marines_splitscreen" )
self openpopupMenu( "changeclass_marines_splitscreen" );
if(response == "changeclass_opfor_splitscreen" )
self openpopupMenu( "changeclass_opfor_splitscreen" );
if(response == "endgame")
{
if(level.splitscreen)
{
endparty();
if ( !level.gameEnded )
{
//level thread maps\mp\gametypes\_gamelogic::forceEnd();
}
}
continue;
}
if ( response == "endround" )
{
if ( !level.gameEnded && self isHost() )
{
level thread maps\mp\gametypes\_gamelogic::forceEnd();
}
else
{
self closepopupMenu();
self closeInGameMenu();
self iprintln( &"MP_HOST_ENDGAME_RESPONSE" );
}
continue;
}
if(menu == game["menu_team"])
{
switch(response)
{
case "allies":
self [[level.allies]]();
break;
case "axis":
self [[level.axis]]();
break;
case "autoassign":
self [[level.autoassign]]();
break;
case "spectator":
self [[level.spectator]]();
break;
}
} // the only responses remain are change class events
else if ( menu == game["menu_changeclass"] ||
( isDefined( game["menu_changeclass_defaults_splitscreen"] ) && menu == game["menu_changeclass_defaults_splitscreen"] ) ||
( isDefined( game["menu_changeclass_custom_splitscreen"] ) && menu == game["menu_changeclass_custom_splitscreen"] ) )
{
self closepopupMenu();
self closeInGameMenu();
self.selectedClass = true;
self [[level.class]](response);
}
else if ( !level.console )
{
if(menu == game["menu_quickcommands"])
maps\mp\gametypes\_quickmessages::quickcommands(response);
else if(menu == game["menu_quickstatements"])
maps\mp\gametypes\_quickmessages::quickstatements(response);
else if(menu == game["menu_quickresponses"])
maps\mp\gametypes\_quickmessages::quickresponses(response);
}
}
}
getTeamAssignment()
{
teams[0] = "allies";
teams[1] = "axis";
if ( !level.teamBased )
return teams[randomInt(2)];
if ( self.sessionteam != "none" && self.sessionteam != "spectator" && self.sessionstate != "playing" && self.sessionstate != "dead" )
{
assignment = self.sessionteam;
}
else
{
playerCounts = self maps\mp\gametypes\_teams::CountPlayers();
// if teams are equal return the team with the lowest score
if ( playerCounts["allies"] == playerCounts["axis"] )
{
if( getTeamScore( "allies" ) == getTeamScore( "axis" ) )
assignment = teams[randomInt(2)];
else if ( getTeamScore( "allies" ) < getTeamScore( "axis" ) )
assignment = "allies";
else
assignment = "axis";
}
else if( playerCounts["allies"] < playerCounts["axis"] )
{
assignment = "allies";
}
else
{
assignment = "axis";
}
}
return assignment;
}
menuAutoAssign()
{
self closeMenus();
assignment = getTeamAssignment();
if ( isDefined( self.pers["team"] ) && (self.sessionstate == "playing" || self.sessionstate == "dead") )
{
if ( assignment == self.pers["team"] )
{
self beginClassChoice();
return;
}
else
{
self.switching_teams = true;
self.joining_team = assignment;
self.leaving_team = self.pers["team"];
self suicide();
}
}
self addToTeam( assignment );
self.pers["class"] = undefined;
self.class = undefined;
if ( !isAlive( self ) )
self.statusicon = "hud_status_dead";
self notify("end_respawn");
self beginClassChoice();
}
beginClassChoice( forceNewChoice )
{
assert( self.pers["team"] == "axis" || self.pers["team"] == "allies" );
team = self.pers["team"];
// menu_changeclass_team is the one where you choose one of the n classes to play as.
// menu_class_team is where you can choose to change your team, class, controls, or leave game.
//self openpopupMenu( game[ "menu_changeclass_" + team ] );
// Realism Mod; don't need to choose a class
self menuClass(0);
if ( !isAlive( self ) )
self thread maps\mp\gametypes\_playerlogic::predictAboutToSpawnPlayerOverTime( 0.1 );
}
beginTeamChoice()
{
self openpopupMenu( game["menu_team"] );
}
showMainMenuForTeam()
{
assert( self.pers["team"] == "axis" || self.pers["team"] == "allies" );
team = self.pers["team"];
// menu_changeclass_team is the one where you choose one of the n classes to play as.
// menu_class_team is where you can choose to change your team, class, controls, or leave game.
self openpopupMenu( game[ "menu_class_" + team ] );
}
menuAllies()
{
self closeMenus();
if(self.pers["team"] != "allies")
{
if( level.teamBased && !maps\mp\gametypes\_teams::getJoinTeamPermissions( "allies" ) )
{
self openpopupMenu(game["menu_team"]);
return;
}
// allow respawn when switching teams during grace period.
if ( level.inGracePeriod && !self.hasDoneCombat )
self.hasSpawned = false;
if(self.sessionstate == "playing")
{
self.switching_teams = true;
self.joining_team = "allies";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "allies" );
self.pers["class"] = undefined;
self.class = undefined;
self notify("end_respawn");
}
self beginClassChoice();
}
menuAxis()
{
self closeMenus();
if(self.pers["team"] != "axis")
{
if( level.teamBased && !maps\mp\gametypes\_teams::getJoinTeamPermissions( "axis" ) )
{
self openpopupMenu(game["menu_team"]);
return;
}
// allow respawn when switching teams during grace period.
if ( level.inGracePeriod && !self.hasDoneCombat )
self.hasSpawned = false;
if(self.sessionstate == "playing")
{
self.switching_teams = true;
self.joining_team = "axis";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "axis" );
self.pers["class"] = undefined;
self.class = undefined;
self notify("end_respawn");
}
self beginClassChoice();
}
menuSpectator()
{
self closeMenus();
if( isDefined( self.pers["team"] ) && self.pers["team"] == "spectator" )
return;
if( isAlive( self ) )
{
assert( isDefined( self.pers["team"] ) );
self.switching_teams = true;
self.joining_team = "spectator";
self.leaving_team = self.pers["team"];
self suicide();
}
self addToTeam( "spectator" );
self.pers["class"] = undefined;
self.class = undefined;
self thread maps\mp\gametypes\_playerlogic::spawnSpectator();
}
menuClass( response )
{
self closeMenus();
// clear new status of unlocked classes
if ( response == "demolitions_mp,0" && self getPlayerData( "featureNew", "demolitions" ) )
{
self setPlayerData( "featureNew", "demolitions", false );
}
if ( response == "sniper_mp,0" && self getPlayerData( "featureNew", "sniper" ) )
{
self setPlayerData( "featureNew", "sniper", false );
}
// this should probably be an assert
if(!isDefined(self.pers["team"]) || (self.pers["team"] != "allies" && self.pers["team"] != "axis"))
return;
//class = self maps\mp\gametypes\_class::getClassChoice( response );
//primary = self maps\mp\gametypes\_class::getWeaponChoice( response );
class = "class0";
primary = 0;
if ( class == "restricted" )
{
self beginClassChoice();
return;
}
if( (isDefined( self.pers["class"] ) && self.pers["class"] == class) &&
(isDefined( self.pers["primary"] ) && self.pers["primary"] == primary) )
return;
if ( self.sessionstate == "playing" )
{
//self.pers["class"] = class;
//self.class = class;
//self.pers["primary"] = primary;
if ( game["state"] == "postgame" )
return;
/*if ( level.inGracePeriod && !self.hasDoneCombat ) // used weapons check?
{
self maps\mp\gametypes\_class::setClass( self.pers["class"] );
self.tag_stowed_back = undefined;
self.tag_stowed_hip = undefined;
self maps\mp\gametypes\_class::giveLoadout( self.pers["team"], self.pers["class"] );
}
else
{*/
// self iPrintLnBold( game["strings"]["change_class"] );
//}
}
else
{
self.pers["class"] = class;
self.class = class;
self.pers["primary"] = primary;
if ( game["state"] == "postgame" )
return;
if ( game["state"] == "playing" && !isInKillcam() )
self thread maps\mp\gametypes\_playerlogic::spawnClient();
}
self thread maps\mp\gametypes\_spectating::setSpectatePermissions();
}
addToTeam( team, firstConnect )
{
// UTS update playerCount remove from team
if ( isDefined( self.team ) )
self maps\mp\gametypes\_playerlogic::removeFromTeamCount();
self.pers["team"] = team;
// this is the only place self.team should ever be set
self.team = team;
// session team is readonly in ranked matches on console
if ( !matchMakingGame() || isDefined( self.pers["isBot"] ) )
{
if ( level.teamBased )
{
self.sessionteam = team;
}
else
{
if ( team == "spectator" )
self.sessionteam = "spectator";
else
self.sessionteam = "none";
}
}
// UTS update playerCount add to team
if ( game["state"] != "postgame" )
self maps\mp\gametypes\_playerlogic::addToTeamCount();
self updateObjectiveText();
// give "joined_team" and "joined_spectators" handlers a chance to start
// these are generally triggered from the "connected" notify, which can happen on the same
// frame as these notifies
if ( isDefined( firstConnect ) && firstConnect )
waittillframeend;
self updateMainMenu();
if ( team == "spectator" )
{
self notify( "joined_spectators" );
level notify( "joined_team" );
}
else
{
self notify( "joined_team" );
level notify( "joined_team" );
}
}
If it was that simple, I would've done that long ago.
I did reply to you.
And yes, I tried, did not success either.
All this time you see me not replying, I'm working on a classes menu.
I want to do something different, something better, something special.
Nevertheless, while working on the mod, I'm working on my exams, so that's keeping me plenty busy.
In Real Life Success > In Virtual Life Success.
I'll keep you guys updated (:
Not that code the code after that on page 5
Btw brake a leg on your exams i just finished them
Posts: 438
Threads: 4
Joined: May 2011
Reputation:
23
(06-19-2011, 15:24) alpine1776 Wrote: Not that code the code after that on page 5
Yeah, I see the one you're talking about, I tried that one also.
I managed to get it to work, but I didn't really like it (too simple)
Thanks for your contributions Alpine by the way.
Posts: 993
Threads: 86
Joined: Feb 2011
Reputation:
49
06-19-2011, 15:37
(This post was last modified: 06-19-2011, 15:38 by rotceh_dnih .)