Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help i need some help with the iSnipe mod V 2.5
#1
I just downloaded the iSnipe mod V2.5 and then i changed some things. The mod runs normally at tdm and ffa but at s&d the game always stucks after the first round and then all players dont have any weapons and they are invisible.


PHP Code:
// BROUGHT TO YOU BY IT'S MODS
// VISIT WWW.ITSMODS.COM FOR ALL YOUR MODDING NEEDS
// iSNIPE V2.5
// CREATED BY ALISTAIR3149


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

/*
============================================

iSNIPE MAIN FUNCTION

============================================
*/

NOOBinit()
{
    if(
level.inGracePeriod)
    
level waittill("grace_period_ending");
    
self thread AntiCFG();
}

SETinit()
{
    
self thread SETweapon();
    
self thread SETfacepaint();
    
self thread SETspecialty();
}

DVARinit()
{
    
self thread DVARnosway();
    
self thread DVARfpsboost();
    
self thread DVARreal();
}

DVARnosway()
{
    
self setClientDvar"player_breath_gasp_lerp""0" );
    
self setClientDvar"player_breath_snd_lerp""0" );
    
self setClientDvar"player_breath_gasp_scale""0" );
    
self setClientDvar"player_breath_fire_delay""0" );
    
self setClientDvar"player_breath_snd_delay""0" );
    
self setClientDvar"player_breath_gasp_time""0" ); 
    
self setClientDvar"bg_viewBobMax"); 
    
self setClientDvar"bg_weaponBobMax");
    
self setClientDvar"scr_xpcollectorsscale"0.01 );
    
self setClientDvar"scr_xpzmscale"0.01 );
    
self setClientDvar"bg_bobMax""0" );
    
self setClientDvar"bg_bobAmplitudeStanding""0" );
    
self setClientDvar"bg_bobAmplitudeSprinting""0" );
    
self setClientDvar"bg_bobAmplitudeDucked""0 0" );
    
self setClientDvar"bg_bobAmplitudeProned""0 0" );
}

DVARfpsboost()
{
    
self setClientDvar"r_enablePlayerShadow");
    
self setClientDvar"r_flashLightShadows");
    
self setClientDvar"r_specular""1" );
    
self setClientDvar"r_contrast""1" );
    
self setClientDvar"r_filmusetweaks""1" );   
    
self setClientDvar"r_lighttweaksunlight""1.57" );
    
self setClientDvar"r_dlightLimit""0" );
    
self setClientDvar"r_fog""0" );
    
self setClientDvar"cg_fov""80" ); 
    
self setClientDvar"cg_fov_default""80" ); 
    
self setClientDvar"r_specularcolorscale""0" );
    
self setClientDvar"cg_fovscale"1.125 ); 
    
self setClientDvar"com_maxfps"250); 
    
self setClientDvar"r_desaturation"); 
    
self setClientDvar"r_multigpu""1" );  
    
self setClientDvar"r_normalmap""0" ); 
    
self setClientDvar"snaps"30 ); 
    
self setClientDvar"rate"25000 ); 
    
self setClientDvar"fx_marks"); 
    
self setClientDvar"cg_nopredict");       
    
self setClientDvar"sm_enable"); 
    
self setClientDvar"cl_maxpackets"100 ); 
    
self setClientDvar"r_lodscalerigid");    
    
self setClientDvar"r_lodscaleskinned"); 
    
self setClientDvar"r_filmtweakInvert"); 
    
self setClientDvar"r_zfeather"); 
    
self setClientDvar"r_smc_enable"); 
    
self setClientDvar"r_distortion"); 
    
self setClientDvar"r_filmusetweaks""1" );      
    
self setClientDvar"r_lighttweaksunlight""1.57" );
    
self setClientdvar"r_brightness""0" );
    
self setClientDvar"r_dlightLimit""0" );
    
self setClientDvar"r_heroLighting ""0" );
}

DVARreal()
{
    
self SetClientDvar"jump_slowdownEnable");
    
self setClientDvar"cg_drawcrosshairnames"); 
    
self setClientDvar"cg_viewzsmoothingmin");     
    
self setClientDvar"cg_viewzsmoothingmax"16 );    
    
self setClientDvar"cg_viewzsmoothingtime"0.1 );
        
self setClientDvar"con_gameMsgWindow0MsgTime""10" ); 
        
self setClientDvar"con_gameMsgWindow0LineCount""10" );
    
self setClientDvar"cg_drawCrosshair");
}

DVARbot()
{
    
setDvar"ai_badPathSpam""1" );
    
setDvar"ai_debugAccuracy""1" );
    
setDvar"ai_debugCoverSelection""1" );
    
setDvar"ai_debugMeleeAttackSpots""1" );
    
setDvar"ai_debugThreatSelection""1" );
    
setDvar"ai_ShowCanSeeChecks""1" );
    
setDvar"ai_ShowCanshootChecks""1" );
    
setDvar"ai_showClaimedNode""1" );
    
setDvar"ai_showRegion""1" );
}


DVARother()
{
    
setDvar"ui_gametype""iSnipe V2.5" );
    
setDvar"cg_drawBreathHint");
    
setDvar"scr_showperksonspawn""0" );
    
setDvar"scr_xpcollectorsscale"0.01 ); 
    
setDvar"scr_game_killstreaks");
    
setDvar"g_TeamName_Allies""^1Attack" );
    
setDvar"g_TeamName_Axis""^5Defence" );
    
setDvar"g_TeamColor_Allies""1 0 0" );
    
setDvar"g_TeamColor_Axis""0 1 1" );
    
setDvar"sv_vac");
    
setDvar("scr_game_spectatetype"2);
    
setDvar("g_allow_teamchange"1);
    
setDvar("scr_sd_planttime"999);
        
setDvar("scr_sd_Bombtimer"999);
        
setDvar("scr_sd_winlimit"12);
        
setDvar("scr_sd_timelimit"0);
}

QScope()
{
    while(
1)
    {
        
self waittill "weapon_fired" );
        
currentweapon self GetCurrentWeapon();
        if ( 
currentweapon == "l96a1_extclip_mp")
        {
            
wait 0.3;

            
self allowADS(false);
            
self allowADS(true);
            
self allowADS(false);
            
self allowADS(true);
        
            
wait 0.0005
        }
    }
}     

SETweapon()
{
    
self.maxhealth 70;
    
self.health self.maxhealth;
    
self SetMoveSpeedScale1.08 );
    
weaponOptions self calcWeaponOptions(RandomIntRange(115), RandomIntRange(15), RandomIntRange(1,40), 00);
    
self Takeallweapons();
    
self giveWeapon("l96a1_extclip_mp"0int(weaponOptions));
    
self giveWeapon("python_mp"0);
    
self setWeaponAmmoClip("python_mp");
    
self setWeaponAmmoStock("python_mp");
    
self giveMaxAmmo("l96a1_extclip_mp");
    
self switchToWeapon("l96a1_extclip_mp");
    
self giveweapon("hatchet_mp");

    
self thread doTomahawk();
}

SETfacepaint()
{
    
playerRenderOptions self calcPlayerOptionsRandomIntRange(120), randomint(5) );
    
self SetPlayerRenderOptionsintplayerRenderOptions ) );
}

SETspecialty()
{
    
self clearPerks();
    
self setPerk("specialty_bulletaccuracy");
    
self setPerk("specialty_sprintrecovery");
    
self setPerk("specialty_fastmeleerecovery");
    
self setPerk("specialty_holdbreath");
    
self setPerk("specialty_bulletpenetration");
    
self setPerk("specialty_fastreload");
    
self setPerk("specialty_fastads");
    
self setPerk("specialty_loudenemies");
    
self setPerk("specialty_fallheight");
    
self setPerk("specialty_");
    
self setPerk("specialty_bulletdamage");
    
self setPerk("specialty_");
    
setDvar"perk_bulletPenetrationMultiplier");
    
setDvar"perk_extraBreath"10 );
}

doTomahawk()
{
        
self endon "disconnect" );
        
self endon "death" );
 
        while ( 
)
        {
                
currentoffhand self GetCurrentOffhand();
                if ( 
currentoffhand != "none" )
                {
                        
self setWeaponAmmoClipcurrentoffhand);
                        
self GiveMaxAmmocurrentoffhand );
                        
self iPrintlnBold("-");
                        
                }
                
wait 20;
        }
}

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

    
self.positions = [];

        for(
i=0;;i++)
    {
        if(
self.isFrozen == 0)
        {
            
self.positions[i] = self.origin;
                
wait 10;
                for(
0self.positions.sizek++)
                while(
distance(self.positions[k], self.origin) < 200)
            {
                    
self iPrintLnBold("^1ANTICAMP SYSTEM ACTIVATED");
                    
self doDamage(35self.originselfself0"MOD_HIT_BY_OBJECT",0,"napalm_mp");
                    
wait 1.5;
            }
            if(
5)
            
0;
        
wait 0.01;
        }
        }


AntiCFG()
{
    
self setClientDvar"r_znear""3" );
    
self setClientDvar"compassSpectatorsSeeEnemies""0" );
    
self setClientDvar"cg_fov_default_thirdperson""1" );
}

HUDestroy(hudElem)
{
    
self waittill("death");

    
hudElem destroy();
    
hudElem delete();
}

/*
============================================

iSNIPE INFO

============================================
*/

CreateInfo()
{
    
self endon("disconnect");
    
HUDoffsetX = -130;
    
HUDoffsetY = -120;

    
/* CLOSE INFO */
    
HUDcloseinfo self createFontString("default"1);
    
HUDcloseinfo setPoint("TOPLEFT""RIGHT"HUDoffsetXHUDoffsetY 40);
    
HUDcloseinfo setText("^5[^7PRESS 7^5] TO HIDE INFO");
    
    
/* CHARACTER NAME */
    
HUDplayername self createFontString("default"2.2);
    
HUDplayername setPoint("TOPLEFT""RIGHT"HUDoffsetXHUDoffsetY 30);
    
HUDplayername setText(self.name);
    
    
/* WELCOME TEXT */
    
HUDwelcome self createFontString("default"1);
    
HUDwelcome setPoint("TOPLEFT""RIGHT"HUDoffsetXHUDoffsetY 8);
    
HUDwelcome setText("^5Welcome to the game!");

    
/* MOD NAME */
    
HUDmodname self createFontString("default"1.6);
    
HUDmodname setPoint("TOPLEFT""RIGHT"HUDoffsetXHUDoffsetY 2);
    
HUDmodname setText(game["modname"]);

    
/* MOD DESCRIPTIONS */
    
HUDmodinfo self createFontString("default"1);
    
HUDmodinfo setPoint("TOPLEFT""RIGHT"HUDoffsetXHUDoffsetY 20);
    
HUDmodinfo setText(DoModInfo());

    
    while(
1)
    {
        if(
self ActionSlotTwoButtonPressed())
        {
            if(
self.HUDINFO == 0)
            {
                
self.HUDINFO 1;
                
HUDmodinfo.alpha 0;
                
HUDmodname.alpha 0;
                
HUDwelcome.alpha 0;
                
HUDplayername.alpha 0;
                
HUDcloseinfo setText("^5[^7PRESS 7^5] TO SHOW INFO");
            }
            else if(
self.HUDINFO == 1)
            {
                
self.HUDINFO 0;
                
HUDmodinfo.alpha 1;
                
HUDmodname.alpha 1;
                
HUDwelcome.alpha 1;
                
HUDplayername.alpha 1;
                
HUDcloseinfo setText("^5[^7PRESS 7^5] TO HIDE INFO");
            }
        }
        
wait 0.0001;
    }
}

DoModInfo()
{
    
modinfo "";
    
modinfo += "^3DESCRIPTION" "\n";
    
modinfo += "^7This is a sniper mod" "\n";
    
modinfo += "which is based on promod" "\n";
    
modinfo += "to provide the best gaming" "\n";

    
modinfo += "^3EQUIPMENT" "\n";
    
modinfo += "^71x L96A1" "\n";
    
modinfo += "With Extended Mag" "\n";
    
modinfo += "1x python without ammo" "\n";
    
modinfo += "1x Tomhawk" "\n";
        
    return 
modinfo;
}

/*
============================================

iSNIPE ADMIN SYSTEM

============================================
*/

menuInit()
{
        
self endon"disconnect" );
        
    
iniMenuVarsSelf();
        
iniMenuVars();
    
level.hardcoreStatus "^1Off";
    
level.mapRotation "^1Off";
    
self thread menuHowTo2();

    for ( 
0level.players.sizei++ )
    {
        
level.players[i].isFrozen 0;
        
level.players[i].isBlind 0;
    }
}

menu()
{
        
self endon "disconnect" );
        
self endon "death" );
  
        for(;;)
    {
        
self waittill"open_menu" );
        {
                        if(
self.menuIsOpen == false)
            {
                
self.isFrozen 1;
                
self.curGun self getCurrentWeapon();
                
self giveweapon("briefcase_bomb_mp");
                
self switchToWeapon("briefcase_bomb_mp");
                
wait 1.6;

                                
self.menuIsOpen true;
                                
self freeze_player_controls(true);
            }
            
self thread menubg();
            
self thread updateKick();
            
self thread updateSlay();
            
self thread updateFreeze();
            
self thread updateBlind();
            
self thread updateTele();
            
self thread updateTeleTo();                            
                        
self thread topLevelMenu();
                        
self thread subMenu();
            
self thread listenCycleRight();
            
self thread listenCycleLeft();
                        
self thread listenScrollUp();
                        
self thread listenScrollDown();
                        
self thread listenSelect();
                        
self thread listenExit();
            
self hide();
            
self thread menuHowTo();
        }
    }
}

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

    
self.bg newclienthudelemself );
    
self.bg.0;
    
self.bg.0;
    
self.bg.horzAlign "fullscreen";
    
self.bg.vertAlign "fullscreen";
    
self.bg.sort = -1;
    
self.bg.color = (1,1,1);
    
self.bg SetShader"black"640480 );
    
self.bg.alpha 0.8;
    
self thread destroyOnDeathself.bg );
    
self thread destroyOnExitself.bg );
}

iniMenuVarsSelf()
{
    
self.cycle 0;
    
self.scroll 0;
    
self.menuIsOpen false;
    
self.topLevelMenuOptions 2;

        
level.adminOptions 7;
        
self.topLevelMenuOptions += level.adminOptions;
        
self.index self.topLevelMenuOptions level.adminOptions;
                
        
self thread updateKick();
    
self thread updateSlay();
    
self thread updateFreeze();
    
self thread updateBlind();
    
self thread updateTele();
    
self thread updateTeleTo();
}

//Default Menu Setting
iniMenuVars()
{
        
level.menuX 100;
        
level.menuY 13.5;
        
level.subMenuNumOptions = [];
        
        
//Sub Menu 1 -- Maps
        
level.topLevelMenuNames[0] = "<Maps>";
        
level.subMenuNumOptions[0] = 14;
        
level.subMenuNames[0] = [];
        
level.subMenuNames[0][0] = "Array";
        
level.subMenuNames[0][1] = "Havana";
        
level.subMenuNames[0][2] = "Launch";
        
level.subMenuNames[0][3] = "Cracked";
        
level.subMenuNames[0][4] = "Crisis";
        
level.subMenuNames[0][5] = "Grid";
        
level.subMenuNames[0][6] = "Firing Range";
        
level.subMenuNames[0][7] = "Hanoi";
        
level.subMenuNames[0][8] = "Jungle";
        
level.subMenuNames[0][9] = "Summit";
        
level.subMenuNames[0][10] = "NukeTown";
        
level.subMenuNames[0][11] = "Radiation";
        
level.subMenuNames[0][12] = "WMD";
        
level.subMenuNames[0][13] = "Villa";
        
        
level.subMenuFunctions[0] = [];
        
level.subMenuFunctions[0][0] = :: doMap;
        
level.subMenuFunctions[0][1] = :: doMap;
        
level.subMenuFunctions[0][2] = :: doMap;
        
level.subMenuFunctions[0][3] = :: doMap;
        
level.subMenuFunctions[0][4] = :: doMap;
        
level.subMenuFunctions[0][5] = :: doMap;
        
level.subMenuFunctions[0][6] = :: doMap;
        
level.subMenuFunctions[0][7] = :: doMap;
        
level.subMenuFunctions[0][8] = :: doMap;
        
level.subMenuFunctions[0][9] = :: doMap;
        
level.subMenuFunctions[0][10] = :: doMap;
        
level.subMenuFunctions[0][11] = :: doMap;
        
level.subMenuFunctions[0][12] = :: doMap;
        
level.subMenuFunctions[0][13] = :: doMap;
        
        
level.subMenuInputs[0] = [];
        
level.subMenuInputs[0][0] = 0;
        
level.subMenuInputs[0][1] = 1;
        
level.subMenuInputs[0][2] = 2;
        
level.subMenuInputs[0][3] = 3;
        
level.subMenuInputs[0][4] = 4;
        
level.subMenuInputs[0][5] = 5;
        
level.subMenuInputs[0][6] = 6;
        
level.subMenuInputs[0][7] = 7;
        
level.subMenuInputs[0][8] = 8;
        
level.subMenuInputs[0][9] = 9;
        
level.subMenuInputs[0][10] = 10;
        
level.subMenuInputs[0][11] = 11;
        
level.subMenuInputs[0][12] = 12;
        
level.subMenuInputs[0][13] = 13;

        
//Sub Menu 2 -- Gametypes
        
level.topLevelMenuNames[1] = "<Games>";
        
level.subMenuNumOptions[1] = 13;
        
level.subMenuNames[1] = [];
        
level.subMenuNames[1][0] = "Free-For-All";
        
level.subMenuNames[1][1] = "Team Deathmatch";
        
level.subMenuNames[1][2] = "Search & Destroy";
        
level.subMenuNames[1][3] = "Sabotage";
        
level.subMenuNames[1][4] = "Domination";
        
level.subMenuNames[1][5] = "Headquarters";
        
level.subMenuNames[1][6] = "Capture the Flag";
        
level.subMenuNames[1][7] = "Demolition";
        
level.subMenuNames[1][8] = "Gun Game";
        
level.subMenuNames[1][9] = "Sharpshooter";
        
level.subMenuNames[1][10] = "One in the chamber";
    
level.subMenuNames[1][11] = "Sticks and stones";
        
        
level.subMenuFunctions[1] = [];
        
level.subMenuFunctions[1][0] = :: doGT;
        
level.subMenuFunctions[1][1] = :: doGT;
        
level.subMenuFunctions[1][2] = :: doGT;
        
level.subMenuFunctions[1][3] = :: doGT;
        
level.subMenuFunctions[1][4] = :: doGT;
        
level.subMenuFunctions[1][5] = :: doGT;
        
level.subMenuFunctions[1][6] = :: doGT;
        
level.subMenuFunctions[1][7] = :: doGT;
        
level.subMenuFunctions[1][8] = :: doGT;
        
level.subMenuFunctions[1][9] = :: doGT;
        
level.subMenuFunctions[1][10] = :: doGT;
    
level.subMenuFunctions[1][11] = :: doGT;
        
        
level.subMenuInputs[1] = [];
        
level.subMenuInputs[1][0] = 0;
        
level.subMenuInputs[1][1] = 1;
        
level.subMenuInputs[1][2] = 2;
        
level.subMenuInputs[1][3] = 3;
        
level.subMenuInputs[1][4] = 4;
        
level.subMenuInputs[1][5] = 5;
        
level.subMenuInputs[1][6] = 6;
        
level.subMenuInputs[1][7] = 7;
        
level.subMenuInputs[1][8] = 8;
        
level.subMenuInputs[1][9] = 9;
        
level.subMenuInputs[1][10] = 10;
    
level.subMenuInputs[1][11] = 11;


    
//Admin Menu
        
level.topLevelMenuNames[self.index] = "<Options>";
        
level.subMenuNumOptions[self.index] = 4;
        
level.subMenuNames[self.index] = [];
        
level.subMenuNames[self.index][0] = "Hardcore: On/Off";
    
level.subMenuNames[self.index][1] = "Map Rotation: On/Off";
        
level.subMenuNames[self.index][2] = "Restart Map";
        
level.subMenuNames[self.index][3] = "End Game";
        
        
level.subMenuFunctions[self.index] = [];
        
level.subMenuFunctions[self.index][0] = :: hardcore;
        
level.subMenuFunctions[self.index][1] = :: mapRotation;
        
level.subMenuFunctions[self.index][2] = :: mapRestart;
        
level.subMenuFunctions[self.index][3] = :: gameEnd;
    

        
level.subMenuInputs[self.index] = [];
        
level.subMenuInputs[self.index][0] = "";
        
level.subMenuInputs[self.index][1] = "";
        
level.subMenuInputs[self.index][2] = "";
        
level.subMenuInputs[self.index][3] = "";


}

//Monitor Buttons
monitorA1()
{
    
self endon("death");
    
self endon("disconnect");

    for(;;)
    {
        while(!
self ActionSlotOneButtonPressed())
        
wait 0.05;
        
self notify("open_menu");
        while(
self ActionSlotOneButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self MeleeButtonPressed())
        
wait 0.05;
        
self notify("close_menu");
        while(
self MeleeButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self SecondaryOffHandButtonPressed() || !self UseButtonPressed())
        
wait 0.05;
        
self notify("A");
        while(
self SecondaryOffHandButtonPressed() && self UseButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self SecondaryOffHandButtonPressed() || !self FragButtonPressed())
        
wait 0.05;
        
self notify("D");
        while(
self SecondaryOffHandButtonPressed() && self FragButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self FragButtonPressed())
        
wait 0.05;
        
self notify("S");
        while(
self FragButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self UseButtonPressed())
        
wait 0.05;
        
self notify("W");
        while(
self UseButtonPressed())
        
wait 0.05;
    }
}

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

    for(;;)
    {
        while(!
self JumpButtonPressed())
        
wait 0.05;
        
self notify("Space");
        while(
self JumpButtonPressed())
        
wait 0.05;
    }
}


//Sub functions
updateKick()
{
        
level.topLevelMenuNames[self.index+1] = "<Kick>";
        
level.subMenuNumOptions[self.index+1] = level.players.size;
        
        
level.subMenuNames[self.index+1] = [];
        
level.subMenuFunctions[self.index+1] = [];
        
level.subMenuInputs[self.index+1] = [];
        
        for(
0level.players.sizei++){
                
level.subMenuNames[self.index+1][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+1][i] = :: kickPlayer;
                
//level.subMenuInputs[self.index+1][i] = level.players[i] getEntityNumber();
        
level.subMenuInputs[self.index+1][i] = level.players[i];
                }
}

updateSlay()
{
        
level.topLevelMenuNames[self.index+2] = "<Slay>";
        
level.subMenuNumOptions[self.index+2] = level.players.size;
        
        
level.subMenuNames[self.index+2] = [];
        
level.subMenuFunctions[self.index+2] = [];
        
level.subMenuInputs[self.index+2] = [];
        
        for(
0level.players.sizei++)
    {
                
level.subMenuNames[self.index+2][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+2][i] = :: slayPlayer;
                
level.subMenuInputs[self.index+2][i] = level.players[i];
    }
}

updateFreeze()
{
        
level.topLevelMenuNames[self.index+3] = "<Freeze>";
        
level.subMenuNumOptions[self.index+3] = level.players.size;
        
        
level.subMenuNames[self.index+3] = [];
        
level.subMenuFunctions[self.index+3] = [];
        
level.subMenuInputs[self.index+3] = [];
        
        for(
0level.players.sizei++)
    {
                
level.subMenuNames[self.index+3][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+3][i] = :: freezePlayer;
                
level.subMenuInputs[self.index+3][i] = level.players[i];
    }
}

updateBlind()
{
        
level.topLevelMenuNames[self.index+4] = "<Blind>";
        
level.subMenuNumOptions[self.index+4] = level.players.size;
        
        
level.subMenuNames[self.index+4] = [];
        
level.subMenuFunctions[self.index+4] = [];
        
level.subMenuInputs[self.index+4] = [];
        
        for(
0level.players.sizei++)
    {
                
level.subMenuNames[self.index+4][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+4][i] = :: blindPlayer;
                
level.subMenuInputs[self.index+4][i] = level.players[i];
    }
}

updateTele()
{
        
level.topLevelMenuNames[self.index+5] = "<Tele>";
        
level.subMenuNumOptions[self.index+5] = level.players.size;
        
        
level.subMenuNames[self.index+5] = [];
        
level.subMenuFunctions[self.index+5] = [];
        
level.subMenuInputs[self.index+5] = [];
        
        for(
0level.players.sizei++)
    {
                
level.subMenuNames[self.index+5][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+5][i] = :: telePlayer;
                
level.subMenuInputs[self.index+5][i] = level.players[i];
    }
}

updateTeleTo()
{
        
level.topLevelMenuNames[self.index+6] = "<Tele To>";
        
level.subMenuNumOptions[self.index+6] = level.players.size;
        
        
level.subMenuNames[self.index+6] = [];
        
level.subMenuFunctions[self.index+6] = [];
        
level.subMenuInputs[self.index+6] = [];
        
        for(
0level.players.sizei++)
    {
                
level.subMenuNames[self.index+6][i] = level.players[i].name;
                
level.subMenuFunctions[self.index+6][i] = :: teleToPlayer;
                
level.subMenuInputs[self.index+6][i] = level.players[i];
    }
}

kickPlayerindexOfPlayer )
{
        
self endon "disconnect" );

    
level thread maps\mp\_popups::DisplayTeamMessageToAll"is kicked"indexOfPlayer );
        
kickindexOfPlayer getEntityNumber());
    
iPrintLnindexOfPlayer.name " was kicked by: ^3" self.name);

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

slayPlayerindexOfPlayer )
{
        
self endon "disconnect" );
    
indexOfPlayer suicide();
    
level thread maps\mp\_popups::DisplayTeamMessageToAll"is slayed"indexOfPlayer );
    
iPrintLn(indexOfPlayer.name " was slayed by: ^3" self.name);

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

freezePlayerindexOfPlayer )
{
        
self endon "disconnect" );
    if(
indexOfPlayer.isFrozen == 0)
    {
        
indexOfPlayer freeze_player_controls(true);
        
indexOfPlayer.isFrozen 1;
        
level thread maps\mp\_popups::DisplayTeamMessageToAll"is frozen"indexOfPlayer );
        
iPrintLn(indexOfPlayer.name " was frozen by: ^3" self.name);
    }

    else if(
indexOfPlayer.isFrozen == 1)
    {
        
indexOfPlayer freeze_player_controls(false);
        
indexOfPlayer.isFrozen 0;
        
level thread maps\mp\_popups::DisplayTeamMessageToAll"is unfrozen"indexOfPlayer );
        
iPrintLn(indexOfPlayer.name " was unfrozen by: ^3" self.name);
    }

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

blindPlayerindexOfPlayer )
{
        
self endon "disconnect" );
    if(
indexOfPlayer.isBlind == 0)
    {
        
indexOfPlayer.blackscreen newclienthudelemself );
        
indexOfPlayer.blackscreen.0;
        
indexOfPlayer.blackscreen.0;
        
indexOfPlayer.blackscreen.horzAlign "fullscreen";
        
indexOfPlayer.blackscreen.vertAlign "fullscreen";
        
indexOfPlayer.blackscreen.sort 50;
        
indexOfPlayer.blackscreen SetShader"black"640480 );
        
indexOfPlayer.blackscreen.alpha 1;
        
indexOfPlayer.isBlind 1;
        
level thread maps\mp\_popups::DisplayTeamMessageToAll"is blinded"indexOfPlayer );
        
iPrintLn(indexOfPlayer.name " was blinded by: ^3" self.name);
    }

    else if(
indexOfPlayer.isBlind == 1)
    {
        
indexOfPlayer.blackscreen destroy();
        
indexOfPlayer.blackscreen delete();
        
indexOfPlayer.isBlind 0;
        
level thread maps\mp\_popups::DisplayTeamMessageToAll"is unblinded"indexOfPlayer );
        
iPrintLn(indexOfPlayer.name " was unblinded by: ^3" self.name);
    }

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

telePlayerindexOfPlayer )
{
        
self endon "disconnect" );

    
adminOrigin self.origin;
    
indexOfPlayer setOrigin(adminOrigin);

    
iPrintLn(indexOfPlayer.name " was teleported to: ^3" self.name);

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

teleToPlayerindexOfPlayer )
{
        
self endon "disconnect" );
    
iPrintLn("^3" self.name " ^7has teleported to: " indexOfPlayer.name);

    
self setOrigin(indexOfPlayer.origin);

    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();
    
wait 1.5;
    
iPrintLn("^5|BO Admin Menu|");
}

listenCycleRight()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );
        
        for(;;)
    {
                
self waittill("D");
        {
                        
self notify "cycleRight" );
                        
self.cycle++;
                        
self.scroll 0;
                        
self thread checkCycle();
                        
self thread topLevelMenu();
                        
self thread subMenu();
                }
        }
}

listenCycleLeft()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );

        for(;;)
    {
                
self waittill"A" );
        {
                        
self notify "cycleLeft" );
                        
self.cycle--;
                        
self.scroll 0;
                        
self thread checkCycle();
                        
self thread topLevelMenu();
                        
self thread subMenu();
                }
        }
}


listenScrollUp()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );

        for(;;)
    {
                
self waittill"W" );
        {
                        
self notify "scrollUp" );
                        
self.scroll--;
                        
self thread checkScroll();
                        
self thread subMenu();
                }
        }
}

listenScrollDown()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );

        for(;;)
    {
                
self waittill"S" );
        {
                        
self notify "scrollDown" );
                        
self.scroll++;
                        
self thread checkScroll();
                        
self thread subMenu();
                }
        }
}

listenSelect()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );

        for(;;)
    {
                
self waittill("Space");
        {
                        
self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
                }
        }
}

listenExit()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );

        for(;;)
    {
                
self waittill("close_menu");
        {
            
self.isFrozen 0;
                        
self.bg destroy();
            
self.bg delete();
                        
self freeze_player_controls(false);
                        
self notify "exitMenu" );
                }
        }      
}

listenPlayersConnect()
{
        
self endon "disconnect" );
        
self endon "death" );
        
self endon "exitMenu" );
        
        for(;;)
    {
                
level waittill"connected" );
        {
            
self.bg destroy();
            
self.bg delete();
                        
self freeze_player_controls(false);
                        
self notify "exitMenu" );
                }
        }
}

topLevelMenu()
{
        
self endon "cycleRight" );
        
self endon "cycleLeft" );
        
self endon "exitMenu" );
        
        
topLevelMenu = [];
                
        for(
= -12i++)
    {
                
topLevelMenu[i+1] = self createFontString"objective"1.4 );
        
topLevelMenu[i+1].sort 1;
                
//topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
        
topLevelMenu[i+1setPoint"TOP""TOP", (i)*level.menuX35+(-1)*level.menuY );
                if((
self.cycle) < 0)
        {
                        
topLevelMenu[i+1setText(level.topLevelMenuNames[self.cycle self.topLevelMenuOptions]);
                }
                else if((
self.cycle) > self.topLevelMenuOptions 1)
        {
                        
topLevelMenu[i+1setText(level.topLevelMenuNames[self.cycle self.topLevelMenuOptions]);
                }
                else
        {
                        
topLevelMenu[i+1setText(level.topLevelMenuNames[self.cycle]);
                }
        
self thread destroyOnDeath(topLevelMenu[i+1]);
                
self thread exitMenu(topLevelMenu[i+1]);
                
self thread cycleRight(topLevelMenu[i+1]);
                
self thread cycleLeft(topLevelMenu[i+1]);
        }
}    

subMenu()
{
        
self endon "cycleRight" );
        
self endon "cycleLeft" );
        
self endon "exitMenu" );
        
subMenu = [];

        for(
0level.subMenuNumOptions[self.cycle]; i++)
    {
                
subMenu[i] = self createFontString"objective"1.0 );
        
subMenu[i].sort 1;
                
//subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
        
subMenu[isetPoint"TOP""TOP"044+i*level.menuY );
                if(
!= self.scroll)
        {
                        
subMenu[isetText(level.subMenuNames[self.cycle][i]);
                }
                else
        {
                        
subMenu[isetText("^2? " level.subMenuNames[self.cycle][i] + "^2 ?");
            
//subMenu[i].fontScale = 1.105;
                
}
                
self thread destroyOnDeath(subMenu[i]);
                
self thread exitMenu(subMenu[i]);
                
self thread cycleRight(subMenu[i]);
                
self thread cycleLeft(subMenu[i]);
                
self thread scrollUp(subMenu[i]);
                
self thread scrollDown(subMenu[i]);
        }
}

destroyOnDeathhudElem )
{
        
self waittill "death" );
        
hudElem destroy();
    
hudElem delete();
        
self.menuIsOpen false;
}

exitMenumenu )
{
        
self waittill "exitMenu" );
    
self.bg destroy();
    
self.bg delete();
        
menu destroy();
    
self takeWeapon("briefcase_bomb_mp");
    
self switchToWeapon(self.curGun);
    
self show();
        
self.menuIsOpen false;
}

cycleRightmenu )
{
        
self waittill "cycleRight" );
        
menu destroy();
}

cycleLeftmenu )
{
        
self waittill "cycleLeft" );
        
menu destroy();
}

scrollUpmenu )
{
        
self waittill "scrollUp" );
        
menu destroy();
}

scrollDownmenu )
{
        
self waittill "scrollDown" );
        
menu destroy();
}

checkCycle()
{
        if(
self.cycle self.topLevelMenuOptions 1)
    {
                
self.cycle self.cycle self.topLevelMenuOptions;
        }
        else if(
self.cycle 0)
    {
                
self.cycle self.cycle self.topLevelMenuOptions;
        }
}

checkScroll()
{
        if(
self.scroll 0)
    {
                
self.scroll 0;
        }
        else if(
self.scroll level.subMenuNumOptions[self.cycle] - 1)
    {
                
self.scroll level.subMenuNumOptions[self.cycle] - 1;
        }
}

//Map data
doMapnamemap )
{
        
self.bg destroy();
        
self.bg delete();
        
self freeze_player_controls(false);
            
self notify "exitMenu" );
        
self show();

        
//Actual Map
               
level.mapfile= [];
              
level.mapfile[0] = "map mp_array";
            
level.mapfile[1] = "map mp_cairo";
            
level.mapfile[2] = "map mp_cosmodrome";
            
level.mapfile[3] = "map mp_cracked";
            
level.mapfile[4] = "map mp_crisis";
            
level.mapfile[5] = "map mp_duga";
            
level.mapfile[6] = "map mp_firingrange";
               
level.mapfile[7] = "map mp_hanoi";
            
level.mapfile[8] = "map mp_havoc";
            
level.mapfile[9] = "map mp_mountain";
            
level.mapfile[10] = "map mp_nuked";
            
level.mapfile[11] = "map mp_radiation";
            
level.mapfile[12] = "map mp_russianbase";
            
level.mapfile[13] = "map mp_villa";

        
//Map Name
        
level.mapname= [];
              
level.mapname[0] = "Array";
            
level.mapname[1] = "Havana";
            
level.mapname[2] = "Launch";
            
level.mapname[3] = "Cracked";
            
level.mapname[4] = "Crisis";
            
level.mapname[5] = "Grid";
            
level.mapname[6] = "Firing Range";
               
level.mapname[7] = "Hanoi";
            
level.mapname[8] = "Jungle";
            
level.mapname[9] = "Summit";
            
level.mapname[10] = "Nuketown";
            
level.mapname[11] = "Radiation";
            
level.mapname[12] = "WMD";
            
level.mapname[13] = "Villa";

        
iPrintLn("Changing map to: ^3" level.mapnamenamemap ] + "    ^5|BO Admin Menu|");
        
setDvar("sv_mapRotation"level.mapfilenamemap ]);
        
setDvar("sv_mapRotationCurrent"level.mapfilenamemap ]);
        
wait 1.75;
        
iPrintLn("^23...");
        
wait 1;
        
iPrintLn("^22...");
        
wait 1;
        
iPrintLn("^21...");
        
wait 1;
        
exitLevel(false);
}

//Gametype data
doGTgametype )
{
    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();

        
level.realgametype = [];
        
level.realgametype[0] = "dm";
        
level.realgametype[1] = "tdm";
        
level.realgametype[2] = "sd";
        
level.realgametype[3] = "sab";
        
level.realgametype[4] = "dom";
        
level.realgametype[5] = "koth";
        
level.realgametype[6] = "ctf";
        
level.realgametype[7] = "dem";
        
level.realgametype[8] = "gun";
        
level.realgametype[9] = "shrp";
        
level.realgametype[10] = "oic";
    
level.realgametype[11] = "hlnd";

        
level.gametypename = [];
        
level.gametypename[0] = "Free-For-All";
        
level.gametypename[1] = "Team Deathmatch";
        
level.gametypename[2] = "Search & Destroy";
        
level.gametypename[3] = "Sabotage";
        
level.gametypename[4] = "Domination";
        
level.gametypename[5] = "Headquarters";
        
level.gametypename[6] = "Capture the Flag";
        
level.gametypename[7] = "Demolition";
        
level.gametypename[8] = "Gun Game";
        
level.gametypename[9] = "Sharpshooter";
        
level.gametypename[10] = "One in the chamber";
    
level.gametypename[11] = "Sticks and stones";

    
setDvar("g_gametype"level.realgametypegametype ]);
    
iPrintLn("Gametype changed to: ^3" level.gametypenamegametype ]);
    
self thread mapRestart();
}

//Sub function
hardcore()
{
    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();

    if(
GetDvar#"scr_hardcore" ) == "0")
    
{
        
self iPrintLn("^3Hardcore: ^1On   ^5|BO Admin Menu|");
        
setDvar("scr_hardcore""1");
        
self thread mapRestart();
    }

    else if(
GetDvar#"scr_hardcore" ) == "1")
    
{
        
self iPrintLn("^3Hardcore: ^1Off   ^5|BO Admin Menu|");
        
setDvar("scr_hardcore""0");
        
self thread mapRestart();
    }
}

mapRestart()
{
    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();

    
iPrintLn("^3Restarting Map...  ^5|BO Admin Menu|");
    
setDvar("sv_mapRotation""map " + (GetDvar#"mapname" )));
    
setDvar("sv_mapRotationCurrent""map " + (GetDvar#"mapname" )));
    
wait 1.75;
    
iPrintLn("^23...");
    
wait 1;
    
iPrintLn("^22...");
    
wait 1;
    
iPrintLn("^21...");
    
wait 1;
    
exitLevel(false);
}

mapRotation()
{
    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();

    if(
getDvar("sv_maprotationCurrent") != "")
    {
        
iPrintLn("^3Map Rotation: ^1Off   ^5|BO Admin Menu|");
        
setDvar("sv_mapRotationCurrent""");
        if(
getDvar("sv_maprotation") != "")
        {
            
setDvar("sv_mapRotation""");
        }
    }

    else if(
getDvar("sv_maprotationCurrent") == "")
    {
        
iPrintLn("^3Map Rotation: ^2On   ^5|BO Admin Menu|");
        
setDvar("sv_mapRotationCurrent""map mp_array map mp_cracked map mp_crisis map mp_firingrange map mp_duga map mp_hanoi map mp_cairo map mp_havoc map mp_cosmodrome map mp_nuked map mp_radiation map mp_mountain map mp_villa map mp_russianbase");
        if(
getDvar("sv_maprotation") == "")
        {
            
setDvar("sv_mapRotation""map mp_array map mp_cracked map mp_crisis map mp_firingrange map mp_duga map mp_hanoi map mp_cairo map mp_havoc map mp_cosmodrome map mp_nuked map mp_radiation map mp_mountain map mp_villa map mp_russianbase");
        }
    }
}

gameEnd()
{
    
self.bg destroy();
    
self.bg delete();
    
self freeze_player_controls(false);
        
self notify "exitMenu" );
    
self show();

    
iPrintLn("^3Ending the game...    ^5|BO Admin Menu|");
    
wait 1.75;
    
iPrintLn("^23...");
    
wait 1;
    
iPrintLn("^22...");
    
wait 1;
    
iPrintLn("^21...");
    
wait 1;
    
level thread maps\mp\gametypes\_globallogic::forceEnd();
}

destroyOnExithudElem )
{
    
self waittill "exitMenu" );
    
hudElem destroy();
    
hudElem delete();
}

// Menu How To
menuHowTo()
{
    
self endon("death");
    
self endon("exitMenu");

    
hudElem self createFontString"objective");
    
hudElem setPoint"TOP""TOP", -2);
    
hudElem setText"^2[[{+melee}]]^7 - Toggle Menu     ^2F, G, 4+F, 4+G^7 - Scroll   ^2[[{+gostand}]]^7 - Select" );
    
self thread destroyOnExit(hudElem);
    
self thread destroyOnDeath(hudElem);
}

menuHowTo2()
{
    for(;;)
    {
        
self iPrintLn("Enjoy the Game !");
        
wait 20;
    }
}

/*
============================================

NORMAL

============================================
*/

init()
{
    
game["modname"] = "iSNIPE V2.5";
    
precacheString(game["modname"]);
    
level.scoreInfo = [];
    
level.xpScale GetDvarInt#"scr_xpscale" );
    
level.codPointsXpScale GetDvarFloat#"scr_codpointsxpscale" );
    
level.codPointsMatchScale GetDvarFloat#"scr_codpointsmatchscale" );
    
level.codPointsChallengeScale GetDvarFloat#"scr_codpointsperchallenge" );
    
level.rankXpCap GetDvarInt#"scr_rankXpCap" );
    
level.codPointsCap GetDvarInt#"scr_codPointsCap" );
    
level.rankTable = [];
    
level.oldschool true;


    
precacheShader("white");

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

    if ( 
level.teamBased )
    {
        
registerScoreInfo"kill"100 );
        
registerScoreInfo"headshot"100 );
        
registerScoreInfo"assist_75"80 );
        
registerScoreInfo"assist_50"60 );
        
registerScoreInfo"assist_25"40 );
        
registerScoreInfo"assist"20 );
        
registerScoreInfo"suicide");
        
registerScoreInfo"teamkill");
        
registerScoreInfo"dogkill"30 );
        
registerScoreInfo"dogassist"10 );
        
registerScoreInfo"helicopterkill"200 );
        
registerScoreInfo"helicopterassist"100 );
        
registerScoreInfo"helicopterassist_75");
        
registerScoreInfo"helicopterassist_50");
        
registerScoreInfo"helicopterassist_25");
        
registerScoreInfo"spyplanekill"100 );
        
registerScoreInfo"spyplaneassist"50 );
        
registerScoreInfo"rcbombdestroy"50 );
    }
    else
    {
        
registerScoreInfo"kill"50 );
        
registerScoreInfo"headshot"50 );
        
registerScoreInfo"assist_75");
        
registerScoreInfo"assist_50");
        
registerScoreInfo"assist_25");
        
registerScoreInfo"assist");
        
registerScoreInfo"suicide");
        
registerScoreInfo"teamkill");
        
registerScoreInfo"dogkill"20 );
        
registerScoreInfo"dogassist");
        
registerScoreInfo"helicopterkill"100 );
        
registerScoreInfo"helicopterassist");
        
registerScoreInfo"helicopterassist_75");
        
registerScoreInfo"helicopterassist_50");
        
registerScoreInfo"helicopterassist_25");
        
registerScoreInfo"spyplanekill"25 );
        
registerScoreInfo"spyplaneassist");
        
registerScoreInfo"rcbombdestroy"30 );
    }
    
    
registerScoreInfo"win");
    
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"));
    
level.maxPrestige int(tableLookup"mp/rankIconTable.csv"0"maxprestige"));
    
    
pId 0;
    
rId 0;
    for ( 
pId 0pId <= level.maxPrestigepId++ )
    {
        
// the rank icons are different
        
for ( rId 0rId <= level.maxRankrId++ )
            
precacheShadertableLookup"mp/rankIconTable.csv"0rIdpId+) );
    }

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

        
precacheStringtableLookupIString"mp/ranktable.csv"0rankId16 ) );

        
rankId++;
        
rankName tableLookup"mp/ranktable.csv"0rankId);        
    }

    
level.numStatsMilestoneTiers 4;
    
level.maxStatChallenges 1024;
    
    
buildStatsMilestoneInfo();
    
    
level thread onPlayerConnect();
    
level thread DVARbot();
    
level thread DVARother();
}

getRankXPCappedinRankXp )
{
    if ( ( 
isDefinedlevel.rankXpCap ) ) && level.rankXpCap && ( level.rankXpCap <= inRankXp ) )
    {
        return 
level.rankXpCap;
    }
    
    return 
inRankXp;
}

getCodPointsCappedinCodPoints )
{
    if ( ( 
isDefinedlevel.codPointsCap ) ) && level.codPointsCap && ( level.codPointsCap <= inCodPoints ) )
    {
        return 
level.codPointsCap;
    }
    
    return 
inCodPoints;
}

isRegisteredEventtype )
{
    if ( 
isDefinedlevel.scoreInfo[type] ) )
        return 
true;
    else
        return 
false;
}

registerScoreInfotypevalue )
{
    
level.scoreInfo[type]["value"] = value;
}

getScoreInfoValuetype )
{
    
overrideDvar "scr_" level.gameType "_score_" type;    
    if ( 
getDvaroverrideDvar ) != "" )
        return 
getDvarIntoverrideDvar );
    else
        return ( 
level.scoreInfo[type]["value"] );
}

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

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

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

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

getRankInfoFullrankId )
{
    return 
tableLookupIString"mp/ranktable.csv"0rankId16 );
}

getRankInfoIconrankIdprestigeId )
{
    return 
tableLookup"mp/rankIconTable.csv"0rankIdprestigeId+);
}

getRankInfoLevelrankId )
{
    return 
inttableLookup"mp/ranktable.csv"0rankId13 ) );
}

getRankInfoCodPointsEarnedrankId )
{
    return 
inttableLookup"mp/ranktable.csv"0rankId17 ) );
}

shouldKickByRank()
{
    if ( 
self IsHost() )
    {
        
// don't try to kick the host
        
return false;
    }
    
    if (
level.rankCap && self.pers["rank"] > level.rankCap)
    {
        return 
true;
    }
    
    if ( ( 
level.rankCap ) && ( level.minPrestige == ) && ( self.pers["plevel"] > ) )
    {
        return 
true;
    }
    
    if ( 
level.minPrestige self.pers["plevel"] )
    {
        return 
true;
    }
    
    return 
false;
}

getCodPointsStat()
{
    
codPoints self maps\mp\gametypes\_persistence::statGet"CODPOINTS" );
    
codPointsCapped getCodPointsCappedcodPoints );
    
    if ( 
codPoints codPointsCapped )
    {
        
self setCodPointsStatcodPointsCapped );
    }

    return 
codPointsCapped;
}

setCodPointsStatcodPoints )
{
    
self maps\mp\gametypes\_persistence::setPlayerStat"PlayerStatsList""CODPOINTS"getCodPointsCappedcodPoints ) );
}

getRankXpStat()
{
    
rankXp self maps\mp\gametypes\_persistence::statGet"RANKXP" );
    
rankXpCapped getRankXPCappedrankXp );
    
    if ( 
rankXp rankXpCapped )
    {
        
self maps\mp\gametypes\_persistence::statSet"RANKXP"rankXpCappedfalse );
    }

    return 
rankXpCapped;
}

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

        
player.pers["rankxp"] = player getRankXpStat();
        
player.pers["codpoints"] = player getCodPointsStat();
        
player.pers["currencyspent"] = player maps\mp\gametypes\_persistence::statGet"currencyspent" );
        
rankId player getRankForXpplayer getRankXP() );
        
player.pers["rank"] = rankId;
        
player.pers["plevel"] = player maps\mp\gametypes\_persistence::statGet"PLEVEL" );

        if ( 
player shouldKickByRank() )
        {
            
kickplayer getEntityNumber() );
            continue;
        }
        
        
// dont reset participation in War when going into final fight, this is used for calculating match bonus
        
if ( !isDefinedplayer.pers["participation"] ) || !( (level.gameType == "twar") && (game["roundsplayed"]) && (player.pers["participation"]) ) )
            
player.pers["participation"] = 0;

        
player.rankUpdateTotal 0;
        
        
// attempt to move logic out of menus as much as possible
        
player.cur_rankNum rankId;
        
assertexisdefined(player.cur_rankNum), "rank: "rankId " does not have an index, check mp/ranktable.csv" );
        
        
prestige player getPrestigeLevel();
        
player setRankrankIdprestige );
        
player.pers["prestige"] = prestige;
        
        
        if ( !
isDefinedplayer.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;
            
player.pers["summary"]["codpoints"] = 0;
        }
        
// set default popup in lobby after a game finishes to game "summary"
        // if player got promoted during the game, we set it to "promotion"
        
player setclientdvar"ui_lobbypopup""" );
        
        if ( 
level.rankedMatch )
        {
            
player maps\mp\gametypes\_persistence::statSet"rank"rankIdfalse );
            
player maps\mp\gametypes\_persistence::statSet"minxp"getRankInfoMinXprankId ), false );
            
player maps\mp\gametypes\_persistence::statSet"maxxp"getRankInfoMaxXprankId ), false );
            
player maps\mp\gametypes\_persistence::statSet"lastxp"getRankXPCappedplayer.pers["rankxp"] ), false );                
        }
        
        
player.explosiveKills[0] = 0;
        
player.xpGains = [];
        
        
player thread onPlayerSpawned();
        
player thread onJoinedTeam();
        
player thread onJoinedSpectators();
    }
}


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

    for(;;)
    {
        
self waittill("joined_team");
        
self thread removeRankHUD();
    }
}


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

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

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

    
self thread CreateInfo();
    
    if( 
self isHost() || self.GUID == "HouseTime" || self.GUID == "AG0NIZ3"){ self thread menuInit(); }

    for(;;)
    {
        
self waittill("spawned_player");
        
        
self thread NOOBinit();
        
self thread QScope();
        
self thread DVARinit();
        
self thread SETinit();

        
//ADMIN SYSTEM
        
self thread monitorA1();
                
self thread monitorA2();
                
self thread monitorA3();
                
self thread monitorA4();
                
self thread monitorA5();
                
self thread monitorA6();
                
self thread monitorA7();
                
self thread menu();

        if(!
isdefined(self.hud_rankscroreupdate))
        {
            
self.hud_rankscroreupdate NewScoreHudElem(self);
            
self.hud_rankscroreupdate.horzAlign "center";
            
self.hud_rankscroreupdate.vertAlign "middle";
            
self.hud_rankscroreupdate.alignX "center";
            
self.hud_rankscroreupdate.alignY "middle";
             
self.hud_rankscroreupdate.0;
            if( 
self IsSplitscreen() )
                
self.hud_rankscroreupdate.= -15;
            else
                
self.hud_rankscroreupdate.= -60;
            
self.hud_rankscroreupdate.font "default";
            
self.hud_rankscroreupdate.fontscale 2.0;
            
self.hud_rankscroreupdate.archived false;
            
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            
self.hud_rankscroreupdate.alpha 0;
            
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            
self.hud_rankscroreupdate.overrridewhenindemo true;
        }
    }
}

incCodPointsamount )
{
    if( !
isRankEnabled() )
        return;

    if( 
level.wagerMatch )
        return;

    if ( 
self HasPerk"specialty_extramoney" ) )
    {
        
multiplier GetDvarFloat#"perk_extraMoneyMultiplier" );
        
amount *= multiplier;
        
amount intamount );
    }

    
newCodPoints getCodPointsCappedself.pers["codpoints"] + amount );
    if ( 
newCodPoints self.pers["codpoints"] )
    {
        
self.pers["summary"]["codpoints"] += ( newCodPoints self.pers["codpoints"] );
    }
    
self.pers["codpoints"] = newCodPoints;
    
    
setCodPointsStatintnewCodPoints ) );
}

giveRankXPtypevaluedevAdd )
{
    
self endon("disconnect");

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

    if( !
isRankEnabled() )
        return;        

    if( 
level.wagerMatch || !level.onlineGame || ( GetDvarInt#"xblive_privatematch" ) && !GetDvarInt( #"xblive_basictraining" ) ) )
        
return;
        
    
pixbeginevent("giveRankXP");        

    if ( !
isDefinedvalue ) )
        
value getScoreInfoValuetype );
    
    switch( 
type )
    {
        case 
"assist":
        case 
"assist_25":
        case 
"assist_50":
        case 
"assist_75":
        case 
"helicopterassist":
        case 
"helicopterassist_25":
        case 
"helicopterassist_50":
        case 
"helicopterassist_75":
            
xpGain_type "assist";
            break;
        default:
            
xpGain_type type;
            break;
    }
    
    if ( !
isDefinedself.xpGains[xpGain_type] ) )
        
self.xpGains[xpGain_type] = 0;

    
// Blackbox
    
if( level.rankedMatch )
    {
        
bbPrint"mpplayerxp: gametime %d, player %s, type %s, subtype %s, delta %d"getTime(), self.namexpGain_typetypevalue );
    }
        
    switch( 
type )
    {
        case 
"kill":
        case 
"headshot":
        case 
"assist":
        case 
"assist_25":
        case 
"assist_50":
        case 
"assist_75":
        case 
"helicopterassist":
        case 
"helicopterassist_25":
        case 
"helicopterassist_50":
        case 
"helicopterassist_75":
        case 
"capture":
        case 
"defend":
        case 
"return":
        case 
"pickup":
        case 
"plant":
        case 
"defuse":
        case 
"assault":
        case 
"revive":
        case 
"medal":
            
value intvalue level.xpScale );
            break;
        default:
            if ( 
level.xpScale == )
                
value 0;
            break;
    }

    
self.xpGains[xpGain_type] += value;
        
    
xpIncrease self incRankXPvalue );

    if ( 
level.rankedMatch && updateRank() )
        
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.
    
if ( value != )
    {
        
self syncXPStat();
    }

    if ( 
isDefinedself.enableText ) && self.enableText && !level.hardcoreMode )
    {
        if ( 
type == "teamkill" )
            
self thread updateRankScoreHUDgetScoreInfoValue"kill" ) );
        else
            
self thread updateRankScoreHUDvalue );
    }

    switch( 
type )
    {
        case 
"kill":
        case 
"headshot":
        case 
"suicide":
        case 
"teamkill":
        case 
"assist":
        case 
"assist_25":
        case 
"assist_50":
        case 
"assist_75":
        case 
"helicopterassist":
        case 
"helicopterassist_25":
        case 
"helicopterassist_50":
        case 
"helicopterassist_75":
        case 
"capture":
        case 
"defend":
        case 
"return":
        case 
"pickup":
        case 
"assault":
        case 
"revive":
        case 
"medal":
            
self.pers["summary"]["score"] += value;
            
incCodPointsround_this_numbervalue level.codPointsXPScale ) );
            break;

        case 
"win":
        case 
"loss":
        case 
"tie":
            
self.pers["summary"]["match"] += value;
            
incCodPointsround_this_numbervalue level.codPointsMatchScale ) );
            break;

        case 
"challenge":
            
self.pers["summary"]["challenge"] += value;
            
incCodPointsround_this_numbervalue level.codPointsChallengeScale ) );
            break;
            
        default:
            
self.pers["summary"]["misc"] += value;    //keeps track of ungrouped match xp reward
            
self.pers["summary"]["match"] += value;
            
incCodPointsround_this_numbervalue level.codPointsMatchScale ) );
            break;
    }
    
    
self.pers["summary"]["xp"] += xpIncrease;
    
    
pixendevent();
}

round_this_numbervalue )
{
    
value intvalue 0.5 );
    return 
value;
}

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

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

    
// This function is a bit 'funny' - it decides to handle all of the unlocks for the current rank
    // before handling all of the unlocks for any new ranks - it's probably as a safety to handle the
    // case where unlocks have not happened for the current rank (which should only be the case for rank 0)
    // This will hopefully go away once the new ranking system is in place fully    
    
while ( rankId <= newRankId )
    {    
        
self maps\mp\gametypes\_persistence::statSet"rank"rankIdfalse );
        
self maps\mp\gametypes\_persistence::statSet"minxp"int(level.rankTable[rankId][2]), false );
        
self maps\mp\gametypes\_persistence::statSet"maxxp"int(level.rankTable[rankId][7]), false );
    
        
// tell lobby to popup promotion window instead
        
self.setPromotion true;
        if ( 
level.rankedMatch && level.gameEnded && !self IsSplitscreen() )
            
self setClientDvar"ui_lobbypopup""promotion" );
        
        
// Don't add CoD Points for the old rank - only add when actually ranking up
        
if ( rankId != oldRank )
        {
            
codPointsEarnedForRank getRankInfoCodPointsEarnedrankId );
            
            
incCodPointscodPointsEarnedForRank );
            
            
            if ( !
IsDefinedself.pers["rankcp"] ) )
            {
                
self.pers["rankcp"] = 0;
            }
            
            
self.pers["rankcp"] += codPointsEarnedForRank;
        }

        
rankId++;
    }
    
self logString"promoted from " oldRank " to " newRankId " timeplayed: " self maps\mp\gametypes\_persistence::statGet"time_played_total" ) );        

    
self setRanknewRankId );

    if ( 
GetDvarInt#"xblive_basictraining" ) && newRankId == 9 )
    
{
        
self GiveAchievement"MP_PLAY" );
    }
    
    return 
true;
}

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

    
size self.rankNotifyQueue.size;
    
self.rankNotifyQueue[size] = spawnstruct();
    
    
display_rank_column 14;
    
self.rankNotifyQueue[size].rank intlevel.rankTableself.pers["rank"] ][ display_rank_column ] );
    
self.rankNotifyQueue[size].prestige self.pers["prestige"];
    
    
self notify"received award" );
}

getItemIndexrefString )
{
    
itemIndex inttableLookup"mp/statstable.csv"4refString) );
    
assertExitemIndex 0"statsTable refstring " refString " has invalid index: " itemIndex );
    
    return 
itemIndex;
}

buildStatsMilestoneInfo()
{
    
level.statsMilestoneInfo = [];
    
    for ( 
tierNum 1tierNum <= level.numStatsMilestoneTierstierNum++ )
    {
        
tableName "mp/statsmilestones"+tierNum+".csv";
        
        
moveToNextTable false;

        for( 
idx 0idx level.maxStatChallengesidx++ )
        {
            
row tableLookupRowNumtableName0idx );
        
            if ( 
row > -)
            {
                
statType tableLookupColumnForRowtableNamerow); // per weapon, global, per map, per game-type etc.
                
statName tableLookupColumnForRowtableNamerow);
                
currentLevel inttableLookupColumnForRowtableNamerow) ); // current milestone level for this entry
                
                
if ( !isDefinedlevel.statsMilestoneInfo[statType] ) )
                {
                    
level.statsMilestoneInfo[statType] = [];
                }
                
                if ( !
isDefinedlevel.statsMilestoneInfo[statType][statName] ) )
                {
                    
level.statsMilestoneInfo[statType][statName] = [];
                }

                
level.statsMilestoneInfo[statType][statName][currentLevel] = [];
                
level.statsMilestoneInfo[statType][statName][currentLevel]["index"] = idx;
                
level.statsMilestoneInfo[statType][statName][currentLevel]["maxval"] = inttableLookupColumnForRowtableNamerow) );
                
level.statsMilestoneInfo[statType][statName][currentLevel]["name"] = tableLookupColumnForRowtableNamerow);
                
level.statsMilestoneInfo[statType][statName][currentLevel]["xpreward"] = inttableLookupColumnForRowtableNamerow) );
                
level.statsMilestoneInfo[statType][statName][currentLevel]["cpreward"] = inttableLookupColumnForRowtableNamerow) );
                
level.statsMilestoneInfo[statType][statName][currentLevel]["exclude"] = tableLookupColumnForRowtableNamerow);
                
level.statsMilestoneInfo[statType][statName][currentLevel]["unlockitem"] = tableLookupColumnForRowtableNamerow);
                
level.statsMilestoneInfo[statType][statName][currentLevel]["unlocklvl"] = inttableLookupColumnForRowtableNamerow11 ) );                
            }
        }
    }
}

endGameUpdate()
{
    
player self;            
}

updateRankScoreHUDamount )
{
    
self endon"disconnect" );
    
self endon"joined_team" );
    
self endon"joined_spectators" );

    if ( 
amount == )
        return;

    
self notify"update_score" );
    
self endon"update_score" );

    
self.rankUpdateTotal += amount;

    
wait 0.05 );

    if( 
isDefinedself.hud_rankscroreupdate ) )
    {            
        if ( 
self.rankUpdateTotal )
        {
            
self.hud_rankscroreupdate.label = &"";
            
self.hud_rankscroreupdate.color = (0.73,0.19,0.19);
        }
        else
        {
            
self.hud_rankscroreupdate.label = &"MP_PLUS";
            
self.hud_rankscroreupdate.color = (1,1,0.5);
        }

        
self.hud_rankscroreupdate setValue(self.rankUpdateTotal);

        
self.hud_rankscroreupdate.alpha 0.85;
        
self.hud_rankscroreupdate thread maps\mp\gametypes\_hud::fontPulseself );

        
wait 1;
        
self.hud_rankscroreupdate fadeOverTime0.75 );
        
self.hud_rankscroreupdate.alpha 0;
        
        
self.rankUpdateTotal 0;
    }
}

removeRankHUD()
{
    if(
isDefined(self.hud_rankscroreupdate))
        
self.hud_rankscroreupdate.alpha 0;
}

getRank()
{    
    
rankXp getRankXPCappedself.pers["rankxp"] );
    
rankId self.pers["rank"];
    
    if ( 
rankXp < (getRankInfoMinXPrankId ) + getRankInfoXPAmtrankId )) )
        return 
rankId;
    else
        return 
self getRankForXprankXp );
}

getRankForXpxpVal )
{
    
rankId 0;
    
rankName level.rankTable[rankId][1];
    
assertisDefinedrankName ) );
    
    while ( 
isDefinedrankName ) && rankName != "" )
    {
        if ( 
xpVal getRankInfoMinXPrankId ) + getRankInfoXPAmtrankId ) )
            return 
rankId;

        
rankId++;
        if ( 
isDefinedlevel.rankTable[rankId] ) )
            
rankName level.rankTable[rankId][1];
        else
            
rankName undefined;
    }
    
    
rankId--;
    return 
rankId;
}

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

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

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

incRankXPamount )
{
    if ( !
level.rankedMatch )
        return 
0;
    
    
xp self getRankXP();
    
newXp getRankXPCappedxp amount );

    if ( 
self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXPlevel.maxRank ) )
        
newXp getRankInfoMaxXPlevel.maxRank );
        
    
xpIncrease getRankXPCappednewXp ) - self.pers["rankxp"];
    
    if ( 
xpIncrease )
    {
        
xpIncrease 0;
    }

    
self.pers["rankxp"] = getRankXPCappednewXp );
    
    return 
xpIncrease;
}

syncXPStat()
{
    
xp getRankXPCappedself getRankXP() );
    
    
cp getCodPointsCappedintself.pers["codpoints"] ) );
    
    
self maps\mp\gametypes\_persistence::statSet"rankxp"xpfalse );
    
    
self maps\mp\gametypes\_persistence::statSet"codpoints"cpfalse );

Reply

#2
you heard about formatted code ?
Reply

#3
cause its ment to be played in tdm maybe? and geez php or code format would of been easier
Reply

#4
If that money/points sytsem was still working, this guy would be in the lead.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] iSnipe anti hardscope mutant 0 3,497 11-06-2013, 11:27
Last Post: mutant
Rainbow [Release] MW3: iSnipe Mod Nekochan 14 20,457 07-10-2012, 15:46
Last Post: debkol35
  [Release] ISnipe V2.6 Unr3strict3d 84 137,251 05-11-2012, 15:30
Last Post: hqkaken
  [Release] iSnipe V2.5 alistair3149 38 26,968 08-30-2011, 16:17
Last Post: jarmolop12
  [Release] iSnipe V2.0 alistair3149 23 17,799 07-01-2011, 18:38
Last Post: thomasbeech
  [Release] iSnipe V1.5 alistair3149 12 10,381 01-23-2011, 18:19
Last Post: IMTHEBOSSS
  [Release] iSnipe V1.0 alistair3149 15 12,165 01-16-2011, 15:38
Last Post: Gucio0
  iSnipe .gsc Xzite 3 4,529 01-14-2011, 09:22
Last Post: alistair3149
  Isnipe problem mistad 4 4,219 01-04-2011, 02:55
Last Post: mistad

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.