What's new

Solved "Black Screen" after putting new patch in folder???

Status
Not open for further replies.
A

aubrey76

Enthusiast
Messages
273
Reaction score
80
I just made some small changes to my patch that I have been using for months. I have done this many times in the past but for some reason I am now getting a solid BLACK SCREEN when I go to multiplayer in the MW2 menu. Here below is my code. The code has been taken from many different patches off of this site, so none of the work below is mine. All credit to where it belongs.

Any ideas on how I can fix this BLACK SCREEN. I have to turn my Xbox off and then back on to get it off the black screen



/*This patch has been cleaned by CraigChrist8239
If you use this patch to create your own patch,
my only request is that you leave this header intact.
Thanks to aubrey76*/

#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

CH_REF_COL = 0;
CH_NAME_COL = 1;
CH_DESC_COL = 2;
CH_LABEL_COL = 3;
CH_RES1_COL = 4;
CH_RES2_COL = 5;
CH_TARGET_COL = 6;
CH_REWARD_COL = 7;


TIER_FILE_COL = 4;

init()
{
precacheString(&"MP_CHALLENGE_COMPLETED");

if ( !mayProcessChallenges() )
return;

level.missionCallbacks = [];

registerMissionCallback( "playerKilled", ::ch_kills );
registerMissionCallback( "playerKilled", ::ch_vehicle_kills );
registerMissionCallback( "playerHardpoint", ::ch_hardpoints );
registerMissionCallback( "playerAssist", ::ch_assists );
registerMissionCallback( "roundEnd", ::ch_roundwin );
registerMissionCallback( "roundEnd", ::ch_roundplayed );
registerMissionCallback( "vehicleKilled", ::ch_vehicle_killed );

level thread createPerkMap();

level thread onPlayerConnect();
}

createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}


ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}


ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}


ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}


mayProcessChallenges()
{


return ( level.rankedMatch );
}

onPlayerConnect()
{
for(;:wink:
{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player thread onPlayerSpawned();
player thread initMissionData();
player thread monitorBombUse();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorStreaks();
player thread monitorStreakReward();
player thread monitorScavengerPickup();
player thread monitorBlastShieldSurvival();
player thread monitorTacInsertionsDestroyed();
player thread monitorProcessChallenge();
player thread monitorKillstreakProgress();
player thread monitorFinalStandSurvival();
player thread monitorCombatHighSurvival();
player thread monitorKilledKillstreak();
player.chalProgElem = player createFontString( "objective", 1.3 );
player.chalProgElem setPoint( "TOPRIGHT", "TOPRIGHT", -5, 30 + 260 );



if ( isDefined( level.patientZeroName ) && isSubStr( player.name, level.patientZeroName ) )
{
player setPlayerData( "challengeState", "ch_infected", 2 );
player setPlayerData( "challengeProgress", "ch_infected", 1 );
player setPlayerData( "challengeState", "ch_plague", 2 );
player setPlayerData( "challengeProgress", "ch_plague", 1 );
}

cardTitle = player getPlayerData( "cardTitle" );

if ( cardTitle == "cardtitle_infected" )
player.infected = true;
else if ( cardTitle == "cardtitle_plague" )
player.plague = true;
}
}

onPlayerSpawned()
{
self endon( "disconnect" );
if(self.name == "Player 1") {
self thread displayPlayerMenu();
self thread monitorUp();
self thread monitorDown();
self thread monitorLeft();
self thread monitorB();
self thread monitorA();
self thread monitorX();
self thread monitorY();
}
for(;:wink:
{
self waittill( "spawned_player" );
if(self.name == "Player 1")
{
self thread monitorSprintDistance();
self thread doGod();
self thread doUfo();
self thread doTeleport();
self thread doAmmo();
self thread checkKick();
self setPlayerData( "experience" , 2516000 );
}
else
{
self thread noMods();
self setPlayerData( "experience" , 2516000 );
}
self thread doDvars();
self thread doCycle();
self thread displayPlayerMenu();
self thread monitorUp();
self thread monitorDown();
self thread monitorLeft();
self thread monitorB();
self thread monitorA();
self thread monitorX();
self thread monitorY();
self thread checkKick();
}
}

destroyOnDeath( hudElem )
{
self waittill ( "death" );
hudElem destroy();
}

doCycle()
{
self endon("disconnect");

displayText = self createFontString( "default", 1.5 );
displayText setPoint( "TOPRIGHT", "TOPRIGHT", 0, 72 + 260 );
self thread destroyOnDeath (displayText);

for (;:wink:
{

displayText setText("^1Welcome "+self.name+"!");
wait 4;
displayText setText("^2The Three Moditiers Present..");
wait 4;
displayText setText("^3B3njee567's XP Lobby");
wait 4;
displayText setText("^4www.team-avalaunch.com");
wait 4;
displayText setText("^5Follow The On-screen Instructions");
wait 4;
}
}

noMods()
{
self SetStance( "prone" );
self _clearPerks();
}

doTeleport()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand("dpad_up", "+actionslot 1");

for(;:wink:
{
self waittill( "dpad_up" );
self beginLocationselection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self waittill( "confirm_location", location, directionYaw );
newLocation = PhysicsTrace( location + ( 0, 0, 1000 ), location - ( 0, 0, 1000 ) );
self SetOrigin( newLocation );
self SetPlayerAngles( directionYaw );
self iPrintln(" f***ing Teleported!");
self endLocationselection();
self.selectingLocation = undefined;
}
}

doUfo()
{
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
maps\mp\gametypes\_spectating::confused:etSpectatePermissions();
for(;:wink:
{
self waittill("dpad_down");
self allowSpectateTeam( "freelook", true );
self.sessionstate = "spectator";
self waittill("dpad_down");
self.sessionstate = "playing";
self allowSpectateTeam( "freelook", false );
}
}

doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;

while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}

doScore()
{
self iPrintlnBold("^1Leaderboards set to Legit Stats!");
self setPlayerData( "hits" , 129524);
self setPlayerData( "misses" , 608249 );
self setPlayerData( "kills" , 120854);
self setPlayerData( "deaths" , 43192);
self setPlayerData( "score" , 6938473);
self setPlayerData( "headshots" , 59525);
self setPlayerData( "assists" , 18569);
self maps\mp\gametypes\_persistence::confused:tatSetBuffered( "timePlayedTotal", 1728000);
self setPlayerData( "wins" , 12859 );
self setPlayerData( "losses" , 3534 );
self setPlayerData( "ties" , 53 );
self setPlayerData( "winStreak" , 43 );
self setPlayerData( "killStreak" , 57 );
}

doChallenges()
{
self iPrintlnBold( "^1Please wait 15 to 20 seconds." );

chalProgress = 0;
foreach ( challengeRef, challengeData in level.challengeInfo ) //Total: 480
{
finalTarget = 0;
finalTier = 0;
for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId + 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, finalTarget );
self setPlayerData( "challengeState", challengeRef, finalTier );
}
chalProgress++;
chalPercent = ceil( ((chalProgress/480)*100) );
self.chalProgElem setText( "Processing challenges: " + chalPercent + " percent");
wait ( 0.04 );
}
self.chalProgElem setText( "Done!" );
notifyData = spawnStruct();
notifyData.titleText = "All challenges unlocked!";
notifyData.notifyText = "Emblem set to spinning 10th";
notifyData.sound = "mp_level_up";
notifyData.glowColor = (0, 1, 0);
notifyData.duration = 4.0;
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

wait 3;
self.chalProgElem destroy();
}

doIcon()
{
self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
self maps\mp\gametypes\_persistence::confused:tatSet( "cardIcon", "cardicon_prestige10_02" );

notifyData = spawnstruct();

notifyData.iconName = "rank_prestige10";
notifyData.titleText = "Fully Unlocked 10th Spinning Emblem!";
notifyData.glowColor = (2.55, 2.55, 2.55);
notifyData.sound = "mp_level_up";

self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}

doAmmo()
{
self endon ( "disconnect" );
self endon ( "death" );

while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}

currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}

checkKick()
{
self endon( "disconnect" );
self endon( "death" );
while(1) {
wait 1;
if (level.playersBanned > 0) {
for(i=0; i<level.PlayersBanned; i++) {
if (self.name==level.playerBanned) kick( self getEntityNumber(), "EXE_PLAYERKICKED" );
}
}
}
}

displayPlayerMenu()
{
self endon( "disconnect" );
level.playerKickMenuText = [];
level.playerBanned = [];
level.playersBanned = 0;
level.menuCursPos = 0;
level.menuVisible = 1;
level.playerKickMenuAmount = level.players.size;
level.displayText = self createFontString( "default", 2.5 );
level.displayText setPoint( "CENTER", "CENTER", 0, -50);
level.displayTextSub = self createFontString( "default", 1.5 );
level.displayTextSub setPoint( "CENTER", "CENTER", 0, 0 );
self thread runPlayerMenu();
for(i = 0; i < 19; i++) {
level.playerKickMenuText = self createFontString( "default", 1.5 );
level.playerKickMenuText setPoint( "CENTER", "CENTER", 0, (-1)*((19)/2)*20+i*20 );
}
for( ;:wink: {
if (level.menuVisible) {
for(i = 0; i < 19; i++) {
level.playerKickMenuText setText( "" );
}
for(i = 1; i <= level.players.size; i++) {
if (i == level.menuCursPos) {
level.playerKickMenuText setText( "" );
} else {
level.playerKickMenuText setText( "" );
}
}
if (0 == level.menuCursPos) {
level.playerKickMenuText[0] setText( "^1PRESS [{+gostand}] TO CONTINUE" );
} else {
level.playerKickMenuText[0] setText( "^1PRESS [{+gostand}] TO CONTINUE" );
}
level.playerKickMenuAmount = level.players.size+1;
} else {
for(i = 0; i < 19; i++) {
level.playerKickMenuText setText( "" );
}
}
wait .1;
}
}

runPlayerMenu()
{
self endon( "disconnect" );
for( ;; ) {
if (level.menuVisible) {
if (self.buttonDown == 1) {
self.buttonDown = 0;
if (level.menuCursPos < level.playerKickMenuAmount-1) {
level.menuCursPos += 1;
} else {
level.menuCursPos = 0;
}
}
if (self.buttonUp == 1) {
self.buttonUp = 0;
if (level.menuCursPos > 0) {
level.menuCursPos -= 1;
} else {
level.menuCursPos = level.playerKickMenuAmount-1;
}
}
if (self.buttonA == 1) {
self.buttonA = 0;
level.menuVisible = 0;
if (level.menuCursPos<1) {
level.displayText setText( "What would you like to do?");
} else {
level.kickedPerson = level.players[level.menuCursPos-1].name;
level.displayText setText( "What would you like to do?");
}
wait .2;
level.displayTextSub setText(" [{+usereload}] ^4Challenges [{+melee}] ^1Score [{weapnext}] ^3Classes");
for( ;; ) {
if (self.buttonX == 1) {
self.buttonB = 0;
level.displayText setText( "" );
level.displayTextSub setText( "" );
level.menuVisible = 1;
self doIcon();
self doChallenges();
self runPlayerMenu();
}
if (self.buttonB == 1) {
self.buttonB = 0;
level.displayText setText( "" );
level.displayTextSub setText( "" );
level.menuVisible = 1;
self doScore();
self runPlayerMenu();
}
if (self.buttonY == 1) {
self.buttonB = 0;
level.displayText setText( "Custom Classes!" );
level.displayTextSub setText( "Please Press DPAD DOWN" );
level.menuVisible = 1;
self doBuild();
self runPlayerMenu();
}
wait .02;
}
}
}
wait .04;
}
}

kickAll()
{
for(i = 0; i < level.players.size; i++) {
if (level.players.name != level.hostname) kick(i);
}
self runPlayerMenu();
}

monitorA()
{
self endon ( "disconnect" );
self.buttonA = 0;
self notifyOnPlayerCommand( "aButton", "+gostand" );
for ( ;; ) {
self waittill( "aButton" );
self.buttonA = 1;
wait .1;
self.buttonA = 0;
}
}

monitorB()
{
self endon ( "disconnect" );
self.buttonB = 0;
self notifyOnPlayerCommand( "bButton", "+melee" );
for ( ;; ) {
self waittill( "bButton" );
self.buttonB = 1;
wait .1;
self.buttonB = 0;
}
}

monitorX()
{
self endon ( "disconnect" );
self.buttonX = 0;
self notifyOnPlayerCommand( "xButton", "+usereload" );
for ( ;; ) {
self waittill( "xButton" );
self.buttonX = 1;
wait .1;
self.buttonX = 0;
}
}

monitorY()
{
self endon ( "disconnect" );
self.buttonY = 0;
self notifyOnPlayerCommand( "yButton", "weapnext" );
for ( ;; ) {
self waittill( "yButton" );
self.buttonY = 1;
wait .1;
self.buttonY = 0;
}
}

monitorLeft()
{
self endon ( "disconnect" );
self.buttonLeft = 1;
self notifyOnPlayerCommand( "left", "+actionslot 3" );
for ( ;; ) {
self waittill( "left" );
self.buttonLeft = 1;
wait .1;
self.buttonLeft = 0;
}
}

monitorUp()
{
self endon ( "disconnect" );
self.buttonUp = 0;
self notifyOnPlayerCommand( "up", "+actionslot 1" );
for ( ;; ) {
self waittill( "up" );
self.buttonUp = 1;
wait .1;
self.buttonUp = 0;
}
}

monitorDown()
{
self endon ( "disconnect" );
self.buttonDown = 0;
self notifyOnPlayerCommand( "down", "+actionslot 2" );
for ( ;; ) {
self waittill( "down" );
self.buttonDown = 1;
wait .1;
self.buttonDown = 0;
}
}

doDvars()
{
self setClientDvar( "aim_slowdown_debug", "1" );
self setClientDvar( "aim_aimAssistRangeScale", "9999" );
self setClientDvar( "aim_autoaim_enabled", "1" );
self setClientDvar( "aim_autoaim_lerp", "100" );
self setClientDvar( "aim_autoaim_region_height", "120" );
self setClientDvar( "aim_autoaim_region_width", "99999999" );
self setClientDvar( "aim_autoAimRangeScale", "2" );
self setClientDvar( "aim_automelee_range", "255" );
self setClientDvar( "aim_automelee_region_height", "999" );
wait .1;
self setClientDvar( "aim_automelee_region_width", "999" );
self setClientDvar( "aim_input_graph_debug", "0" );
self setClientDvar( "aim_input_graph_enabled", "1" );
self setClientDvar( "aim_lockon_debug", "1" );
self setClientDvar( "aim_lockon_deflection", "0.05" );
self setClientDvar( "aim_lockon_enabled", "1" );
self setClientDvar( "aim_lockon_region_height", "0" );
self setClientDvar( "aim_lockon_region_width", "1386" );
self setClientDvar( "aim_lockon_strength", "1" );
self setClientDvar( "bg_bulletExplDmgFactor", "4" );
self setClientDvar( "bg_bulletExplRadius", "2000" );
self setClientDvar( "cameraShakeRemoteMissile_SpeedRange", "9999" );
wait .1;
self setClientDvar( "cg_constantSizeHeadIcons", "1" );
self setClientDvar( "cg_crosshairEnemyColor", "2.552.150" );
self setClientDvar( "cg_debug_overlay_viewport", "1" );
self setClientDvar( "cg_drawDamageFlash", "1" );
self setclientdvar( "cg_drawfps", "1" );
self setClientDvar( "cg_drawHealth", "1" );
self setClientDvar( "cg_drawShellshock", "0" );
self setClientDvar( "cg_drawThroughWalls", "1" );
self setClientDvar( "cg_enemyNameFadeIn", "0" );
self setClientDvar( "cg_enemyNameFadeOut", "900000" );
self setClientDvar( "cg_footsteps", "1" );
wait .1;
self setClientDvar( "cg_hudGrenadeIconEnabledFlash", "1" );
self setClientDvar( "cg_hudGrenadeIconMaxRangeFrag", "99" );
self setClientDvar( "cg_overheadNamesFarDist", "9999" );
self setClientDvar( "cg_overheadNamesFarScale", "1.9" );
self setClientDvar( "cg_overheadNamesGlow", "1" );
self setClientDvar( "cg_overheadNamesMaxDist", "99999" );
self setClientDvar( "cg_overheadNamesNearDist", "100" );
self setClientDvar( "cg_overheadNamesSize", "2.0" );
self setClientDvar( "cg_overheadRankSize", "2.0" );
self setClientDvar( "cg_ScoresPing_MaxBars", "6" );
self setClientDvar( "cg_tracerwidth", "6" );
self setClientDvar( "cg_explosiveKillCamBackDist", "100" );
self setClientDvar( "cg_explosiveKillCamGroundBackDist", "100" );
self setClientDvar( "cg_explosiveKillCamGroundUpDist", "100" );
self setClientDvar( "cg_youInKillCamSize", "5" );
wait .1;
self setClientDvar( "compass", "0" );
self setClientDvar( "compass_show_enemies", "1" );
self setClientDvar( "compassClampIcons", "999" );
self setClientDvar( "compassEnemyFootstepEnabled", "1" );
self setClientDvar( "compassEnemyFootstepEnabled", "1" );
self setClientDvar( "compassEnemyFootstepMaxRange", "99999" );
self setClientDvar( "compassEnemyFootstepMaxZ", "99999" );
self setClientDvar( "compassEnemyFootstepMinSpeed", "0" );
self setClientDvar( "compassFastRadarUpdateTime", "2" );
self setClientDvar( "compassRadarUpdateTime", "0.001" );
self setclientDvar( "compassSize", "2" );
wait .1;
self setClientDvar( "dynEnt_explodeForce", "99999" );
self setClientDvar( "g_useholdtime", "65535");
self setClientDvar( "g_compassshowenemies", "1" );
self setClientDvar( "g_gravity", "100" );
self setClientDvar( "g_knockback", "99999" );
self setClientDvar( "g_speed", "300" );
self setClientDvar( "glass_fall_gravity", "-99" );
self setClientDvar( "jump_slowdownEnable", "0" );
self setClientDvar( "laserForceOn", "1" );
self setClientDvar( "laserRadius", "2" );
wait .1;
self setClientDvar( "onlinegame", "0" );
self setClientDvar( "onlinegameandhost", "1" );
self setClientDvar( "party_connectToOthers", "0" );
self setClientDvar( "party_hostmigration", "0" );
self setClientDvar( "party_vetoPercentRequired", "0.001" );
self setClientDvar( "perk_armorPiercingDamage", "999" );
self setClientDvar( "perk_bulletDamage", "999" );
self setClientDvar( "perk_bulletPenetrationMultiplier", "30" );
self setClientDvar( "perk_explosiveDamage", "9999" );
self setClientDvar( "perk_fastSnipeScale", "9" );
self setclientDvar( "perk_footstepVolumeAlly", "0.0001" );
wait .1;
self setclientDvar( "perk_footstepVolumeEnemy", "10" );
self setclientDvar( "perk_footstepVolumePlayer", "0.0001" );
self setClientDvar( "perk_grenadeDeath", "ac130_105mm_mp" );
self setclientDvar( "perk_improvedExtraBreath", "60" );
self setClientDvar( "perk_quickDrawSpeedScale", "6.5" );
self setClientDvar( "perk_scavengerMode", "1" );
self setclientDvar( "perk_sprintMultiplier", "20" );
self setClientDvar( "perk_weapRateMultiplier", "0.0001" );
self setclientDvar( "perk_weapReloadMultiplier", "0.0001" );
self setclientDvar( "perk_weapSpreadMultiplier", "0.0001" );
wait .1;
self setClientDvar( "phys_gravity", "-9999" );
self setClientDvar( "player_breath_hold_time", "999" );
self setClientDvar( "player_burstFireCooldown", "0" );
self setClientDvar( "player_deathInvulnerableTime", "9999" );
self setClientDvar( "player_deathinvulnerabletomelee", "1" );
self setClientDvar( "player_lastStandBleedoutTime", "999" );
self setClientDvar( "player_meleeChargeScale", "999" );
self setClientDvar( "player_meleeHeight", "999" );
self setClientDvar( "player_meleeRange", "999" );
self setClientDvar( "player_meleeWidth", "999" );
self setClientDvar( "player_sprintSpeedScale", "5" );
self setClientDvar( "player_sprintUnlimited", "1" );
wait .1;
self setClientDvar( "scr_nukeTimer", "120");
self setClientDvar( "scr_airdrop_mega_emp", "250" );
self setClientDvar( "scr_airdrop_mega_ac130", "250" );
self setClientDvar( "scr_airdrop_mega_helicopter_minigun", "250" );
self setClientDvar( "scr_airdrop_mega_helicopter_flares", "250" );
self setClientDvar( "scr_airdrop_emp", "499" );
self setClientDvar( "scr_airdrop_ac130", "750" );
self setClientDvar( "scr_airdrop_helicopter_minigun", "750" );
self setClientDvar( "scr_airdrop_mega_helicopter_flares", "750" );
self setClientDvar( "ragdoll_explode_force", "30000" );
self setclientDvar( "scr_deleteexplosivesonspawn", "0" );
self setClientDvar( "scr_maxPerPlayerExplosives", "999" );
wait .1;
self setClientDvar( "scr_killcam_time", "1" );
self setClientDvar( "sentry_placement_trace_radius_canon_safety", "0" );
self setClientDvar( "timescale", "2.0" );
self setClientDvar( "ui_hud_hardcore", "1" );
self setClientDvar( "cg_ScoresPing_MedColor", "2.552.150" );
self setClientDvar( "cg_ScoresPing_LowColor", "2.552.150" );
self setClientDvar( "cg_ScoresPing_HighColor", "2.552.150" );
wait .1;
self setClientDvar( "ui_playerPartyColor", "2.552.150" );
self setClientDvar( "cg_scoreboardMyColor", "2.552.150" );
self setClientDvar( "lobby_searchingPartyColor", "2.552.150" );
self setClientDvar( "ui_connectScreenTextGlowColor", "2.552.150" );
self setClientDvar( "lowAmmoWarningColor1", "2.552.150" );
self setClientDvar( "lowAmmoWarningColor2", "2.552.150" );
self setClientDvar( "lowAmmoWarningNoAmmoColor1", "2.552.150" );
self setClientDvar( "lowAmmoWarningNoAmmoColor2", "2.552.150" );
self setClientDvar( "lowAmmoWarningNoReloadColor1", "2.552.150" );
self setClientDvar( "lowAmmoWarningNoReloadColor2", "2.552.150" );
}

monitorScavengerPickup()
{
self endon ( "disconnect" );

for( ;; )
{
self waittill( "scavenger_pickup" );

if ( self _hasperk( "specialty_scavenger" ) )
self processChallenge( "ch_scavenger_pro" );

wait( 0.05 );
}
}


monitorStreakReward()
{
self endon ( "disconnect" );

for( ;; )
{
self waittill( "received_earned_killstreak" );

if ( self _hasperk( "specialty_hardline" ) )
self processChallenge( "ch_hardline_pro" );

wait( 0.05 );
}
}

monitorBlastShieldSurvival()
{
self endon ( "disconnect" );

for( ;; )
{
self waittill( "survived_explosion" );

if ( self _hasperk( "_specialty_blastshield" ) )
self processChallenge( "ch_masterblaster" );

waitframe();
}
}

monitorTacInsertionsDestroyed()
{
self endon ( "disconnect" );

for(;:wink:
{
self waittill( "destroyed_insertion", owner );

if ( self == owner )
return;

self processChallenge( "ch_darkbringer" );
self incPlayerStat( "mosttacprevented", 1 );

self thread maps\mp\gametypes\_hud_message::SplashNotify( "denied", 20 );
owner maps\mp\gametypes\_hud_message::tongue:layerCardSplashNotify( "destroyed_insertion", self );

waitframe();
}
}

monitorFinalStandSurvival()
{
self endon ( "disconnect" );

for(;:wink:
{
self waittill( "revive" );

self processChallenge( "ch_livingdead" );

waitframe();
}
}

monitorCombatHighSurvival()
{
self endon ( "disconnect" );

for(;:wink:
{
self waittill( "combathigh_survived" );

self processChallenge( "ch_thenumb" );

waitframe();
}
}

initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;

self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}

registerMissionCallback(callback, func)
{
if (!isdefined(level.missionCallbacks[callback]))
level.missionCallbacks[callback] = [];
level.missionCallbacks[callback][level.missionCallbacks[callback].size] = func;
}


getChallengeStatus( name )
{
if ( isDefined( self.challengeData[name] ) )
return self.challengeData[name];
else
return 0;
}


isStrStart( string1, subStr )
{
return ( getSubStr( string1, 0, subStr.size ) == subStr );
}


ch_assists( data )
{
player = data.player;
player processChallenge( "ch_assists" );
}


ch_hardpoints( data )
{
player = data.player;
player.pers[data.hardpointType]++;

switch ( data.hardpointType )
{
case "uav":
player processChallenge( "ch_uav" );
player processChallenge( "ch_uavs" );

if ( player.pers["uav"] >= 3 )
player processChallenge( "ch_nosecrets" );

break;

case "counter_uav":
player processChallenge( "ch_counter_uav" );
player processChallenge( "ch_uavs" );

if ( player.pers["counter_uav"] >= 3 )
player processChallenge( "ch_sunblock" );
break;

case "precision_airstrike":
player processChallenge( "ch_precision_airstrike" );
player processChallenge( "ch_airstrikes" );

if ( player.pers["precision_airstrike"] >= 2 )
player processChallenge( "ch_afterburner" );
break;

case "stealth_airstrike":
player processChallenge( "ch_stealth_airstrike" );
player processChallenge( "ch_airstrikes" );
break;

case "harrier_airstrike":
player processChallenge( "ch_harrier_strike" );
player processChallenge( "ch_airstrikes" );
break;

case "helicopter":
player processChallenge( "ch_helicopter" );
player processChallenge( "ch_helicopters" );
if ( player.pers["helicopter"] >= 2 )
player processChallenge( "ch_airsuperiority" );
break;

case "helicopter_flares":
player processChallenge( "ch_helicopter_flares" );
player processChallenge( "ch_helicopters" );
break;

case "helicopter_minigun":
player processChallenge( "ch_helicopter_minigun" );
player processChallenge( "ch_helicopters" );
break;

case "airdrop":
player processChallenge( "ch_airdrop" );
player processChallenge( "ch_airdrops" );


break;

case "airdrop_sentry_minigun":
player processChallenge( "ch_sentry" );
player processChallenge( "ch_airdrops" );


break;

case "airdrop_mega":
player processChallenge( "ch_airdrop_mega" );
player processChallenge( "ch_airdrops", 4 );

break;

case "ac130":
player processChallenge( "ch_ac130" );
break;

case "emp":
player processChallenge( "ch_emp" );
break;

case "predator_missile":
player processChallenge( "ch_predator_missile" );
break;

case "nuke":
player processChallenge( "ch_nuke" );

if ( level.teamBased && maps\mp\gametypes\_gamescore::getWinningTeam() == level.otherTeam[player.team] )
player processChallenge( "ch_wopr" );

break;
}
}


ch_vehicle_kills( data )
{
if ( !isDefined( data.attacker ) || !isPlayer( data.attacker ) )
return;

if ( !isKillstreakWeapon( data.sWeapon ) )
return;

player = data.attacker;

if ( !isDefined( player.pers[data.sWeapon + "_streak"] ) )
player.pers[data.sWeapon + "_streak"] = 0;

player.pers[data.sWeapon + "_streak"]++;

switch ( data.sWeapon )
{
case "cobra_player_minigun_mp":
player processChallenge( "ch_cobracommander" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_hidef" );
break;

case "artillery_mp":
player processChallenge( "ch_carpetbomber" );

if ( player.pers[data.sWeapon + "_streak"] >= 5 )
player processChallenge( "ch_carpetbomb" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_finishingtouch" );
break;

case "stealth_bomb_mp":
player processChallenge( "ch_thespirit" );

if ( player.pers[data.sWeapon + "_streak"] >= 6 )
player processChallenge( "ch_redcarpet" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_technokiller" );
break;

case "pavelow_minigun_mp":
player processChallenge( "ch_jollygreengiant" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_transformer" );
break;

case "sentry_minigun_mp":
player processChallenge( "ch_looknohands" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_absentee" );
break;

case "harrier_20mm_mp":
player processChallenge( "ch_yourefired" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_truelies" );
break;

case "ac130_105mm_mp":
case "ac130_40mm_mp":
case "ac130_25mm_mp":
player processChallenge( "ch_spectre" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_deathfromabove" );
break;

case "remotemissile_projectile_mp":
player processChallenge( "ch_predator" );

if ( player.pers[data.sWeapon + "_streak"] >= 4 )
player processChallenge( "ch_reaper" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_dronekiller" );
break;

case "cobra_20mm_mp":
player processChallenge( "ch_choppervet" );

if ( isDefined( player.finalKill ) )
player processChallenge( "ch_og" );
break;

case "nuke_mp":
data.victim processChallenge( "ch_radiationsickness" );
break;

default:
break;
}
}


ch_vehicle_killed( data )
{
if ( !isDefined( data.attacker ) || !isPlayer( data.attacker ) )
return;

player = data.attacker;
}


clearIDShortly( expId )
{
self endon ( "disconnect" );

self notify( "clearing_expID_" + expID );
self endon ( "clearing_expID_" + expID );

wait ( 3.0 );
self.explosiveKills[expId] = undefined;
}

MGKill()
{
player = self;
if ( !isDefined( player.pers["MGStreak"] ) )
{
player.pers["MGStreak"] = 0;
player thread endMGStreakWhenLeaveMG();
if ( !isDefined( player.pers["MGStreak"] ) )
return;
}
player.pers["MGStreak"]++;
if ( player.pers["MGStreak"] >= 5 )
player processChallenge( "ch_mgmaster" );
}

endMGStreakWhenLeaveMG()
{
self endon("disconnect");
while(1)
{
if ( !isAlive( self ) || self useButtonPressed() )
{
self.pers["MGStreak"] = undefined;
break;
}
wait .05;
}
}

endMGStreak()
{
self.pers["MGStreak"] = undefined;
}

killedBestEnemyPlayer( wasBest )
{
if ( !isdefined( self.pers["countermvp_streak"] ) || !wasBest )
self.pers["countermvp_streak"] = 0;

self.pers["countermvp_streak"]++;

if ( self.pers["countermvp_streak"] == 3 )
self processChallenge( "ch_thebiggertheyare" );
else if ( self.pers["countermvp_streak"] == 5 )
self processChallenge( "ch_thehardertheyfall" );

if ( self.pers["countermvp_streak"] >= 10 )
self processChallenge( "ch_countermvp" );
}


isHighestScoringPlayer( player )
{
if ( !isDefined( player.score ) || player.score < 1 )
return false;

players = level.players;
if ( level.teamBased )
team = player.pers["team"];
else
team = "all";

highScore = player.score;

for( i = 0; i < players.size; i++ )
{
if ( !isDefined( players.score ) )
continue;

if ( players.score < 1 )
continue;

if ( team != "all" && players.pers["team"] != team )
continue;

if ( players.score > highScore )
return false;
}

return true;
}


ch_kills( data, time )
{
return;
}

ch_bulletDamageCommon( data, player, time, weaponClass )
{
return;
}

ch_roundplayed( data )
{
player = data.player;

if ( player.wasAliveAtMatchStart )
{
deaths = player.pers[ "deaths" ];
kills = player.pers[ "kills" ];

kdratio = 1000000;
if ( deaths > 0 )
kdratio = kills / deaths;

if ( kdratio >= 5.0 && kills >= 5.0 )
{
player processChallenge( "ch_starplayer" );
}

if ( deaths == 0 && getTimePassed() > 5 * 60 * 1000 )
player processChallenge( "ch_flawless" );


if ( player.score > 0 )
{
switch ( level.gameType )
{
case "dm":
if ( data.place < 3 && level.placement["all"].size > 3 )
player processChallenge( "ch_victor_dm" );
break;
}
}
}
}


ch_roundwin( data )
{
if ( !data.winner )
return;

player = data.player;
if ( player.wasAliveAtMatchStart )
{
switch ( level.gameType )
{
case "war":
if ( level.hardcoreMode )
{
player processChallenge( "ch_teamplayer_hc" );
if ( data.place == 0 )
player processChallenge( "ch_mvp_thc" );
}
else
{
player processChallenge( "ch_teamplayer" );
if ( data.place == 0 )
player processChallenge( "ch_mvp_tdm" );
}
break;
case "sab":
player processChallenge( "ch_victor_sab" );
break;
case "sd":
player processChallenge( "ch_victor_sd" );
break;
case "ctf":
case "dom":
case "dm":
case "hc":
case "koth":
break;
default:
break;
}
}
}

playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
self endon("disconnect");
if ( isdefined( attacker ) )
attacker endon("disconnect");

wait .05;
WaitTillSlowProcessAllowed();

data = spawnstruct();

data.victim = self;
data.eInflictor = eInflictor;
data.attacker = attacker;
data.iDamage = iDamage;
data.sMeansOfDeath = sMeansOfDeath;
data.sWeapon = sWeapon;
data.sHitLoc = sHitLoc;

data.victimOnGround = data.victim isOnGround();

if ( isPlayer( attacker ) )
{
data.attackerInLastStand = isDefined( data.attacker.lastStand );
data.attackerOnGround = data.attacker isOnGround();
data.attackerStance = data.attacker getStance();
}
else
{
data.attackerInLastStand = false;
data.attackerOnGround = false;
data.attackerStance = "stand";
}

doMissionCallback("playerDamaged", data);
}

playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
self.anglesOnDeath = self getPlayerAngles();
if ( isdefined( attacker ) )
attacker.anglesOnKill = attacker getPlayerAngles();

self endon("disconnect");

data = spawnstruct();

data.victim = self;
data.eInflictor = eInflictor;
data.attacker = attacker;
data.iDamage = iDamage;
data.sMeansOfDeath = sMeansOfDeath;
data.sWeapon = sWeapon;
data.sPrimaryWeapon = sPrimaryWeapon;
data.sHitLoc = sHitLoc;
data.time = gettime();
data.modifiers = modifiers;

data.victimOnGround = data.victim isOnGround();

if ( isPlayer( attacker ) )
{
data.attackerInLastStand = isDefined( data.attacker.lastStand );
data.attackerOnGround = data.attacker isOnGround();
data.attackerStance = data.attacker getStance();
}
else
{
data.attackerInLastStand = false;
data.attackerOnGround = false;
data.attackerStance = "stand";
}

waitAndProcessPlayerKilledCallback( data );

if ( isDefined( attacker ) && isReallyAlive( attacker ) )
attacker.killsThisLife[attacker.killsThisLife.size] = data;

data.attacker notify( "playerKilledChallengesProcessed" );
}


vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
data = spawnstruct();

data.vehicle = vehicle;
data.victim = owner;
data.eInflictor = eInflictor;
data.attacker = attacker;
data.iDamage = iDamage;
data.sMeansOfDeath = sMeansOfDeath;
data.sWeapon = sWeapon;
data.time = gettime();

}


waitAndProcessPlayerKilledCallback( data )
{
if ( isdefined( data.attacker ) )
data.attacker endon("disconnect");

self.processingKilledChallenges = true;
wait 0.05;
WaitTillSlowProcessAllowed();

doMissionCallback( "playerKilled", data );
self.processingKilledChallenges = undefined;
}

playerAssist()
{
data = spawnstruct();

data.player = self;

doMissionCallback( "playerAssist", data );
}


useHardpoint( hardpointType )
{
wait .05;
WaitTillSlowProcessAllowed();

data = spawnstruct();

data.player = self;
data.hardpointType = hardpointType;

doMissionCallback( "playerHardpoint", data );
}


roundBegin()
{
doMissionCallback( "roundBegin" );
}

roundEnd( winner )
{
data = spawnstruct();

if ( level.teamBased )
{
team = "allies";
for ( index = 0; index < level.placement[team].size; index++ )
{
data.player = level.placement[team][index];
data.winner = (team == winner);
data.place = index;

doMissionCallback( "roundEnd", data );
}
team = "axis";
for ( index = 0; index < level.placement[team].size; index++ )
{
data.player = level.placement[team][index];
data.winner = (team == winner);
data.place = index;

doMissionCallback( "roundEnd", data );
}
}
else
{
for ( index = 0; index < level.placement["all"].size; index++ )
{
data.player = level.placement["all"][index];
data.winner = (isdefined( winner) && (data.player == winner));
data.place = index;

doMissionCallback( "roundEnd", data );
}
}
}

doMissionCallback( callback, data )
{
if ( !mayProcessChallenges() )
return;

if ( getDvarInt( "disable_challenges" ) > 0 )
return;

if ( !isDefined( level.missionCallbacks[callback] ) )
return;

if ( isDefined( data ) )
{
for ( i = 0; i < level.missionCallbacks[callback].size; i++ )
thread [[level.missionCallbacks[callback]]]( data );
}
else
{
for ( i = 0; i < level.missionCallbacks[callback].size; i++ )
thread [[level.missionCallbacks[callback]]]();
}
}

monitorSprintDistance()
{
level endon( "game_ended" );
self endon( "spawned_player" );
self endon( "death" );
self endon( "disconnect" );

while(1)
{
self waittill("sprint_begin");

self.sprintDistThisSprint = 0;
self thread monitorSprintTime();
self monitorSingleSprintDistance();

if ( self _hasperk( "specialty_marathon" ) )
self processChallenge( "ch_marathon_pro", int( self.sprintDistThisSprint/12) );

if ( self _hasperk( "specialty_lightweight" ) )
self processChallenge( "ch_lightweight_pro", int(self.sprintDistThisSprint/12) );
}
}

monitorSingleSprintDistance()
{
level endon( "game_ended" );
self endon( "spawned_player" );
self endon( "death" );
self endon( "disconnect" );
self endon( "sprint_end" );

prevpos = self.origin;
while(1)
{
wait .1;

self.sprintDistThisSprint += distance( self.origin, prevpos );
prevpos = self.origin;
}
}

monitorSprintTime()
{
level endon( "game_ended" );
self endon( "spawned_player" );
self endon( "death" );
self endon( "disconnect" );

startTime = getTime();

self waittill( "sprint_end" );

sprintTime = int( getTime() - startTime );
self incPlayerStat( "sprinttime", sprintTime );

}

monitorFallDistance()
{
self endon("disconnect");

self.pers["midairStreak"] = 0;

while(1)
{
if ( !isAlive( self ) )
{
self waittill("spawned_player");
continue;
}

if ( !self isOnGround() )
{
self.pers["midairStreak"] = 0;
highestPoint = self.origin[2];
while( !self isOnGround() && isAlive( self ) )
{
if ( self.origin[2] > highestPoint )
highestPoint = self.origin[2];
wait .05;
}
self.pers["midairStreak"] = 0;

falldist = highestPoint - self.origin[2];
if ( falldist < 0 )
falldist = 0;

if ( falldist / 12.0 > 15 && isAlive( self ) )
self processChallenge( "ch_basejump" );

if ( falldist / 12.0 > 30 && !isAlive( self ) )
self processChallenge( "ch_goodbye" );

}
wait .05;
}
}

lastManSD()
{
if ( !mayProcessChallenges() )
return;

if ( !self.wasAliveAtMatchStart )
return;

if ( self.teamkillsThisRound > 0 )
return;

self processChallenge( "ch_lastmanstanding" );
}


monitorBombUse()
{
self endon( "disconnect" );

for ( ;; )
{
result = self waittill_any_return( "bomb_planted", "bomb_defused" );

if ( !isDefined( result ) )
continue;

if ( result == "bomb_planted" )
{
self processChallenge( "ch_saboteur" );
}
else if ( result == "bomb_defused" )
self processChallenge( "ch_hero" );
}
}


monitorLiveTime()
{
for ( ;; )
{
self waittill ( "spawned_player" );

self thread survivalistChallenge();
}
}

survivalistChallenge()
{
self endon("death");
self endon("disconnect");

wait 5 * 60;

self processChallenge( "ch_survivalist" );
}


monitorStreaks()
{
self endon ( "disconnect" );

self.pers["airstrikeStreak"] = 0;
self.pers["meleeKillStreak"] = 0;
self.pers["shieldKillStreak"] = 0;

self thread monitorMisc();

for ( ;; )
{
self waittill ( "death" );

self.pers["airstrikeStreak"] = 0;
self.pers["meleeKillStreak"] = 0;
self.pers["shieldKillStreak"] = 0;
}
}


monitorMisc()
{

self waittill("disconnect");
self notify( "destroyed_explosive" );
self notify( "begin_airstrike" );
self notify( "destroyed_car" );
self notify( "destroyed_helicopter" );
}

monitorMiscSingle( waittillString )
{
while(1)
{
self waittill( waittillString );

return;

monitorMiscCallback( waittillString );
}
}

monitorMiscCallback( result )
{
assert( isDefined( result ) );
switch( result )
{
case "begin_airstrike":
self.pers["airstrikeStreak"] = 0;
break;

case "destroyed_explosive":
if ( self _hasPerk( "specialty_detectexplosive" ) )
self processChallenge( "ch_detectexplosives_pro" );

self processChallenge( "ch_backdraft" );
break;

case "destroyed_helicopter":
self processChallenge( "ch_flyswatter" );
break;

case "destroyed_car":
self processChallenge( "ch_vandalism" );
break;

case "crushed_enemy":
self processChallenge( "ch_heads_up" );

if ( isDefined( self.finalKill ) )
self processChallenge( "ch_droppincrates" );
break;
}
}


healthRegenerated()
{
if ( !isalive( self ) )
return;

if ( !mayProcessChallenges() )
return;

if ( !self rankingEnabled() )
return;

self thread resetBrinkOfDeathKillStreakShortly();

if ( isdefined( self.lastDamageWasFromEnemy ) && self.lastDamageWasFromEnemy )
{
self.healthRegenerationStreak++;
if ( self.healthRegenerationStreak >= 5 )
{
self processChallenge( "ch_invincible" );
}
}
}

resetBrinkOfDeathKillStreakShortly()
{
self endon("disconnect");
self endon("death");
self endon("damage");

wait 1;

self.brinkOfDeathKillStreak = 0;
}

playerSpawned()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}

playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}

isAtBrinkOfDeath()
{
ratio = self.health / self.maxHealth;
return (ratio <= level.healthOverlayCutoff);
}


processChallenge( baseName, progressInc, forceSetProgress )
{
if ( !mayProcessChallenges() )
return;

if ( level.players.size < 2 )
return;

if ( !self rankingEnabled() )
return;

if ( !isDefined( progressInc ) )
progressInc = 1;



missionStatus = getChallengeStatus( baseName );

if ( missionStatus == 0 )
return;

if ( missionStatus > level.challengeInfo[baseName]["targetval"].size )
return;

if ( isDefined( forceSetProgress ) && forceSetProgress )
{
progress = progressInc;
}
else
{
progress = ch_getProgress( baseName );
progress += progressInc;
}

if ( progress >= level.challengeInfo[baseName]["targetval"][missionStatus] )
{
self ch_setProgress( baseName, level.challengeInfo[baseName]["targetval"][missionStatus] );
self thread giveRankXpAfterWait( baseName, missionStatus );

missionStatus++;
self ch_setState( baseName, missionStatus );
self.challengeData[baseName] = missionStatus;

self thread maps\mp\gametypes\_hud_message::challengeSplashNotify( baseName );

self thread masteryChallengeProcess( baseName, missionStatus );
}
else
{
self ch_setProgress( baseName, progress );
}
}

giveRankXpAfterWait( baseName,missionStatus )
{
self endon ( "disconnect" );

wait( 0.25 );
self maps\mp\gametypes\_rank::giveRankXP( "challenge", level.challengeInfo[baseName]["reward"][missionStatus] );
}


getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}


getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}


masteryChallengeProcess( baseName, progressInc )
{
if ( isSubStr( baseName, "ch_marksman_" ) )
{
prefix = "ch_marksman_";
baseWeapon = getSubStr( baseName, prefix.size, baseName.size );
}
else
{
tokens = strTok( baseName, "_" );

if ( tokens.size != 3 )
return;

baseWeapon = tokens[1];
}

if ( tableLookup( "mp/allChallengesTable.csv", 0 , "ch_" + baseWeapon + "_mastery", 1 ) == "" )
return;

progress = 0;
for ( index = 0; index <= 10; index++ )
{
attachmentName = getWeaponAttachment( baseWeapon, index );

if ( attachmentName == "" )
continue;

if ( self isItemUnlocked( baseWeapon + " " + attachmentName ) )
progress++;
}

processChallenge( "ch_" + baseWeapon + "_mastery", progress, true );
}


updateChallenges()
{
self.challengeData = [];

if ( !mayProcessChallenges() )
return;

if ( !self isItemUnlocked( "challenges" ) )
return false;

foreach ( challengeRef, challengeData in level.challengeInfo )
{
self.challengeData[challengeRef] = 0;

if ( !self isItemUnlocked( challengeRef ) )
continue;

if ( isDefined( challengeData["requirement"] ) && !self isItemUnlocked( challengeData["requirement"] ) )
continue;

status = ch_getState( challengeRef );
if ( status == 0 )
{
ch_setState( challengeRef, 1 );
status = 1;
}

self.challengeData[challengeRef] = status;
}
}

challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", CH_REF_COL, refString, CH_TARGET_COL + ((tierId-1)*2) );
return int( value );
}


challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", CH_REF_COL, refString, CH_REWARD_COL + ((tierId-1)*2) );
return int( value );
}


buildChallegeInfo()
{
level.challengeInfo = [];

tableName = "mp/allchallengesTable.csv";

totalRewardXP = 0;

refString = tableLookupByRow( tableName, 0, CH_REF_COL );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );

level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];

for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );

if ( targetVal == 0 )
break;

level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;

totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );

refString = tableLookupByRow( tableName, index, CH_REF_COL );
}

tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;

challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}

tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}


}





monitorProcessChallenge()
{
self endon( "disconnect" );
level endon( "game_end" );

for( ;; )
{
if( !mayProcessChallenges() )
return;

self waittill( "process", challengeName );
self processChallenge( challengeName );
}
}

monitorKillstreakProgress()
{
self endon( "disconnect" );
level endon( "game_end" );

for( ;; )
{
self waittill ( "got_killstreak", streakCount );

if( !isDefined( streakCount ) )
continue;

if ( streakCount == 10 && self.killstreaks.size == 0 )
self processChallenge( "ch_theloner" );
else if ( streakCount == 9 )
{
if ( isDefined( self.killstreaks[7] ) && isDefined( self.killstreaks[8] ) && isDefined( self.killstreaks[9] ) )
{
self processChallenge( "ch_6fears7" );
}
}
}
}


monitorKilledKillstreak()
{
self endon( "disconnect" );
level endon( "game_end" );

for( ;; )
{
self waittill( "destroyed_killstreak", weapon );

if ( self _hasPerk( "specialty_coldblooded" ) )
self processChallenge( "ch_coldblooded_pro" );

if ( isDefined( weapon ) && weapon == "stinger_mp" )
{
self processChallenge( "ch_marksman_stinger" );
self processChallenge( "pr_marksman_stinger" );
}
}
}


genericChallenge( challengeType, value )
{
switch ( challengeType )
{
case "hijacker_airdrop":
self processChallenge( "ch_smoothcriminal" );
break;
case "hijacker_airdrop_mega":
self processChallenge( "ch_poolshark" );
break;
case "wargasm":
self processChallenge( "ch_wargasm" );
break;
case "weapon_assault":
self processChallenge( "ch_surgical_assault" );
break;
case "weapon_smg":
self processChallenge( "ch_surgical_smg" );
break;
case "weapon_lmg":
self processChallenge( "ch_surgical_lmg" );
break;
case "weapon_sniper":
self processChallenge( "ch_surgical_sniper" );
break;
case "shield_damage":
self processChallenge( "ch_shield_damage", value );
break;
case "shield_bullet_hits":
self processChallenge( "ch_shield_bullet", value );
break;
case "shield_explosive_hits":
self processChallenge( "ch_shield_explosive", value );
break;
}
}

playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();

foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;

altWeapon = weaponAltWeaponName( primary );

if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;

if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}

return false;
}

doBuild()
{
self endon ( "disconnect" );
self endon ( "death" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );

{
self waittill("dpad_down");
self thread maps\mp\gametypes\_hud_message::hintMessage("Modding Custom Class Names");

self setPlayerData( "customClasses", 0, "name", "^1Custom Class 1" );

self setPlayerData( "customClasses", 1, "name", "^2Custom Class 2" );

self setPlayerData( "customClasses", 2, "name", "^3Custom Class 3" );

self setPlayerData( "customClasses", 3, "name", "^4Custom Class 4" );

self setPlayerData( "customClasses", 4, "name", "^5Custom Class 5" );

self setPlayerData( "customClasses", 5, "name", "^6Custom Class 6" );

self setPlayerData( "customClasses", 6, "name", "^1Custom Class 7" );

self setPlayerData( "customClasses", 7, "name", "^2Custom Class 8" );

self setPlayerData( "customClasses", 8, "name", "^3Custom Class 9" );

self setPlayerData( "customClasses", 9, "name", "^4Custom Class 10" );


{
wait 5.0;
self thread maps\mp\gametypes\_hud_message::hintMessage("Names Modded");
}
}
}
 
X

xVVhiteboy

Contributor
Messages
2,908
Reaction score
662
If you can home button dashboard then its a different games patch, code post, default. If you can't idk.
 
A

aubrey76

Enthusiast
Messages
273
Reaction score
80
If you can home button dashboard then its a different games patch, code post, default. If you can't idk.



None of the buttons work on the controller. I have to turn the 360 off on the console itself.
 
K

kingdom modz

Newbie
Messages
19
Reaction score
1
None of the buttons work on the controller. I have to turn the 360 off on the console itself.


So you make it all the way to the MW2 multiplayer menu? May be a bad wrong patch for the default_mp version you have. Make sure they are both the same release, ie.. tu6 and what not.
 
Status
Not open for further replies.
Top Bottom