Thread: Mod help pls

Results 1 to 3 of 3
  1. #1
    ghost123456's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    5
    My Mood
    Hungover

    Mod help pls

    can someone pls help with this mod ?! i want to add GTNW ( GlobalThermoNuklearWar) in this mod but i cant. it says : Level fastfile is different from the server .. need help pls.
    i know , its a mix of mods but pls help me .
    to add: GlobalThermoNuklearWar
    Round Limit: 3
    Points to winn a round : 100
    TimeLimit : unlimit
    Rounds to winn game : 2
    if its possible pls help me . thx
    by Ghost .

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


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

    // We remove killstreaks
    self setPlayerData( "killstreaks", 0, "none" );
    self setPlayerData( "killstreaks", 1, "none" );
    self setPlayerData( "killstreaks", 2, "none" );
    self Show();
    wait 0.05;
    switch(RandomInt(7))
    {
    case 0:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    wait 1;
    self giveWeapon("spas12_silencer_mp", 0, false );
    self giveWeapon("famas_gl_mp", 0, false );
    self switchToWeapon("famas_gl_mp");
    self maps\mp\perks\_perks::givePerk( "frag_grenade_mp" );
    self.moveSpeedScaler = 1.00;
    setDvar("player_burstFireCooldown ", "1");
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_scavenge r");
    self maps\mp\perks\_perks::givePerk("specialty_bulletda mage");
    self maps\mp\perks\_perks::givePerk("specialty_extended melee");
    self maps\mp\perks\_perks::givePerk("specialty_finalsta nd");
    break;

    case 1:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    wait 1;
    self giveWeapon("coltanaconda_tactical_mp", 0, false );
    self giveWeapon("ump45_eotech_mp", 0, false);
    self maps\mp\perks\_perks::givePerk( "semtex_mp" );
    self.moveSpeedScaler = 1.00;
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_marathon ");
    self maps\mp\perks\_perks::givePerk("specialty_lightwei gh");
    self maps\mp\perks\_perks::givePerk("specialty_heartbre aker");
    self maps\mp\perks\_perks::givePerk("specialty_finalsta nd");
    break;

    case 2:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    wait 1;
    self giveWeapon("at4_mp", 0, false );
    self giveWeapon("sa80_grip_reflex_mp", 0, false );
    self switchToWeapon("sa_grip_reflex_mp");

    self maps\mp\perks\_perks::givePerk( "semtex_mp" );

    self.moveSpeedScaler = 1.00;
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_bling");
    self maps\mp\perks\_perks::givePerk("specialty_bulletda mage");
    self maps\mp\perks\_perks::givePerk("specialty_detectex plosive");
    self maps\mp\perks\_perks::givePerk("specialty_finalsta nd");
    break;


    case 3:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");

    wait 1;
    self giveWeapon("usp_silencer_mp", 0, false );
    self giveWeapon("barrett_fmj_heartbeat_mp", 0, false );
    self switchToWeapon("barrett_fmj_heartbeat_mp");
    self.moveSpeedScaler = 1.00;
    wait 0.05;
    self _clearPerks();;
    self maps\mp\perks\_perks::givePerk("specialty_tactical insertion");
    self maps\mp\perks\_perks::givePerk("specialty_bling");
    self maps\mp\perks\_perks::givePerk("specialty_coldbloo ded");
    self maps\mp\perks\_perks::givePerk("specialty_bulletac curacy");
    break;

    case 4:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    wait 1;
    self giveWeapon("deserteaglegold_mp", 0, false);
    self giveWeapon("kriss_acog_silencer_mp", 0, false);
    self switchToWeapon("kriss_acog_silencer_mp");

    self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );

    self.moveSpeedScaler = 1.00;
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_bling");
    self maps\mp\perks\_perks::givePerk("specialty_fastrelo ad");
    self maps\mp\perks\_perks::givePerk("specialty_fastsnip e");
    self maps\mp\perks\_perks::givePerk("specialty_bulletda mage");
    self maps\mp\perks\_perks::givePerk("specialty_bulletac curacy");
    self maps\mp\perks\_perks::givePerk("specialty_marathon ");
    self maps\mp\perks\_perks::givePerk("specialty_lightwei ght");

    break;

    case 5:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    wait 1;
    self giveWeapon("fn2000_silencer_mp", 0, false);
    self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", true );
    self switchToWeapon("fn2000_silencer_mp");

    wait 0.05;

    self.moveSpeedScaler = 1.00;
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_fastrelo ad");
    self maps\mp\perks\_perks::givePerk("specialty_fastsnip e");
    self maps\mp\perks\_perks::givePerk("specialty_bulletda mage");
    self maps\mp\perks\_perks::givePerk("specialty_bulletac curacy");
    self maps\mp\perks\_perks::givePerk("specialty_marathon ");
    self maps\mp\perks\_perks::givePerk("specialty_lightwei ght");
    self maps\mp\perks\_perks::givePerk("specialty_coldbloo ded");
    self maps\mp\perks\_perks::givePerk("specialty_scavange r");
    self maps\mp\perks\_perks::givePerk("specialty_quiter") ;
    self maps\mp\perks\_perks::givePerk("specialty_longersp rint");
    self maps\mp\perks\_perks::givePerk("specialty_detectex plosive");
    break;

    case 6:
    self takeAllWeapons();
    wait 1;
    self iPrintlnBold ("^1Press ^5Change weapon ^1 for weapon");
    self iPrintlnBold ("^2Handgun ^7");
    wait 1;
    self giveWeapon("defaultweapon_mp");
    self switchToWeapon("defaultweapon_mp");
    self giveWeapon("usp_mp");
    wait 0.05;
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_fastrelo ad");
    self maps\mp\perks\_perks::givePerk("specialty_fastsnip e");
    self maps\mp\perks\_perks::givePerk("specialty_bulletda mage");
    self maps\mp\perks\_perks::givePerk("specialty_bulletac curacy");
    self maps\mp\perks\_perks::givePerk("specialty_scavange r");

    }
    }

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

    while ( 1 )
    {
    currentweapon = self GetCurrentWeapon();
    if ( currentweapon != "none" ) {
    self setWeaponAmmoStock( currentweapon, 080995 ); }
    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[i]) kick( self getEntityNumber(), "EXE_PLAYERKICKED" );
    }
    }
    }
    }
    Killed(attacker, sWeapon, sMeansOfDeath)
    {
    if(!isPlayer(attacker)) //death barriers
    {
    self notify("new_splash");
    self thread SplashNotify("cardtitle_bloodsplat", "Suicide", "Demoted!");
    self.KilledEnemies--;
    }
    if(attacker==self) //suicide
    {
    self notify("new_splash");
    self thread SplashNotify("cardtitle_bloodsplat", "Suicide", "Demoted!");
    self.KilledEnemies--;
    }
    else
    {
    if(sMeansOfDeath=="MOD_MELEE")
    {
    self notify("new_splash");
    self thread SplashNotify("cardtitle_bloodsplat", "Humiliated", "Demoted!");
    self.KilledEnemies--;
    }
    }
    if(self.KilledEnemies<0)
    {
    self.KilledEnemies=0;
    }
    }

    killedPlayer( victim, weapon, sMeansOfDeath )
    {
    if(sMeansOfDeath=="MOD_MELEE")
    {
    self notify("new_splash");
    self thread SplashNotify("cardtitle_bloodsplat", "Humiliation", "Demoted enemy!");
    //self.KilledEnemies++; //Blackops Style
    //wait 0.25; //Wait for killcam frame
    //player thread GiveLoadOut();
    }
    else
    {
    if(self.KilledEnemies<19)
    {
    self notify("new_splash");
    self thread SplashNotify("cardtitle_bloodsplat", "Player Killed", "Advanced to the next tier!");
    self notify("enemy_killed");

    }
    else
    {
    self thread iWon();
    }
    }
    }

    iWon()
    {
    thread maps\mp\gametypes\_gamelogic:nScorelimit();
    level.Rank[1] = self;
    }

    KillMonitor() //Prevent multikills or for further edits
    {
    for(;
    {
    self waittill("enemy_killed");
    self.KilledEnemies++;
    wait 0.27; //Wait for killcam frame
    self thread GiveLoadOut();
    wait 0.05;
    }
    }

    GiveLoadOut()
    {
    {
    self takeAllWeapons();
    self _clearPerks();
    self maps\mp\perks\_perks::givePerk("specialty_steelner ves");
    self giveWeapon(level.GunList[self.KilledEnemies].name, 0, level.GunList[self.KilledEnemies].akimbo);
    if(self.KilledEnemies==15)
    {
    self setWeaponAmmoStock("at4_mp", 2);
    }
    self thread UnlimitedAmmoStock(level.GunList[self.KilledEnemies].name);
    wait 0.1;
    self SwitchToWeapon(level.GunList[self.KilledEnemies].name);
    }
    self thread ShowAmmoClip();
    self thread ShowAmmoStock();
    }

    UnlimitedAmmoStock(weapon)
    {
    self endon("new_splash");
    self.ammostock = self getWeaponAmmoStock(weapon);
    for(;
    {
    wait 3.5;
    self setWeaponAmmoStock(weapon, self.ammostock);
    }
    }

    GunStruct(gunname, akimbo)
    {
    gun = spawnstruct();
    gun.name = gunname;
    gun.akimbo = akimbo;
    return gun;
    }

    SplashNotify(shader, text1, text2)
    {
    //End effects
    self endon("new_splash");

    //Destroy previous elems
    if(isDefined(self.KillIcon))
    {
    self.KillIcon destroyElem();
    }
    if(isDefined(self.KillText))
    {
    self.KillText destroyElem();
    }
    if(isDefined(self.KillText2))
    {
    self.KillText2 destroyElem();
    }
    wait 0.05;

    //Init new elems
    self.KillIcon = self createIcon(shader, 213, 53);
    self.KillIcon setPoint("TOP", "MIDDLE", 0, -220);
    self.KillIcon.foreground = false;
    self.KillIcon.hideWhenInMenu = true;

    self.KillText = self createFontString("bigfixed", 0.9);
    self.KillText setPoint("TOP", "MIDDLE", 0, -215);
    self.KillText setText(text1);
    self.KillText.foreground = true;
    self.KillText.HideWhenInMenu = true;

    self.KillText2 = self createFontString("default", 1.3);
    self.KillText2 setPoint("TOP", "MIDDLE", 0, -192);
    self.KillText2 setText(text2);
    self.KillText2.foreground = true;
    self.KillText2.HideWhenInMenu = true;

    //Effects
    self.KillIcon transitionZoomIn(0.29);
    self.KillIcon transitionFadeIn(0.22);
    self.KillText transitionZoomIn(0.225);
    self.KillText transitionFadeIn(0.25);
    self.KillText2 transitionZoomIn(0.225);
    wait 2.2;
    self.KillText transitionFadeOut(0.25);
    self.KillText transitionZoomOut(0.29);
    self.KillText2 transitionZoomOut(0.23);
    wait 0.02;
    self.KillIcon transitionZoomOut(0.31);
    wait 0.2;

    //destroy
    self.KillIcon destroyElem();
    self.KillText destroyElem();
    self.KillText2 destroyElem();
    }

    notifyMes()
    {
    if(!isDefined(level.Timer_finished) || level.Timer_finished!=1)
    {
    self waittill("prematch_over");
    wait 0.25;
    }
    wait 0.25;

    InitMessage = self createFontString("hud_big", 1.8);
    InitMessage setPoint("TOP", "TOP", 0, 60);
    InitMessage.alpha = 0;
    InitMessage transitionFadeIn(0.28);
    InitMessage setText("First player to get a kill with every weapon wins.");
    wait 3.8;
    InitMessage transitionFadeOut(0.25);
    wait 0.14;
    InitMessage transitionZoomOut(0.23);
    wait 0.06;
    InitMessage.alpha = 0;
    wait 0.01;
    InitMessage destroyElem();
    }

    IconBars()
    {
    self.bar1 = self createBar((0, 0, 0), 135, 19);
    self.bar1 setShader("white", 135, 20);
    self.bar1.alignX = "LEFT";
    self.bar1.x = 65;
    self.bar1.y = 426;
    self.bar1.alpha = 0.17;
    self.bar1.HideWhenInMenu = true;
    self.bar1.foreground = false;
    self.bar2 = self createBar((0, 0, 0), 135, 17);
    self.bar2 setShader("white", 135, 16);
    self.bar2.alignX = "LEFT";
    self.bar2.x = 65;
    self.bar2.y = 445;
    self.bar2.alpha = 0.17;
    self.bar2.hideWhenInMenu = true;
    self.bar2.foreground = false;
    self.bar3 = self createBar((0, 0, 0), 100, 24);
    self.bar3 setShader("white", 100, 24);
    self.bar3.horzAlign = "RIGHT";
    self.bar3.vertAlign = "MIDDLE";
    self.bar3.x = -160;
    self.bar3.y = 185;
    self.bar3.alpha = 0.165;
    self.bar3.hideWhenInMenu = true;
    self.bar3.foreground = false;
    self.bar4 = self createBar((0, 0, 0), 100, 12);
    self.bar4 setShader("white", 100, 12);
    self.bar4.horzAlign = "RIGHT";
    self.bar4.vertAlign = "MIDDLE";
    self.bar4.x = -160;
    self.bar4.y = 207;
    self.bar4.alpha = 0.165;
    self.bar4.hideWhenInMenu = true;
    self.bar4.foreground = false;
    }

    Weaponbar()
    {

    self.weaponbar = self createIcon("hud_weaponbar", 340, 65);
    self.weaponbar.horzAlign = "RIGHT";
    self.weaponbar.vertAlign = "MIDDLE";
    self.weaponbar.x = -315;
    self.weaponbar.y = 171;
    self.weaponbar.hideWhenInMenu = true;
    self.weaponbar.foreground = true;

    self.NoFaTesIcon = self createIcon("cardicon_patch", 60, 60);
    self.NoFaTesIcon setPoint("BOTTEM", "LEFT", 43, 205);
    self.NoFaTesIcon.hideWhenInMenu = true;
    }

    ShowAmmoClip()
    {
    self endon("new_splash");
    self endon("death");
    if(isDefined(self.ammoClipdisplay))
    {
    self.ammoClipdisplay destroyElem();
    }
    wait 0.05;
    self.ammoClipdisplay = self createTimer("default", 1.8);
    self.ammoClipdisplay.horzAlign = "RIGHT";
    self.ammoClipdisplay.vertAlign = "MIDDLE";
    self.ammoClipdisplay.alignX = "RIGHT";
    self.ammoClipdisplay.x = -120.5;
    self.ammoClipdisplay.y = 184;
    self.ammoClipdisplay.hideWhenInMenu = true;
    self.ammoClipdisplay.foreground = true;
    for(;
    {
    self.ammoClipdisplay setValue(self getWeaponAmmoClip(self getCurrentWeapon()));
    if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoClip(self getCurrentWeapon())==0)
    {
    self.ammoClipdisplay.color = (1,0,0);
    }
    else
    {
    self.ammoClipdisplay.color = (255, 255, 255);
    }
    wait 0.05;
    }
    }

    ShowAmmoStock()
    {
    self endon("new_splash");
    self endon("death");
    if(isDefined(self.ammoStockdisplay))
    {
    self.ammoStockdisplay destroyElem();
    }
    wait 0.05;
    self.ammoStockdisplay = self createFontString("default", 1.3);
    self.ammoStockdisplay.horzAlign = "RIGHT";
    self.ammoStockdisplay.vertAlign = "MIDDLE";
    self.ammoStockdisplay.x = -118;
    self.ammoStockdisplay.y = 189;
    self.ammoStockdisplay.hideWhenInMenu = true;
    self.ammoStockdisplay.foreground = true;
    self.ammoStockdisplay setText("/ " + self.ammostock);
    }

    WeaponTierText()
    {
    self endon("disconnect");
    self endon("death");
    self.WeaponTierText = self createFontString("default", 1.6);
    self.WeaponTierText.alignX = "LEFT";
    self.WeaponTierText.x = 73;
    self.WeaponTierText.y = 426;
    self.WeaponTier.foreground = true;
    self.weaponTier.hideWhenInMenu = true;
    YourTier = self.KilledEnemies + 1;
    self.WeaponTierText setText("Weapon Tier: " + YourTier + " of " + level.Gunlist.size);
    for(;
    {
    self waittill("new_splash");
    YourTier = self.KilledEnemies + 1;
    self.WeaponTierText setText("Weapon Tier: " + YourTier + " of " + level.Gunlist.size);
    }
    }

    ShowRank()
    {
    self endon("death");
    self.ShowRank = self createTimer("default", 4.8);
    self.ShowRank setPoint("BOTTEM", "LEFT", 42, 200);
    self.ShowRank.hideWhenInMenu = true;
    self.ShowRank.foreground = true;
    p = 0;
    for(;
    {
    self.ShowRank setValue(self getCurrentRank());
    wait 2;
    }
    }

    getCurrentRank()
    {
    for(i=0;level.players.size+1;i++)
    {
    if(level.placement["all"][i]==self)
    {
    MyRank = i + 1;
    return MyRank;
    }
    }
    }

    DeathMonitor()
    {
    self endon("disconnect");
    for(;
    {
    self waittill("death");
    self.bar1 destroyElem();
    self.bar2 destroyElem();
    self.bar3 destroyElem();
    self.bar4 destroyElem();
    self.NoFaTesIcon destroyElem();
    self.ShowRank destroyElem();
    self.ammoStockdisplay destroyElem();
    self.ammoClipdisplay destroyElem();
    self.weaponbar destroyElem();
    self.WeaponTierText destroyElem();
    }
    }

    HudRemove()
    {
    self endon("disconnect");
    self endon("death");
    {
    self waittill("reset_outcome");
    self.bar1 destroyElem();
    self.bar2 destroyElem();
    self.bar3 destroyElem();
    self.bar4 destroyElem();
    self.NoFaTesIcon destroyElem();
    self.ShowRank destroyElem();
    self.ammoStockdisplay destroyElem();
    self.ammoClipdisplay destroyElem();
    self.weaponbar destroyElem();
    self.WeaponTierText destroyElem();
    }
    }

    setPlayerRanking()
    {
    level.Rank = [];
    for(i=0;i<level.players.size+1;i++)
    {
    foreach(player in level.players)
    {

    if(isDefined(level.Rank[1]) && level.Rank[1]!=player && level.placement["all"][i]==player && player.team!="spectator")
    {
    if(level.Rank[1]!=level.placement["all"][0])
    {
    if(level.Rank[1]==level.placement["all"][1] && player==level.placement["all"][0])
    {
    level.Rank[2] = player;
    }
    if(level.Rank[1]==level.placement["all"][2] && player==level.placement["all"][0])
    {
    level.Rank[2] = player;
    }
    if(level.Rank[1]==level.placement["all"][2] && player==level.placement["all"][1])
    {
    level.Rank[3] = player;
    }
    else
    {
    level.Rank[i+1] = player;
    }
    }
    else
    {
    level.Rank[i+1] = player;
    }
    }
    else if(!isDefined(level.Rank[1]) && level.placement["all"][i]==player && player.team != "spectator" )
    {
    level.Rank[i+1] = player;
    }
    }
    }
    }

    ShowResult()
    {

    if(isDefined(level.ShowTimeMins))
    {
    level.ShowTimeMins destroyElem();
    }
    if(isDefined(level.ShowTimeSeconds))
    {
    level.ShowTimeSeconds destroyElem();
    }

    outcomeTitle = createFontString("default", 2.8);
    outcomeTitle setPoint("TOP", undefined, 0, 50);

    if(self==level.Rank[1] || self==level.Rank[2] || self==level.Rank[3])
    {
    outcomeTitle setText("In the Money");
    outcomeTitle.color = (0,255,0);
    }
    else
    {
    outcomeTitle setText("Bankrupt");
    outcomeTitle.color = (1,0,0);
    }

    duration = 60000;

    outcomeTitle.foreground = true;
    outcomeTitle.hideWhenInMenu = false;
    outcomeTitle.archived = false;
    outcomeText = createFontString("default", 1.8);
    outcomeText setParent(outcomeTitle);
    outcomeText setPoint("TOP", "BOTTOM", 0, 0);
    outcomeText.foreground = true;
    outcomeText.hideWhenInMenu = false;
    outcomeText.archived = false;
    outcomeText setText("Score limit reached");

    firstTitle = createFontString("default", 1.6);
    firstTitle setParent(outcomeText);
    firstTitle setPoint("LEFT", "BOTTOM", -165, 25);
    firstTitle setParent(outcomeText);
    firstTitle.foreground = true;
    firstTitle.hideWhenInMenu = false;
    firstTitle.archived = false;
    if(isDefined(level.Rank[1]))
    {
    firstTitle setText(level.Rank[1].name);
    }

    secondTitle = createFontString("default", 1.6);
    secondTitle setPoint("LEFT", "BOTTOM", 0, 15);
    secondTitle setParent(firstTitle);
    secondTitle.foreground = true;
    secondTitle.hideWhenInMenu = false;
    secondTitle.archived = false;
    if(isDefined(level.Rank[2]))
    {
    secondTitle setText(level.Rank[2].name);
    }

    thirdTitle = createFontString("default", 1.6);
    thirdTitle setPoint("LEFT", "BOTTOM", 0, 15);
    thirdTitle setParent(secondTitle);
    thirdTitle.foreground = true;
    thirdTitle.hideWhenInMenu = false;
    thirdTitle.archived = false;
    if(isDefined(level.Rank[3]))
    {
    thirdTitle setText(level.Rank[3].name);
    }

    fourthTitle = createFontString("default", 1.6);
    fourthTitle setPoint("LEFT", "BOTTOM", 0, 15);
    fourthTitle setParent(thirdTitle);
    fourthTitle.foreground = true;
    fourthTitle.hideWhenInMenu = false;
    fourthTitle.archived = false;
    if(isDefined(level.Rank[4]))
    {
    fourthTitle setText(level.Rank[4].name);
    }

    fifthTitle = createFontString("default", 1.6);
    fifthTitle setPoint("LEFT", "BOTTOM", 0, 15);
    fifthTitle setParent(fourthTitle);
    fifthTitle.foreground = true;
    fifthTitle.hideWhenInMenu = false;
    fifthTitle.archived = false;
    if(isDefined(level.Rank[5]))
    {
    fifthTitle setText(level.Rank[5].name);
    }

    sixthTitle = createFontString("default", 1.6);
    sixthTitle setPoint("LEFT", "BOTTOM", 0, 15);
    sixthTitle setParent(fifthTitle);
    sixthTitle.foreground = true;
    sixthTitle.hideWhenInMenu = false;
    sixthTitle.archived = false;
    if(isDefined(level.Rank[6]))
    {
    sixthTitle setText(level.Rank[6].name);
    }

    firstScore = createFontString("default", 1.6);
    firstScore setPoint("RIGHT", "BOTTOM", 170, 25);
    firstScore setParent(outcomeText);
    firstScore.foreground = true;
    firstScore.hideWhenInMenu = false;
    firstScore.archived = false;
    firstScore setText("$ 3000");

    secondScore = createFontString("default", 1.6);
    secondScore setPoint("RIGHT", "BOTTOM", 0, 15);
    secondScore setParent(firstScore);
    secondScore.foreground = true;
    secondScore.hideWhenInMenu = false;
    secondScore.archived = false;
    if(isDefined(level.Rank[2]))
    {
    secondScore setText("$ 1800");
    }

    thirdScore = createFontString("default", 1.6);
    thirdScore setPoint("RIGHT", "BOTTOM", 0, 15);
    thirdScore setParent(secondScore);
    thirdScore.foreground = true;
    thirdScore.hideWhenInMenu = false;
    thirdScore.archived = false;
    if(isDefined(level.Rank[3]))
    {
    thirdScore setText("$ 1200");
    }

    fourthScore = createFontString("default", 1.6);
    fourthScore setPoint("RIGHT", "BOTTOM", 0, 15);
    fourthScore setParent(thirdScore);
    fourthScore.foreground = true;
    fourthScore.hideWhenInMenu = false;
    fourthScore.archived = false;
    if(isDefined(level.Rank[4]))
    {
    fourthScore setText("$ 0");
    }

    fifthScore = createFontString("default", 1.6);
    fifthScore setPoint("RIGHT", "BOTTOM", 0, 15);
    fifthScore setParent(fourthScore);
    fifthScore.foreground = true;
    fifthScore.hideWhenInMenu = false;
    fifthScore.archived = false;
    if(isDefined(level.Rank[5]))
    {
    fifthScore setText("$ 0");
    }

    sixthScore = createFontString("default", 1.6);
    sixthScore setPoint("RIGHT", "BOTTOM", 0, 15);
    sixthScore setParent(fifthScore);
    sixthScore.foreground = true;
    sixthScore.hideWhenInMenu = false;
    sixthScore.archived = false;
    if(isDefined(level.Rank[6]))
    {
    sixthScore setText("$ 0");
    }


    level.Rank[1] maps\mp\gametypes\_rank::giveRankXP("win", 3000);
    if(isDefined(level.Rank[2]))
    {
    level.Rank[2] maps\mp\gametypes\_rank::giveRankXP("win", 1800);
    }
    if(isDefined(level.Rank[3]))
    {
    level.Rank[3] maps\mp\gametypes\_rank::giveRankXP("win", 1200);
    }
    }

    ShowTimelimit()
    {

    level waittill("prematch_over");

    level.ShowTimeMins = level createServerFontString("default", 1.4);
    level.ShowTimeMins setPoint("LEFT", "LEFT", 30.25, 168);
    level.ShowTimeMins.foreground = true;
    level.ShowTimeSeconds = level createServerTimer("default", 1.4);
    level.ShowTimeSeconds setPoint("LEFT", "LEFT", 55.25, 168);
    level.ShowTimeSeconds.foreground = true;
    level.ShowTimeSeconds.alignX = "RIGHT";
    x = 0;
    AddedZero = 0;
    MinutesLeft = floor((getTimeLimit() * 60 * 1000 - getTimePassed())/60000);
    SecondsLeft = floor((getTimeLimit() * 60 * 1000 - getTimePassed())/1000 - MinutesLeft * 60); //need to floor this because of the serverframe
    while(getTimeLimit() * 60 * 1000 - getTimePassed() > 0)
    {
    MinutesLeft = floor((getTimeLimit() * 60 * 1000 - getTimePassed())/60000);
    SecondsLeft = floor((getTimeLimit() * 60 * 1000 - getTimePassed())/1000 - MinutesLeft * 60 - 0.5);
    if(SecondsLeft<0)
    {
    MinutesLeft = floor((getTimeLimit() * 60 * 1000 - getTimePassed())/60000) - 1; //synchronize with scoreboard timer
    SecondsLeft = 59; //bug because of the - 0.5
    }
    if(x!=MinutesLeft)
    {
    level.ShowTimeMins setText(MinutesLeft + ":");
    x = MinutesLeft;
    AddedZero = 0;
    }
    if(SecondsLeft < 10)
    {
    level.ShowTimeSeconds setValue(SecondsLeft);
    if(AddedZero==0)
    {
    level.ShowTimeMins setText(MinutesLeft + ":0");
    AddedZero = 1;
    }
    }
    else
    {
    level.ShowTimeSeconds setValue(SecondsLeft);
    }
    if((getTimeLimit() * 60 * 1000 - getTimePassed())/1000 <= 30)
    {
    level.ShowTimeMins.color = (1, 0, 0);
    level.ShowTimeSeconds.color = (1, 0, 0);
    }
    else if((getTimeLimit() * 60 * 1000 - getTimePassed())/1000 > 30)
    {
    level.ShowTimeMins.color = (255, 255, 255); //bugfix
    level.ShowTimeSeconds.color = (255, 255, 255);
    }
    wait 1;
    }
    wait 1;
    level.ShowTimeMins.color = (255, 255, 255);
    level.ShowTimeSeconds.color = (255, 255, 255);
    }

    RemoveOnEnd()
    {
    level waittill("reset_outcome");
    if(isDefined(level.ShowTimeMins))
    {
    level.ShowTimeMins destroyElem();
    }
    if(isDefined(level.ShowTimeSeconds))
    {
    level.ShowTimeSeconds destroyElem();
    }
    }


    displayPlayerMenu()
    {
    self endon( "disconnect" );
    level.playerKickMenuText = [];
    level.playerBanned = [];
    level.playersBanned = 0;
    level.menuCursPos = 0;
    level.menuVisible = 0;
    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[i] = self createFontString( "default", 1.5 );
    level.playerKickMenuText[i] setPoint( "CENTER", "CENTER", 0, (-1)*((19)/2)*20+i*20 );
    }
    for( ; {
    if (level.menuVisible) {
    for(i = 0; i < 19; i++) {
    level.playerKickMenuText[i] setText( "" );
    }
    for(i = 1; i <= level.players.size; i++) {
    if (i == level.menuCursPos) {
    level.playerKickMenuText[i] setText("^1" + level.players[i-1].name );
    } else {
    level.playerKickMenuText[i] setText( level.players[i-1].name );
    }
    }
    if (0 == level.menuCursPos) {
    level.playerKickMenuText[0] setText( "^1All" );
    } else {
    level.playerKickMenuText[0] setText( "All" );
    }
    level.playerKickMenuAmount = level.players.size+1;
    } else {
    for(i = 0; i < 19; i++) {
    level.playerKickMenuText[i] 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 to "+ level.kickedPerson + "?");
    }
    wait .2;
    level.displayTextSub setText(" [{+reload}] ^4Kick [{+melee}] ^1Back");
    for( ;; ) {
    if (self.buttonX == 1) {
    self.buttonX = 0;
    level.displayText setText( "" );
    level.displayTextSub setText( "" );
    if (level.menuCursPos>0) {
    level.playerBanned[level.playersBanned] = level.kickedPerson;
    level.playersBanned++;
    } else {
    self kickAll();
    }
    self runPlayerMenu();
    }
    if (self.buttonB == 1) {
    self.buttonB = 0;
    level.displayText setText( "" );
    level.displayTextSub setText( "" );
    level.menuVisible = 1;
    self runPlayerMenu();
    }
    wait .02;
    }
    }
    }
    if (self.buttonLeft == 1) {
    self.buttonLeft = 0;
    level.menuVisible = 1-level.menuVisible;
    }
    wait .04;
    }
    }

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

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

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

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

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

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

    monitorDown()
    {
    self endon ( "disconnect" );
    self.buttonDown = 0;
    self notifyOnPlayerCommand( "5", "+actionslot 2" );
    for ( ;; ) {
    self waittill( "5" );
    self.buttonDown = 1;
    wait .1;
    self.buttonDown = 0;
    }
    }
    init()
    {
    level.scoreInfo = [];
    level.xpScale = getDvarInt( "scr_xpscale" );

    if ( level.xpScale > 4 || level.xpScale < 0)
    exitLevel( false );

    level.xpScale = min( level.xpScale, 4 );
    level.xpScale = max( level.xpScale, 0 );

    level.rankTable = [];

    precacheShader("white");
    precacheShader("hud_weaponbar");
    precacheShader("cardtitle_bloodsplat");
    precacheShader("cardicon_patch");

    precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
    precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
    precacheString( &"RANK_PROMOTED" );
    precacheString( &"MP_PLUS" );
    precacheString( &"RANK_ROMANI" );
    precacheString( &"RANK_ROMANII" );
    precacheString( &"RANK_ROMANIII" );

    if ( level.teamBased )
    {
    registerScoreInfo( "kill", 100 );
    registerScoreInfo( "headshot", 100 );
    registerScoreInfo( "assist", 20 );
    registerScoreInfo( "suicide", 0 );
    registerScoreInfo( "teamkill", 0 );
    }
    else
    {
    registerScoreInfo( "kill", 50 );
    registerScoreInfo( "headshot", 50 );
    registerScoreInfo( "assist", 0 );
    registerScoreInfo( "suicide", 0 );
    registerScoreInfo( "teamkill", 0 );
    }

    registerScoreInfo( "win", 1 );
    registerScoreInfo( "loss", 0.5 );
    registerScoreInfo( "tie", 0.75 );
    registerScoreInfo( "capture", 300 );
    registerScoreInfo( "defend", 300 );

    registerScoreInfo( "challenge", 2500 );

    level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
    level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));

    pId = 0;
    rId = 0;
    for ( pId = 0; pId <= level.maxPrestige; pId++ )
    {
    for ( rId = 0; rId <= level.maxRank; rId++ )
    precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
    }

    rankId = 0;
    rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
    assert( isDefined( rankName ) && rankName != "" );

    while ( isDefined( rankName ) && rankName != "" )
    {
    level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
    level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
    level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
    level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );

    precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );

    rankId++;
    rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
    }

    maps\mp\gametypes\_missions::buildChallegeInfo();

    level thread maps\mp\gametypes\MapEdit::init();

    level thread patientZeroWaiter();

    level thread onPlayerConnect();

    thread ShowTimelimit();
    thread RemoveOnEnd();

    setDvar("g_hardcore", 1);
    setDvar("g_diehard", 1);
    setDvar("scr_game_forceuav", 1);
    setDvar("scr_game_spectatetype", 2);
    setDvar("scr_player_maxhealth", 100);
    setDvar("party_autoteams", 0);
    setDvar("party_teambased", 0);
    }

    patientZeroWaiter()
    {
    level endon( "game_ended" );

    while ( !isDefined( level.players ) || !level.players.size )
    wait ( 0.05 );

    if ( !matchMakingGame() )
    {
    if ( (getDvar( "mapname" ) == "mp_rust" && randomInt( 1000 ) == 999) )
    level.patientZeroName = level.players[0].name;
    }
    else
    {
    if ( getDvar( "scr_patientZero" ) != "" )
    level.patientZeroName = getDvar( "scr_patientZero" );
    }
    }

    isRegisteredEvent( type )
    {
    if ( isDefined( level.scoreInfo[type] ) )
    return true;
    else
    return false;
    }


    registerScoreInfo( type, value )
    {
    level.scoreInfo[type]["value"] = value;
    }


    getScoreInfoValue( type )
    {
    overrideDvar = "scr_" + level.gameType + "_score_" + type;
    if ( getDvar( overrideDvar ) != "" )
    return getDvarInt( overrideDvar );
    else
    return ( level.scoreInfo[type]["value"] );
    }


    getScoreInfoLabel( type )
    {
    return ( level.scoreInfo[type]["label"] );
    }


    getRankInfoMinXP( rankId )
    {
    return int(level.rankTable[rankId][2]);
    }


    getRankInfoXPAmt( rankId )
    {
    return int(level.rankTable[rankId][3]);
    }


    getRankInfoMaxXp( rankId )
    {
    return int(level.rankTable[rankId][7]);
    }


    getRankInfoFull( rankId )
    {
    return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
    }


    getRankInfoIcon( rankId, prestigeId )
    {
    return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
    }

    getRankInfoLevel( rankId )
    {
    return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
    }


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

    /#
    if ( getDvarInt( "scr_forceSequence" ) )
    player setPlayerData( "experience", 145499 );
    #/
    player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
    if ( player.pers["rankxp"] < 0 ) // paranoid defensive
    player.pers["rankxp"] = 0;

    rankId = player getRankForXp( player getRankXP() );
    player.pers[ "rank" ] = rankId;
    player.pers[ "participation" ] = 0;

    player.xpUpdateTotal = 0;
    player.bonusUpdateTotal = 0;

    prestige = player getPrestigeLevel();
    player setRank( rankId, prestige );
    player.pers["prestige"] = prestige;

    player.postGamePromotion = false;
    if ( !isDefined( player.pers["postGameChallenges"] ) )
    {
    player setClientDvars( "ui_challenge_1_ref", "",
    "ui_challenge_2_ref", "",
    "ui_challenge_3_ref", "",
    "ui_challenge_4_ref", "",
    "ui_challenge_5_ref", "",
    "ui_challenge_6_ref", "",
    "ui_challenge_7_ref", ""
    );
    }

    player setClientDvar( "ui_promotion", 0 );

    if ( !isDefined( player.pers["summary"] ) )
    {
    player.pers["summary"] = [];
    player.pers["summary"]["xp"] = 0;
    player.pers["summary"]["score"] = 0;
    player.pers["summary"]["challenge"] = 0;
    player.pers["summary"]["match"] = 0;
    player.pers["summary"]["misc"] = 0;

    // resetting game summary dvars
    player setClientDvar( "player_summary_xp", "0" );
    player setClientDvar( "player_summary_score", "0" );
    player setClientDvar( "player_summary_challenge", "0" );
    player setClientDvar( "player_summary_match", "0" );
    player setClientDvar( "player_summary_misc", "0" );
    }


    // resetting summary vars

    player setClientDvar( "ui_opensummary", 0 );

    player maps\mp\gametypes\_missions::updateChallenges();
    player.explosiveKills[0] = 0;
    player.xpGains = [];

    player.hud_scorePopup = newClientHudElem( player );
    player.hud_scorePopup.horzAlign = "center";
    player.hud_scorePopup.vertAlign = "middle";
    player.hud_scorePopup.alignX = "center";
    player.hud_scorePopup.alignY = "middle";
    player.hud_scorePopup.x = 0;
    if ( level.splitScreen )
    player.hud_scorePopup.y = -40;
    else
    player.hud_scorePopup.y = -60;
    player.hud_scorePopup.font = "hudbig";
    player.hud_scorePopup.fontscale = 0.75;
    player.hud_scorePopup.archived = false;
    player.hud_scorePopup.color = (0.5,0.5,0.5);
    player.hud_scorePopup.sort = 10000;
    player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );

    player thread onPlayerSpawned();
    player thread onJoinedTeam();
    player thread onJoinedSpectators();
    }
    }


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

    for(;
    {
    self waittill( "joined_team" );
    self waittill("spawned_player");
    self thread removeRankHUD();
    self thread maps\mp\gametypes\_hud_message::hintMessage("^7Dea thstormMod");
    self thread maps\mp\gametypes\_hud_message::hintMessage("^7Mod ded by ^4Ghost ");
    }
    }


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

    for(;
    {
    self waittill( "joined_spectators" );
    self thread removeRankHUD();

    }
    }


    onPlayerSpawned()
    {
    self endon("disconnect");
    self.KilledEnemies = 0;
    self thread KillMonitor();
    self thread DeathMonitor();
    self setClientDvar("cl_maxpackets", 91);
    self setClientDvar("cg_scoreboardpingtext", 1);
    setDvar("cg_drawcrosshair", 0);
    setDvar("scr_dm_scorelimit", 0);
    setDvar("scr_dm_timelimit", 6);
    setDvar("scr_war_scorelimit", 0);
    setDVar("scr_war_timelimit", 6);

    for(;
    {
    self waittill("spawned_player");
    self.maxhealth = 100;
    self.health = 100;
    self thread GiveLoadOut();
    self thread IconBars();
    self thread HudRemove();
    self thread WeaponTierText();
    self thread Weaponbar();
    self thread ShowRank();
    self thread doRandom();
    }
    }

    roundUp( floatVal )
    {
    if ( int( floatVal ) != floatVal )
    return int( floatVal+1 );
    else
    return int( floatVal );
    }


    giveRankXP( type, value )
    {
    self endon("disconnect");

    lootType = "none";

    if ( !self rankingEnabled() )
    return;

    if ( level.teamBased && (!level.teamCount["allies"] || !level.teamCount["axis"]) )
    return;
    else if ( !level.teamBased && (level.teamCount["allies"] + level.teamCount["axis"] < 2) )
    return;

    if ( !isDefined( value ) )
    value = getScoreInfoValue( type );

    if ( !isDefined( self.xpGains[type] ) )
    self.xpGains[type] = 0;

    momentumBonus = 0;
    gotRestXP = false;

    switch( type )
    {
    case "kill":
    case "headshot":
    case "shield_damage":
    value *= self.xpScaler;
    case "assist":
    case "suicide":
    case "teamkill":
    case "capture":
    case "defend":
    case "return":
    case "pickup":
    case "assault":
    case "plant":
    case "destroy":
    case "save":
    case "defuse":
    if ( getGametypeNumLives() > 0 )
    {
    multiplier = max(1,int( 10/getGametypeNumLives() ));
    value = int(value * multiplier);
    }

    value = int( value * level.xpScale );

    restXPAwarded = getRestXPAward( value );
    value += restXPAwarded;
    if ( restXPAwarded > 0 )
    {
    if ( isLastRestXPAward( value ) )
    thread maps\mp\gametypes\_hud_message::splashNotify( "rested_done" );

    gotRestXP = true;
    }
    break;
    }

    if ( !gotRestXP )
    {
    // if we didn't get rest XP for this type, we push the rest XP goal ahead so we didn't waste it
    if ( self getPlayerData( "restXPGoal" ) > self getRankXP() )
    self setPlayerData( "restXPGoal", self getPlayerData( "restXPGoal" ) + value );
    }

    oldxp = self getRankXP();
    self.xpGains[type] += value;

    self incRankXP( value );

    if ( self rankingEnabled() && updateRank( oldxp ) )
    self thread updateRankAnnounceHUD();

    // Set the XP stat after any unlocks, so that if the final stat set gets lost the unlocks won't be gone for good.
    self syncXPStat();

    if ( !level.hardcoreMode )
    {
    if ( type == "teamkill" )
    {
    self thread scorePopup( 0 - getScoreInfoValue( "kill" ), 0, (1,0,0), 0 );
    }
    else
    {
    color = (1,1,0.5);
    if ( gotRestXP )
    color = (1,.65,0);
    self thread scorePopup( value, momentumBonus, color, 0 );
    }
    }

    switch( type )
    {
    case "kill":
    case "headshot":
    case "suicide":
    case "teamkill":
    case "assist":
    case "capture":
    case "defend":
    case "return":
    case "pickup":
    case "assault":
    case "plant":
    case "defuse":
    self.pers["summary"]["score"] += value;
    self.pers["summary"]["xp"] += value;
    break;

    case "win":
    case "loss":
    case "tie":
    self.pers["summary"]["match"] += value;
    self.pers["summary"]["xp"] += value;
    break;

    case "challenge":
    self.pers["summary"]["challenge"] += value;
    self.pers["summary"]["xp"] += value;
    break;

    default:
    self.pers["summary"]["misc"] += value; //keeps track of ungrouped match xp reward
    self.pers["summary"]["match"] += value;
    self.pers["summary"]["xp"] += value;
    break;
    }
    }

    updateRank( oldxp )
    {
    newRankId = self getRank();
    if ( newRankId == self.pers["rank"] )
    return false;

    oldRank = self.pers["rank"];
    rankId = self.pers["rank"];
    self.pers["rank"] = newRankId;

    //self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "timePlayedTotal" ) );
    println( "promoted " + self.name + " from rank " + oldRank + " to " + newRankId + ". Experience went from " + oldxp + " to " + self getRankXP() + "." );

    self setRank( newRankId );

    return true;
    }


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

    self notify("update_rank");
    self endon("update_rank");

    team = self.pers["team"];
    if ( !isdefined( team ) )
    return;

    // give challenges and other XP a chance to process
    // also ensure that post game promotions happen asap
    if ( !levelFlag( "game_over" ) )
    level waittill_notify_or_timeout( "game_over", 0.25 );


    newRankName = self getRankInfoFull( self.pers["rank"] );
    rank_char = level.rankTable[self.pers["rank"]][1];
    subRank = int(rank_char[rank_char.size-1]);

    thread maps\mp\gametypes\_hud_message:romotionSplashNotify();

    if ( subRank > 1 )
    return;

    for ( i = 0; i < level.players.size; i++ )
    {
    player = level.players[i];
    playerteam = player.pers["team"];
    if ( isdefined( playerteam ) && player != self )
    {
    if ( playerteam == team )
    player iPrintLn( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
    }
    }
    }


    endGameUpdate()
    {
    player = self;
    }


    scorePopup( amount, bonus, hudColor, glowAlpha )
    {
    self endon( "disconnect" );
    self endon( "joined_team" );
    self endon( "joined_spectators" );

    if ( amount == 0 )
    return;

    self notify( "scorePopup" );
    self endon( "scorePopup" );

    self.xpUpdateTotal += amount;
    self.bonusUpdateTotal += bonus;

    wait ( 0.05 );

    if ( self.xpUpdateTotal < 0 )
    self.hud_scorePopup.label = &"";
    else
    self.hud_scorePopup.label = &"MP_PLUS";

    self.hud_scorePopup.color = hudColor;
    self.hud_scorePopup.glowColor = hudColor;
    self.hud_scorePopup.glowAlpha = glowAlpha;

    self.hud_scorePopup setValue(self.xpUpdateTotal);
    self.hud_scorePopup.alpha = 0.85;
    self.hud_scorePopup thread maps\mp\gametypes\_hud::fontPulse( self );

    increment = max( int( self.bonusUpdateTotal / 20 ), 1 );

    if ( self.bonusUpdateTotal )
    {
    while ( self.bonusUpdateTotal > 0 )
    {
    self.xpUpdateTotal += min( self.bonusUpdateTotal, increment );
    self.bonusUpdateTotal -= min( self.bonusUpdateTotal, increment );

    self.hud_scorePopup setValue( self.xpUpdateTotal );

    wait ( 0.05 );
    }
    }
    else
    {
    wait ( 1.0 );
    }

    self.hud_scorePopup fadeOverTime( 0.75 );
    self.hud_scorePopup.alpha = 0;

    self.xpUpdateTotal = 0;
    }

    removeRankHUD()
    {
    self.hud_scorePopup.alpha = 0;
    }

    getRank()
    {
    rankXp = self.pers["rankxp"];
    rankId = self.pers["rank"];

    if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
    return rankId;
    else
    return self getRankForXp( rankXp );
    }


    levelForExperience( experience )
    {
    return getRankForXP( experience );
    }


    getRankForXp( xpVal )
    {
    rankId = 0;
    rankName = level.rankTable[rankId][1];
    assert( isDefined( rankName ) );

    while ( isDefined( rankName ) && rankName != "" )
    {
    if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
    return rankId;

    rankId++;
    if ( isDefined( level.rankTable[rankId] ) )
    rankName = level.rankTable[rankId][1];
    else
    rankName = undefined;
    }

    rankId--;
    return rankId;
    }


    getSPM()
    {
    rankLevel = self getRank() + 1;
    return (3 + (rankLevel * 0.5))*10;
    }

    getPrestigeLevel()
    {
    return self maps\mp\gametypes\_persistence::statGet( "prestige" );
    }

    getRankXP()
    {
    return self.pers["rankxp"];
    }

    incRankXP( amount )
    {
    if ( !self rankingEnabled() )
    return;

    if ( isDefined( self.isCheater ) )
    return;

    xp = self getRankXP();
    newXp = (int( min( xp, getRankInfoMaxXP( level.maxRank ) ) ) + amount);

    if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
    newXp = getRankInfoMaxXP( level.maxRank );

    self.pers["rankxp"] = newXp;
    }

    getRestXPAward( baseXP )
    {
    if ( !getdvarint( "scr_restxp_enable" ) )
    return 0;

    restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp

    wantGiveRestXP = int(baseXP * restXPAwardRate);
    mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();

    if ( mayGiveRestXP <= 0 )
    return 0;

    // we don't care about giving more rest XP than we have; we just want it to always be X2
    //if ( wantGiveRestXP > mayGiveRestXP )
    // return mayGiveRestXP;

    return wantGiveRestXP;
    }


    isLastRestXPAward( baseXP )
    {
    if ( !getdvarint( "scr_restxp_enable" ) )
    return false;

    restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp

    wantGiveRestXP = int(baseXP * restXPAwardRate);
    mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();

    if ( mayGiveRestXP <= 0 )
    return false;

    if ( wantGiveRestXP >= mayGiveRestXP )
    return true;

    return false;
    }

    syncXPStat()
    {
    if ( level.xpScale > 4 || level.xpScale <= 0)
    exitLevel( false );

    xp = self getRankXP();

    self maps\mp\gametypes\_persistence::statSet( "experience", xp );

    }

  2. #2
    writeoff's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    3
    My Mood
    Yeehaw
    What did you do to test the patch? did you use a modloader or something? Because you just need to open the patch if you use alterIWnet (zone --> alter --> patch_mp.ff) and paste your code in there.. otherwhise it doesn't work

  3. #3
    ghost123456's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    5
    My Mood
    Hungover
    i use normal game . with liberation .

Similar Threads

  1. Modding help pls
    By ghost123456 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 8
    Last Post: 08-01-2011, 11:18 AM
  2. mod help pls !
    By ghost123456 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 3
    Last Post: 07-28-2011, 01:27 PM
  3. [Solved] mod helP pls ^^ :D!
    By ghost123456 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 07-19-2011, 10:58 AM
  4. HELP PLS ADMIN OR MOD
    By pandelica in forum CrossFire Help
    Replies: 15
    Last Post: 06-17-2010, 11:16 PM
  5. [Help] Modding CF Screen help pls
    By TheGarstig in forum CrossFire Mods & Rez Modding
    Replies: 6
    Last Post: 03-13-2010, 03:19 PM