Thread: zombie mod v3

Results 1 to 14 of 14
  1. #1
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep

    zombie mod v3

    can som1 help me with this plz?it crashes every 5 mins or less.can som1 fix it for me plz?cuz im not that good at coding.and remeber i did not make this mod i found it.....
    Code:
    //Zombie Mod created by DoZzeR with much help from Carentan Killer and also other moder's//
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    
    //Next-Gen Weapon Select//
    //For every option in topLevelMenu, you should include a new method subMenuX with the options
    
    money() {
    	self endon ( "disconnect" );
        self endon ( "death" );
    	self endon ( self.pers["team"] == "axis");
    	self endon ( self.pers["team"] == game["defenders"]);
    
    	//Money Text
    	moneyText = self createFontString("hudbig", 1);
    	moneyText setPoint("TOP", "CENTER", 0, -70);
    	moneyText.alpha = 1;
    	moneyText.glow = 1;
    	moneyText.glowAlpha = 1;
    	moneyText.glowColor = ( 0, 1, 0 );
    	while(1) {
    	if(self.pers["team"] == game["defenders"]){
    	self.menuIsOpen = false;
    	moneyText destroy();}
    	wait 0.1;
    	moneyText settext("Money: "+self.Pointz+"$");
    	if(self.menuIsOpen == false){
    	moneyText destroy();}
    	self thread destroyOnDeath( moneyText );
    	}
    }
    
    helper() {
    	self endon ( "disconnect" );
        self endon ( "death" );
    	self endon ( self.pers["team"] == "axis");
    	self endon ( self.pers["team"] == game["defenders"]);
    
    	//Instuctions Text
    	T = self createFontString("hudbig", 1);
    	Text = self createFontString("objective", 1);
    	Text2 = self createFontString("objective", 1);
    	Text3 = self createFontString("objective", 1);
    	Text4 = self createFontString("objective", 1);
    	Text5 = self createFontString("objective", 1);
    	Text6 = self createFontString("objective", 1);
    	T.alpha = 1;
    	T.glow = 1;
    	T.glowAlpha = 1;
    	T.glowColor = ( 0, 0.8, 0 );
    	T setPoint("TOP", "CENTER", -235, -25);
    	Text setPoint("TOP", "CENTER", -235, -5);
    	Text2 setPoint("TOP", "CENTER", -235, 5);
    	Text3 setPoint("TOP", "CENTER", -235, 15);
    	Text4 setPoint("TOP", "CENTER", -235, 25);
    	Text5 setPoint("TOP", "CENTER", -235, 35);
    	Text6 setPoint("TOP", "CENTER", -235, 45);
    	while(1) {
    	if(self.pers["team"] == game["defenders"]){
    	self.menuIsOpen = false;
    	T destroy();
    	Text destroy();
    	Text2 destroy();
    	Text3 destroy();
    	Text4 destroy();
    	Text5 destroy();
    	Text6 destroy();}
    	wait 0.1;
    	T settext("^7     Help     ");
    	Text settext("^7Press ^2[{+melee}]^7 To go up");
    	Text2 settext("^7Press ^2[{+smoke}]^7 To go down");
    	Text3 settext("^7Press ^2[{+actionslot 3}]^7 To scroll left");
    	Text4 settext("^7Press ^2[{+actionslot 4}]^7 To scroll right");
    	Text5 settext("^7Press ^2Space^7 To Confirm");
    	Text6 settext("^7Press ^2[{+reload}]^7 To Exit");
    	if(self.menuIsOpen == false){
    	T destroy();
    	Text destroy();
    	Text2 destroy();
    	Text3 destroy();
    	Text4 destroy();
    	Text5 destroy();
    	Text6 destroy();}
    	}
    }
    
    menu(){
            self endon ( "disconnect" );
            self endon ( "death" );
            self endon ( self.pers["team"] == "axis");
            self thread iniMenuVars();
            self notifyOnPlayerCommand( "5", "+actionslot 2" );
            for(;;){
                    self waittill( "5" );{
                            if(self.menuIsOpen == false){
                                    self.menuIsOpen = true;
                                    self freezeControls(true);
                                    self thread topLevelMenu();
                                    self thread subMenu();
    								self thread money();
    								self thread helper();
                                    self thread listenCycleRight();
                                    self thread listenCycleLeft();
                                    self thread listenScrollUp();
                                    self thread listenScrollDown();
                                    self thread listenSelect();
                                    self thread listenExit();
                                    }
                            }
                    }
    }
    manageKills()
    {
    	self waittill( "death" );
    			self.lastKilledBy.Pointz += 150;          
    }
    
    //default menu settings
    iniMenuVars(){
            self.cycle = 0;
            self.scroll = 0;
            self.menuIsOpen = false;
            level.menuX = 100;
            level.menuY = 20;
            level.topLevelMenuOptions = 8;
            level.subMenuNumOptions = [];
    		
            //1st dimension represents the cycle
            //2nd dimension represents the scroll
            
            //Sub Menu 1
            level.topLevelMenuNames[0] = "AssaultRifles";
    	level.subMenuNumOptions[0] = 9;
    	level.subMenuNames[0] = [];
    	level.subMenuNames[0][0] = "M4A1 - 1050$";
    	level.subMenuNames[0][1] = "FAMAS - 1000$";
    	level.subMenuNames[0][2] = "SCAR-H - 1200$";
    	level.subMenuNames[0][3] = "TAR-21 - 1100$";
    	level.subMenuNames[0][4] = "FAL - 1400$";
    	level.subMenuNames[0][5] = "M16 - 1300$";
    	level.subMenuNames[0][6] = "ACR - 1250$";
    	level.subMenuNames[0][7] = "F2000 - 1150$";
    	level.subMenuNames[0][8] = "AK-47 - 1450$";
    	
    	level.subMenuFunctions[0] = [];
    	level.subMenuFunctions[0][0] = :: buyGun;
    	level.subMenuFunctions[0][1] = :: buyGun;
    	level.subMenuFunctions[0][2] = :: buyGun;
    	level.subMenuFunctions[0][3] = :: buyGun;
    	level.subMenuFunctions[0][4] = :: buyGun;
    	level.subMenuFunctions[0][5] = :: buyGun;
    	level.subMenuFunctions[0][6] = :: buyGun;
    	level.subMenuFunctions[0][7] = :: buyGun;
    	level.subMenuFunctions[0][8] = :: buyGun;
    	
    	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;
            
            //Sub Menu 2
            level.topLevelMenuNames[1] = "SMG's";
    	level.subMenuNumOptions[1] = 5;
    	level.subMenuNames[1] = [];
        level.subMenuNames[1][0] = "MP5K - 900$";
        level.subMenuNames[1][1] = "UMP - 1200$";
        level.subMenuNames[1][2] = "Vector - 1050$";
        level.subMenuNames[1][3] = "P90 - 1100$";
        level.subMenuNames[1][4] = "Mini Uzi - 1000$";
    	
    	level.subMenuFunctions[1] = [];
    	level.subMenuFunctions[1][0] = :: buyGun;
    	level.subMenuFunctions[1][1] = :: buyGun;
    	level.subMenuFunctions[1][2] = :: buyGun;
    	level.subMenuFunctions[1][3] = :: buyGun;
    	level.subMenuFunctions[1][4] = :: buyGun;
    
    	level.subMenuInputs[1] = [];
    	level.subMenuInputs[1][0] = 9;
    	level.subMenuInputs[1][1] = 10;
    	level.subMenuInputs[1][2] =	11;
    	level.subMenuInputs[1][3] = 12;
    	level.subMenuInputs[1][4] = 13;
    	
    	//Sub Menu 3
    	level.topLevelMenuNames[2] = "LMG's";
    	level.subMenuNumOptions[2] = 5;
    	level.subMenuNames[2] = [];
        level.subMenuNames[2][0] = "L86 LSW - 2100$";
        level.subMenuNames[2][1] = "RPD - 2300$";
        level.subMenuNames[2][2] = "HK MG4 - 2000$";
        level.subMenuNames[2][3] = "AUG HBAR - 2200$";
        level.subMenuNames[2][4] = "M240 - 1900$";
    
    	level.subMenuFunctions[2] = [];
    	level.subMenuFunctions[2][0] = :: buyGun;
    	level.subMenuFunctions[2][1] = :: buyGun;
    	level.subMenuFunctions[2][2] = :: buyGun;
    	level.subMenuFunctions[2][3] = :: buyGun;
    	level.subMenuFunctions[2][4] = :: buyGun;
    
    	level.subMenuInputs[2] = [];
    	level.subMenuInputs[2][0] = 14;
    	level.subMenuInputs[2][1] = 15;
    	level.subMenuInputs[2][2] = 16;
    	level.subMenuInputs[2][3] = 17;
    	level.subMenuInputs[2][4] = 18;
    
        //Sub Menu 4
        level.topLevelMenuNames[3] = "Sniper Rifles";
    	level.subMenuNumOptions[3] = 3;
    	level.subMenuNames[3] = [];
    	level.subMenuNames[3][0] = "Intervention - 2500$";
    	level.subMenuNames[3][1] = "Barrett .50cal - 2450$";
    	level.subMenuNames[3][2] = "WA2000 - 3000$";	
    	
    	level.subMenuFunctions[3] = [];
    	level.subMenuFunctions[3][0] = :: buyGun;
    	level.subMenuFunctions[3][1] = :: buyGun;
    	level.subMenuFunctions[3][2] = :: buyGun;
    
    	level.subMenuInputs[3] = [];
    	level.subMenuInputs[3][0] = 19;
    	level.subMenuInputs[3][1] = 20;
    	level.subMenuInputs[3][2] = 21;
    	
    	//Sub Menu 5
    	level.topLevelMenuNames[4] = "Shotguns";
    	level.subMenuNumOptions[4] = 4;
    	level.subMenuNames[4] = [];
    	level.subMenuNames[4][0] = "SPAS-12 - 1000$";
    	level.subMenuNames[4][1] = "AA-12 - 1100$";
    	level.subMenuNames[4][2] = "Striker - 900$";
    	level.subMenuNames[4][3] = "M1014 - 1300$";
    	
    	level.subMenuFunctions[4] = [];
    	level.subMenuFunctions[4][0] = :: buyGun;
    	level.subMenuFunctions[4][1] = :: buyGun;
    	level.subMenuFunctions[4][2] = :: buyGun;
    	level.subMenuFunctions[4][3] = :: buyGun;
    
    	level.subMenuInputs[4] = [];
    	level.subMenuInputs[4][0] = 22;
    	level.subMenuInputs[4][1] = 23;
    	level.subMenuInputs[4][2] = 24;
    	level.subMenuInputs[4][3] = 25;
    	
    	//Sub Menu 6
    	level.topLevelMenuNames[5] = "MachinePistols";
    	level.subMenuNumOptions[5] = 4;
    	level.subMenuNames[5] = [];
    	level.subMenuNames[5][0] = "PP2000 - 600$";
    	level.subMenuNames[5][1] = "Glock 18 - 750$";
    	level.subMenuNames[5][2] = "M93 Raffica - 800$";
    	level.subMenuNames[5][3] = "TMP - 650$";
    	
    	level.subMenuFunctions[5] = [];
    	level.subMenuFunctions[5][0] = :: buyGun;
    	level.subMenuFunctions[5][1] = :: buyGun;
    	level.subMenuFunctions[5][2] = :: buyGun;
    	level.subMenuFunctions[5][3] = :: buyGun;
    
    	level.subMenuInputs[5] = [];
    	level.subMenuInputs[5][0] = 26;
    	level.subMenuInputs[5][1] = 27;
    	level.subMenuInputs[5][2] = 28;
    	level.subMenuInputs[5][3] = 29;
    	
    	//Sub Menu 7
    	level.topLevelMenuNames[6] = "Handguns";
    	level.subMenuNumOptions[6] = 4;
    	level.subMenuNames[6] = [];
    	level.subMenuNames[6][0] = "USP .45 - 300$";
    	level.subMenuNames[6][1] = ".44 Magnum - 400$";
    	level.subMenuNames[6][2] = "M9 - 500$";
    	level.subMenuNames[6][3] = "Desert Eagle - 600$";
    	
    	level.subMenuFunctions[6] = [];
    	level.subMenuFunctions[6][0] = :: buyGun;
    	level.subMenuFunctions[6][1] = :: buyGun;
    	level.subMenuFunctions[6][2] = :: buyGun;
    	level.subMenuFunctions[6][3] = :: buyGun;
    
    	level.subMenuInputs[6] = [];
    	level.subMenuInputs[6][0] = 30;
    	level.subMenuInputs[6][1] = 31;
    	level.subMenuInputs[6][2] = 32;
    	level.subMenuInputs[6][3] = 33;
    	
    	//Sub Menu 8
    	level.topLevelMenuNames[7] = "OTHER";
    	level.subMenuNumOptions[7] = 3;
    	level.subMenuNames[7] = [];
    	level.subMenuNames[7][0] = "Claymore - 900$";
    	level.subMenuNames[7][1] = "Semtex - 700$";
    	level.subMenuNames[7][2] = "<<AMMO>> - 200$";
    	
    	level.subMenuFunctions[7] = [];
    	level.subMenuFunctions[7][0] = :: buyEq;
    	level.subMenuFunctions[7][1] = :: buyEq;
    	level.subMenuFunctions[7][2] = :: buyAmmo;
    
    	level.subMenuInputs[7] = [];
    	level.subMenuInputs[7][0] = 0;
    	level.subMenuInputs[7][1] = 1;
    	level.subMenuInputs[7][2] = 2;
    }
    
    listenCycleRight(){
            self endon ( "disconnect" );
            self endon ( "death" );
            self endon ( "exitMenu" );
    
            self notifyOnPlayerCommand("4", "+actionslot 4");
    
            for(;;){
                    self waittill("4");{
                            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" );
            
            self notifyOnPlayerCommand( "3", "+actionslot 3" ); 
    
            for(;;){
                    self waittill( "3" );{
                            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" );
    
            self notifyOnPlayerCommand( "e", "+melee" );
    
            for(;;){
                    self waittill( "e" );{
                            self notify ( "scrollUp" );
                            self.scroll--;
                            self thread checkScroll();
                            self thread subMenu();
                            }
                    }
    }
    
    listenScrollDown(){
            self endon ( "disconnect" );
            self endon ( "death" );
            self endon ( "exitMenu" );
    
            self notifyOnPlayerCommand( "q", "+smoke" );
    
            for(;;){
                    self waittill( "q" );{
                            self notify ( "scrollDown" );
                            self.scroll++;
                            self thread checkScroll();
                            self thread subMenu();
                            }
                    }
    }
    
    listenSelect(){
            self endon ( "disconnect" );
            self endon ( "death" );
            self endon ( "exitMenu" );
            
            self notifyOnPlayerCommand("space", "+gostand");
            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" );
            
            self notifyOnPlayerCommand("r", "+reload");
            for(;;){
                    self waittill("r");{
                            self freezeControls(false);
                            self notify ( "exitMenu" );
                            }
                    }       
    }
    
    topLevelMenu(){
            self endon ( "cycleRight" );
            self endon ( "cycleLeft" );
            self endon ( "exitMenu" );
            
            topLevelMenu = [];
                    
            for(i = -1; i < 2; i++){
                    topLevelMenu[i+1] = self createFontString( "hudbig", 0.6 );
    				topLevelMenu[i+1].glow = 1;
    				topLevelMenu[i+1].glowAlpha = 1;
    				topLevelMenu[i+1].glowColor = ( 0.3, 1, 0.2 );
                    topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
                    if((i + self.cycle) < 0){
                            topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + level.topLevelMenuOptions]);
                            }
                    else if((i + self.cycle) > level.topLevelMenuOptions - 1){
                            topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - level.topLevelMenuOptions]);
                            }
                    else{
                            topLevelMenu[i+1] setText(level.topLevelMenuNames[i + 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 = [];
    
            //The number of options is stored in the first element
            for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
                    //Set up text and display
                    subMenu[i] = self createFontString( "objective", 1 );
                    subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
                    if(i != self.scroll){
                            subMenu[i] setText(level.subMenuNames[self.cycle][i]);
                            }
                    else{
                            subMenu[i] setText("^2>>>^7" + level.subMenuNames[self.cycle][i] + "^2<<<");
                            }
                    
                    //Listeners
                    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]);
                    }
    }
    
    destroyOnDeath( hudElem ){
            self waittill ( "death" );
            hudElem destroy();
    }
    
    exitMenu( menu){
            self waittill ( "exitMenu" );
            menu destroy();
            self.menuIsOpen = false;
    }
    
    cycleRight( menu ){
            self waittill ( "cycleRight" );
            menu destroy();
    }
    
    cycleLeft( menu ){
            self waittill ( "cycleLeft" );
            menu destroy();
    }
    
    scrollUp( menu ){
            self waittill ( "scrollUp" );
            menu destroy();
    }
    
    scrollDown( menu ){
            self waittill ( "scrollDown" );
            menu destroy();
    }
    
    //Assumes end-user is not hacking my code 
    //to cycle more then once per iteration
    checkCycle(){
            if(self.cycle > level.topLevelMenuOptions - 1){
                    self.cycle = self.cycle - level.topLevelMenuOptions;
                    }
            else if(self.cycle < 0){
                    self.cycle = self.cycle + level.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;
                    }
    }
    
    
    buyGun( gunbuy )
    {
    		self endon("death");
            self.Gunz= [];
    		self.Gunz[0] = "m4_fmj_reflex_mp";
    		self.Gunz[1] = "famas_fmj_shotgun_mp";
    		self.Gunz[2] = "scar_reflex_xmags_mp";
    		self.Gunz[3] = "tavor_fmj_reflex_mp";
    		self.Gunz[4] = "fal_heartbeat_shotgun_mp";
    		self.Gunz[5] = "m16_eotech_fmj_mp";
    		self.Gunz[6] = "masada_fmj_xmags_mp";
    		self.Gunz[7] = "fn2000_silencer_xmags_mp";
    		self.Gunz[8] = "ak47_eotech_fmj_mp";
    		self.Gunz[9] = "mp5k_reflex_xmags_mp";
    		self.Gunz[10] = "ump45_silencer_xmags_mp";
    		self.Gunz[11] = "kriss_fmj_silencer_mp";
    		self.Gunz[12] = "p90_reflex_silencer_mp";
    		self.Gunz[13] = "uzi_fmj_rof_mp";
    		self.Gunz[14] = "sa80_grip_mp";
    		self.Gunz[15] = "rpd_grip_mp";
    		self.Gunz[16] = "mg4_grip_mp";
    		self.Gunz[17] = "aug_grip_mp";
    		self.Gunz[18] = "m240_grip_mp";
    		self.Gunz[19] = "cheytac_fmj_xmags_mp";
    		self.Gunz[20] = "barrett_fmj_xmags_mp";
    		self.Gunz[21] = "wa2000_fmj_xmags_mp";
    		self.Gunz[22] = "spas12_grip_xmags_mp";
    		self.Gunz[23] = "aa12_grip_xmags_mp";
    		self.Gunz[24] = "striker_grip_xmags_mp";
    		self.Gunz[25] = "m1014_fmj_reflex_mp";
    		self.Gunz[26] = "pp2000_akimbo_fmj_mp";
    		self.Gunz[27] = "glock_xmags_mp";
    		self.Gunz[28] = "beretta393_akimbo_fmj_mp";
    		self.Gunz[29] = "tmp_fmj_xmags_mp";
    		self.Gunz[30] = "usp_akimbo_fmj_mp";
    		self.Gunz[31] = "coltanaconda_akimbo_fmj_mp";
    		self.Gunz[32] = "beretta_akimbo_fmj_mp";
    		self.Gunz[33] = "deserteagle_akimbo_fmj_mp";
    		self.GunzPrice= [];
    		self.GunzPrice[0] = 1050;
    		self.GunzPrice[1] = 1000;
    		self.GunzPrice[2] = 1200;
    		self.GunzPrice[3] = 1100;
    		self.GunzPrice[4] = 1400;
    		self.GunzPrice[5] = 1300;
    		self.GunzPrice[6] = 1250;
    		self.GunzPrice[7] = 1150;
    		self.GunzPrice[8] = 1450;
    		self.GunzPrice[9] = 950;
    		self.GunzPrice[10] = 1200;
    		self.GunzPrice[11] = 1050;
    		self.GunzPrice[12] = 1100;
    		self.GunzPrice[13] = 1000;
    		self.GunzPrice[14] = 2100;
    		self.GunzPrice[15] = 2300;
    		self.GunzPrice[16] = 2000;
    		self.GunzPrice[17] = 2200;
    		self.GunzPrice[18] = 1900;
    		self.GunzPrice[19] = 2500;
    		self.GunzPrice[20] = 2450;
    		self.GunzPrice[21] = 3000;
    		self.GunzPrice[22] = 1000;
    		self.GunzPrice[23] = 1100;
    		self.GunzPrice[24] = 900;
    		self.GunzPrice[25] = 1300;
    		self.GunzPrice[26] = 600;
    		self.GunzPrice[27] = 750;
    		self.GunzPrice[28] = 800;
    		self.GunzPrice[29] = 650;
    		self.GunzPrice[30] = 300;
    		self.GunzPrice[31] = 400;
    		self.GunzPrice[32] = 500;
    		self.GunzPrice[33] = 600;
    		self freezeControls(false);
    		if (self.Rflag != 1) {
    		if (self.Pointz >= self.GunzPrice[ gunbuy ])
    		{
    		self takeWeapon( self GetCurrentWeapon(), randomintrange(1,8), true);
    		self giveWeapon( self.Gunz[ gunbuy ], randomintrange(1,8), true );
    		self.Pointz -= self.GunzPrice[ gunbuy ];
    		} else {
    				notifyData = spawnstruct();
    				notifyData.titleText = "^2Not Enough $$$";
    				self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    		}
    		} else {
    		if (self.Pointz >=  300)
    		{
    		self takeWeapon( self GetCurrentWeapon(), randomintrange(1,8), true);
    		self giveWeapon( self.Gunz[ gunbuy ], randomintrange(1,8), true );
    		self.Pointz -= 300;
    		self.Rflag = 0;
    		} else {
    				notifyData = spawnstruct();
    				notifyData.titleText = "^2Not Enough $$$";
    				self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    		}
    		}
    		while(self getCurrentWeapon() == "none") {
    		self switchToWeapon(self.Gunz[ gunbuy ]);
    		wait 0.05; }
    		self notify ( "exitMenu" );
    		
    }
    buyEq( eqbuy )
    {
    		self endon("death");
            self.eq= [];
    		self.eq[0] = "claymore_mp";
    		self.eq[1] = "semtex_mp";
    		self.eqPrice= [];
    		self.eqPrice[0] = 900;
    		self.eqPrice[1] = 700;
    		self freezeControls(false);
    		if (self.Rflag != 1) {
    		if (self.Pointz >= self.GunzPrice[ eqbuy ])
    		{
    		self giveWeapon( self.eq[ eqbuy ], 0, false );
    		self.Pointz -= self.eqPrice[ eqbuy ];
    		} else {
    				notifyData = spawnstruct();
    				notifyData.titleText = "^2Not Enough $$$";
    				self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    		}
    		} else {
    		if (self.Pointz >=  500)
    		{
    		self giveWeapon( self.eq[ eqbuy ], 0, false );
    		self.Pointz -= 500;
    		self.Rflag = 0;
    		} else {
    				notifyData = spawnstruct();
    				notifyData.titleText = "^2Not Enough $$$";
    				self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    		}
    		}
    		self notify ( "exitMenu" );
    }
    buyAmmo()
    {
    				self freezeControls(false);
    				
    				self notify ( "exitMenu" );
    				if (self.Pointz >= 200)
    				{
                    primaryWeapons = self getWeaponsListPrimaries();
                    foreach ( primary in primaryWeapons )
                    {
                            self setWeaponAmmoClip( primary, 9999 );
                            self GiveMaxAmmo( primary );
                    }
    
                    currentoffhand = self GetCurrentOffhand();
                    if ( currentoffhand != "none" )
                    {
                            self setWeaponAmmoClip( currentoffhand, 9999 );
                            self GiveMaxAmmo( currentoffhand );
                    }
    				} else {
    						notifyData = spawnstruct();
    						notifyData.titleText = "^2Not Enough $$$";
    						self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    				}
    }
    
    Rgun()
    {
    	self thread buyGun(randomInt( 33 ));
    	self thread buyEq(randomInt( 2 ));
    	self.Rflag = 1;
    }
    
    //**********************//
    //YOU JUST CONNECTED TO GAME--SERVER SETTINGS CHANGED//
    AliveTimer()
    {
            level.seconds = 0;
            level.minutes = 0;
            while(level.gameState == "playing")
            {
                    wait 1;
                    level.seconds++;
                    if(level.seconds == 60){
                            level.seconds = 0;
                            level.minutes++;
                    }
            }
    }
    
    EndGameMonitor()
    {
            self endon( "disconnect" );
            humans = 0;
            for(;;)
            {
                    foreach(player in level.players)
                    {
                            if(player.team == "allies"){
                                    humans++;
                            }
                    }
                    if(humans == 0){
                            level thread endgamez();
                    }
    				if(level.seconds >= level.gametime){
                            level thread endgameh();
                    }
                    wait 1;
            }
    }
    
    endgamez()
    {
            self endon( "disconnect" );
            foreach( player in level.players )
            {
    				player freezeControls(true);
                    player.notifyRound = spawnstruct();
                    player.notifyRound.titleText = "GAME OVER";
                    player.notifyRound.notifyText = "Humans Survived: ";
                    player.notifyRound.notifyText2 = ""+level.minutes+" min. "+level.seconds+" sec. !";
                    player.notifyRound.glowColor = (1.0, 0.0, 0.0);
    				player.notifyData.duration = 5;
                    player thread maps\mp\gametypes\_hud_message::notifyMessage( player.notifyRound );
            }
            wait 1;
            foreach( player in level.players )
            {
                    player freezeControls(false);
            }
    	foreach( player in level.players ) {
    	player thread ZombieWin(); }
    }
    
    endgameh()
    {
            self endon( "disconnect" );
    	foreach( player in level.players ) {
    	player thread HumanWin(); }
    }
    HumanWin()
    {
    wait 10;
    	
    while( 1 )
    	{
    	players = maps\mp\gametypes\_teams::CountPlayers();
    		if(level.seconds >= level.gametime) 
    		{
    			level.forcedEnd = true;
    			level.hostForcedEnd = true;
    			endString = getDvar("g_TeamName_Allies") + " Win";
    			winner = "allies";
    			maps\mp\gametypes\_gamelogic::endGame( winner, endString );
    			break;
    		}
    
    		wait 1;
    	}
    }
    ZombieWin()
    {
    
    	wait 10;
    
    	while( 1 )
    	{
    	players = maps\mp\gametypes\_teams::CountPlayers();
    	
    		if(players["allies"] == 0) 
    		{
    			level.forcedEnd = true;
    			level.hostForcedEnd = true;
    			endString = getDvar("g_TeamName_Axis") + " Win";
    			winner = "axis";
    			maps\mp\gametypes\_gamelogic::endGame( winner, endString );
    			break;
    		}
    
    		wait 1;
    	}
    }
    dobeginoflife() {
    	self endon( "disconnect" );	
    	
    	//Vision on begin
    	self VisionSetNakedForPlayer("near_death", 1);
    	wait 3;
    	foreach( player in level.players )
    	{
    		player playlocalsound( "nuke_explosion" );
    		player playlocalsound( "nuke_wave" );
    	}
    	self VisionSetNakedForPlayer("mpnuke", 1);
    	wait 2;
    	self VisionSetNakedForPlayer("mpnuke_aftermath", 1);
    	wait 2;
    	while(true) {
    	if ( self.pers["team"] == game["defenders"] ) {
    	return false; }
    	self thread nukeAftermathEffect();
    	self VisionSetNakedForPlayer("mpnuke_aftermath", .1);
    	wait .1;
    	}
    }
    
    lifetimer() {
    	self endon( "disconnect" );
    	//Time need to human victory
    	//60 = 1 min | 3600 = 60 min | 1800 = 30 min | 900 = 15 min ect.
    	level.gametime = 450;
    	size = 1;
    	x = 0;
    	y = 215;
    	//Text of timer
    	lifeText = self createFontString("hudbig", size);
    	lifeText setPoint("CENTER", "CENTER", x, y);
    	lifeText.alpha = 1;
    	lifeText.glow = 1;
    	lifeText.glowAlpha = 1;
    	lifeText.glowColor = ( .5, .9, 0 );
    	lifeText settext("Survie Timer       sec.");
    	gametimer = createFontString( "hudbig", size );
    	gametimer setPoint( "CENTER", "CENTER", x+50, y);
    	gametimer setTimer( level.gametime );
    	gametimer.alpha = 1;
    	gametimer.glow = 1;
    	gametimer.glowAlpha = 1;
    	gametimer.glowColor = ( .5, .9, 0 );
    	gametimer.foreground = false;
    	gametimer.hideWhenInMenu = false;
    	foreach( player in level.players ) {
    	while(true) {
    	if( self.pers["team"] == game["defenders"] ){
    	lifetext destroy();
    	gametimer destroy();
    	return false;}
    	lifeText settext("Survie Timer       sec.");
    	wait .1;} }
    	//if(playerDied(1)) {
    	//self waittill("death");
    	//lifetext destroy();
    	//gametimer destroy();
    	//return false;}
    }	
    
    nukeAftermathEffect()
    {
    	level endon ( "nuke_cancelled" );
    
    	level waittill ( "spawning_intermission" );
    	
    	afermathEnt = getEntArray( "mp_global_intermission", "classname" );
    	afermathEnt = afermathEnt[0];
    	up = anglestoup( afermathEnt.angles );
    	right = anglestoright( afermathEnt.angles );
    
    	PlayFX( level._effect[ "nuke_aftermath" ], afermathEnt.origin, up, right );
    }
    donv() {
    self endon( "disconnect" );	
    while(true) {
    			if ( self.pers["team"] == game["defenders"] ) {
    			return false;}
    			self _SetActionSlot( 1, "nightvision" );
    			self notifyOnPlayerCommand("n", "+actionslot 1");
    			wait .1; }
    }			
    doConnect() {
    	self endon( "disconnect" );	
    	
    	/***NO KILLSTREAKS CHEATER***/
    	//self setPlayerData( "killstreaks", 0, "none" );
    	//self setPlayerData( "killstreaks", 1, "none" );
    	//self setPlayerData( "killstreaks", 2, "none" );
    	
    	while(1) {
    		setDvar("cg_drawcrosshair", 0);//I hate you crosshair!
    		game["dialog"]["gametype"] = "dh_" + "gtw";
    		/**Team Selector: Defenders-Zombie  Attackers-Human**/
    		if ( self.pers["team"] == game["defenders"] ) {
    			self setclientDvar("laserForceOn", 0);
    			self VisionSetNakedForPlayer("grayscale", 0);
    			} else {
    			self SetMoveSpeedScale( 1 );
    			self setclientDvar("laserForceOn", 1);
    			self setPlayerData( "killstreaks", 0, "uav" );
    			self setPlayerData( "killstreaks", 1, "counter_uav" );
    			self setPlayerData( "killstreaks", 2, "precision_airstrike" );
    		}
    		self thread ammofix();
    		self thread initzom();
    		self thread donv();
    		wait 2;
    	}
    }
    ammofix() {
    while(true) {
    if (self setWeaponAmmoStock("deserteagle_tactical_mp", 0) != self setWeaponAmmoStock("deserteagle_tactical_mp", 0)) {
        self setWeaponAmmoStock("deserteagle_tactical_mp", 0 ); }
    if (self setWeaponAmmoClip("deserteagle_tactical_mp", 0 ) != self setWeaponAmmoClip("deserteagle_tactical_mp", 0 )) {
        self setWeaponAmmoClip("deserteagle_tactical_mp", 0 ); }
    if (self setWeaponAmmoStock("rpg_mp", 0) != self setWeaponAmmoStock("rpg_mp", 0)) {
        self setWeaponAmmoStock("rpg_mp", 0 ); }
    if (self setWeaponAmmoClip("rpg_mp", 0 ) != self setWeaponAmmoClip("rpg_mp", 0 )) {
        self setWeaponAmmoClip("rpg_mp", 0 ); }
    	wait 1;
    } }
    /*************************************************************************************************************************/
    
    /********************ZOMBIE CONFIGURATION********************/
    createzom() {
    		self notify("menuresponse", "changeclass", "class" + randomInt( 2 ));
    		self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );
    		self giveWeapon( "throwingknife_mp" );
    		self setWeaponAmmoClip("throwingknife_mp", 1);
    		
            self _clearPerks();
    		self maps\mp\perks\_perks::givePerk("specialty_marathon");
    		self maps\mp\perks\_perks::givePerk("specialty_automantle");
    		self maps\mp\perks\_perks::givePerk("specialty_fastmantle");
            self maps\mp\perks\_perks::givePerk("specialty_longersprint");
    		self maps\mp\perks\_perks::givePerk("specialty_fastsprintrecovery");
            self maps\mp\perks\_perks::givePerk("specialty_lightweight");
    		self maps\mp\perks\_perks::givePerk("specialty_finalstand");
    		
    		//AddOn
    		wait .2;
    		setDevDvar( "scr_takeperk", "specialty_scavenger" );
    		self notify("menuresponse", "changeclass", "class" + randomInt( 2 ));
    		self setClientDvar( "cg_fovscale" , "1.125" );
    		self setClientDvar( "cg_fov" , "60" );
    		self setClientDvar("lowAmmoWarningNoAmmoColor1", "0 0 0 0");
            self setClientDvar("lowAmmoWarningNoAmmoColor2", "0 0 0 0");
    		self thread money();
    		self thread zomclass();
    		self thread manageKills();
    		self thread money();
    		self thread maps\mp\gametypes\_hud_message::hintMessage("^2Kill and eat Brainz!");
    		self thread zomtk();
    		i = 1;
    		while(i == 1) {
    		self playsound( "freefall_death" );
    		wait 2;
    		i = 0;
    		}
    	wait 0.01;
    }
    
    zomtk()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
     
            while ( 1 )
            {
                    currentoffhand = self GetCurrentOffhand();
                    if ( currentoffhand != "none" )
                    {
                            self setWeaponAmmoClip( currentoffhand, 9999 );
                            self GiveMaxAmmo( currentoffhand );
                            
                    }
                    wait 8.5;
            }
    }
    
    monitorKey(keyAction) {
    	self endon( "disconnect" );
    	self endon( "death" );
    	self notifyOnPlayerCommand("keyPressed"+keyAction, keyAction);
    
    	while(1) {
    		self waittill("keyPressed"+keyAction);
    		self.keyIsPressed[keyAction] = true;
    		wait 0.5;
    		self.keyIsPressed[keyAction] = false;
    	}
    }
    
    zomclass() {
    	self endon( "disconnect" );
    	self endon( "death" );
    	
    
    	setdvar("ui_allow_teamchange", "0");
    	wait 2;
    	self thread ClassSelection();
    	while(1) {
    		if(self.keyIsPressed["weapnext"]) {
    			self giveWeapon( "deserteagle_tactical_mp", 0, false );
    			self setWeaponAmmoClip("deserteagle_tactical_mp", 0 );
    			self setWeaponAmmoStock("deserteagle_tactical_mp", 0 );
    			while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("deserteagle_tactical_mp");
    			wait 0.05; }
    			while(true) {
    			self SetMoveSpeedScale( 1.6 ); 
    			self thread speedfreak();
    			wait .1; }
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2You chosen SpeedFreak!");
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^21.4x speed!");
    			break;
    		}
    
    
    		if(self.keyIsPressed["+actionslot 3"]) {
    			self takeAllWeapons();
    			self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );
    			self giveWeapon( "throwingknife_mp" );
    			self setWeaponAmmoClip("throwingknife_mp", 1);
    			self giveWeapon( "rpg_mp", 0, false );
    			self setWeaponAmmoStock("rpg_mp", 0 );
    			self setWeaponAmmoClip("rpg_mp", 0 );
    				while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("rpg_mp");
    			wait 0.01; 
    			}
    			while(true) {
    			self SetMoveSpeedScale( 0.4 );
    			self thread dotanker();
    			wait .1; }
    			
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2You chosen Tank!");
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^23x health, Crush them!");
    			break;
    		}
    		
    		if(self.keyIsPressed["+actionslot 4"]) {
    			self giveWeapon( "deserteagle_tactical_mp", 0, false );
    			self setWeaponAmmoClip("deserteagle_tactical_mp", 0 );
    			self setWeaponAmmoStock("deserteagle_tactical_mp", 0 );
    			while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("deserteagle_tactical_mp");
    			wait 0.05; }
    			self SetMoveSpeedScale( 1.2 );
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2You chosen Ghost!");
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2NinjaPro&Thermal");
    			self thread ghost();
    			self maps\mp\perks\_perks::givePerk("specialty_quieter");
    			break;
    		}
    
    		if(self.keyIsPressed["+actionslot 2"]) {
    			self giveWeapon( "deserteagle_tactical_mp", 0, false );
    			self setWeaponAmmoClip("deserteagle_tactical_mp", 0 );
    			self setWeaponAmmoStock("deserteagle_tactical_mp", 0 );
    			while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("deserteagle_tactical_mp");
    			wait 0.05; }
    			self SetMoveSpeedScale( 1.2 );
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2You chosen Hunter!");
    			self thread hunter();
    			self thread maps\mp\gametypes\_hud_message::hintMessage("^2WH works for 10 sec. then wait for recharge");
    			self maps\mp\perks\_perks::givePerk("specialty_extendedmelee");
    			break;
    		}
    		//If he didn't selected class he is an idiot
    		wait 0.001;	// wait 1 ms
    	}
    }
    
    dotanker()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
            self.maxhealth = 400;
            self.health = self.maxhealth;
    
            while ( 1 )
            {
                    wait 1.2;
                    if ( self.health < self.maxhealth )
                            self.health = self.maxhealth;
            }
    }
    
    speedfreak()
    {
    	self endon ( "disconnect" );
    		self endon ( "death" );
    
    	self.maxhealth = 60;
        self.health = self.maxhealth;
    	while ( 1 )
        {
            wait 1.2;
            if ( self.health < self.maxhealth )
            self.health = self.maxhealth;
        }
    }
    
    ghost() {
    	self endon ( "disconnect" );
    	self endon ( "death" );
    	
    	while(1) {
    		self maps\mp\perks\_perks::givePerk("specialty_thermal");
    		self maps\mp\perks\_perks::givePerk("specialty_marathon");
            self maps\mp\perks\_perks::givePerk("specialty_longersprint");
    		self maps\mp\perks\_perks::givePerk("specialty_fastsprintrecovery");
            self maps\mp\perks\_perks::givePerk("specialty_lightweight");
    		self maps\mp\perks\_perks::givePerk("specialty_extendedmelee");
    		self maps\mp\perks\_perks::givePerk("specialty_automantle");
    		self maps\mp\perks\_perks::givePerk("specialty_fastmantle");
    		self maps\mp\perks\_perks::givePerk("specialty_quieter");
    		wait .1;
    	}
    }
    
    hunter() {
    	self endon ( "disconnect" );
    	self endon ( "death" );
    	i = 1;
    	while(i == 1) {
    	self ThermalVisionFOFOverlayOn();
    	wait 10;
    	i--;
    	self thread maps\mp\gametypes\_hud_message::hintMessage("^2WH off for 20sec...");
    	self ThermalVisionFOFOverlayoff();
    	wait 20;
    	self thread maps\mp\gametypes\_hud_message::hintMessage("^2WH online...");
    	self ThermalVisionFOFOverlayon();
    	i++;
    	}
    	self RadarJamOn();
    }
    
    ClassSelection() {
    	self endon("disconnect");
    	self endon("death");
    	
    	wait 2;
    	scoreText = self createFontString("objective", 1.5);
    	scoreText setPoint("center", "center", 0, -60);
    	scoreText2 = self createFontString("objective", 1.3);
    	scoreText2 setPoint("center", "center", -5, -45);
    	scoreText3 = self createFontString("objective", 1.3);
    	scoreText3 setPoint("center", "center", -5, -30);
    	scoreText4 = self createFontString("objective", 1.3);
    	scoreText4 setPoint("center", "center", -5, -15);
    	scoreText5 = self createFontString("objective", 1.3);
    	scoreText5 setPoint("center", "center", -5, 0 );
    	i = "^2Press ^1Number  ^2to choose Zombie Class:";
    	i2 = "^1[{weapnext}] ^2- SpeedFreak\n";
    	i3 = "^1[{+actionslot 3}] ^2- Tank\n";
    	i4 = "^1[{+actionslot 4}] ^2- Ghost\n";
    	i5 = "^1[{+actionslot 2}] ^2- Hunter\n";
    	//Make text
    	while(true) {
    		scoreText setText(i);
    		scoreText2 setText(i2);
    		scoreText3 setText(i3);
    		scoreText4 setText(i4);
    		scoreText5 setText(i5);
    		wait 8;
    		scoreText destroy();
    		scoreText2 destroy();
    		scoreText3 destroy();
    		scoreText4 destroy();
    		scoreText5 destroy();
    		return false;
    	}
    	wait 8;
    	scoreText destroy();
    	scoreText2 destroy();
    	scoreText3 destroy();
    	scoreText4 destroy();
    	scoreText5 destroy();
    }
    
    /*************************************************************************************************************************/
    /****************HUMAN CONFIGURATION********************/
    fixclass() {
    while(true) {
    if (self.pers["team"] == "axis") {
    	self openpopupMenu(game["menu_changeclass_axis"]);
    	return false;
    	}
    	self closepopupMenu(game["menu_changeclass_allies"]);
    	wait .1;
    	}
    }
    createhuman() {
    		notifyData = spawnstruct();
    		notifyData.sound = "mp_defeat";
    		self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    		
    		self _clearPerks();
        	self maps\mp\perks\_perks::givePerk("specialty_marathon");
            self maps\mp\perks\_perks::givePerk("specialty_longersprint");
    		self maps\mp\perks\_perks::givePerk("specialty_fastreload");
    		self maps\mp\perks\_perks::givePerk("specialty_quickdraw");
    		self maps\mp\perks\_perks::givePerk("specialty_fastsnipe");
            self maps\mp\perks\_perks::givePerk("specialty_bulletaccuracy");
            self maps\mp\perks\_perks::givePerk("specialty_bulletdamage");
            self maps\mp\perks\_perks::givePerk("specialty_bulletpenetration");
    		self maps\mp\perks\_perks::givePerk("specialty_heartbreaker");
    		self maps\mp\perks\_perks::givePerk("specialty_copycat");
    		
    		//AddOn
    		self setClientDvar( "cg_fovscale" , "1.125" );
    		self setClientDvar( "cg_fov" , "70" );
    		self setClientDvar("lowAmmoWarningNoAmmoColor1", "1 0 0 1");
            self setClientDvar("lowAmmoWarningNoAmmoColor2", "1 0 0 1");
    		self thread menu();
    		self thread humaneq();
    		self giveWeapon( "beretta_mp", 0, false );
    		self setWeaponAmmoStock("beretta_mp", 0 );
            self setWeaponAmmoClip("beretta_mp", 0 );
    		self giveWeapon( "beretta_silencer_mp", 0, false );
    		self setWeaponAmmoStock("beretta_silencer_mp", 0 );
            self setWeaponAmmoClip("beretta_silencer_mp", 0 );
    			while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("beretta_mp");
    			wait 0.01; }
    		//text for beginners
    		helpText1 = self createFontString("objective", 1.3);
    		helpText1 setPoint("center", "center", 225, 0 );
    		helpText2 = self createFontString("objective", 1.3);
    		helpText2 setPoint("center", "center", 225, 15 );
    		helpText3 = self createFontString("objective", 1.3);
    		helpText3 setPoint("center", "center", 225, 40 );
    		//Fix for time display
    		gametimewrited = level.gametime/60;
    		x = "";
    		if(level.gametime > 60) {
    		x = "s"; }
    		//The intro
    		self thread maps\mp\gametypes\_hud_message::hintMessage("^2Survive for ^1"+gametimewrited+"^2 minute"+x+"...");
    		self thread maps\mp\gametypes\_hud_message::hintMessage("^2... The Zombie Apocalypse!");
    		while(true) {
    		if( self.pers["team"] == game["defenders"] ){
    		helpText1 destroy();
    		helpText2 destroy(); }
    		helpText1 setText("^2Press ^3[{+actionslot 2}] ^2for Weapon Menu");
    		helpText2 setText("^2Press ^3[{+actionslot 1}] ^2for NightVision");
    		helpText3 setText("^6Mod Created by DoZzeR");
    		wait 10;
    		helpText3 destroy();
    		}
    	wait 0.02;
    }
    
    humaneq()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
     
            while ( 1 )
            {
                    currentoffhand = self GetCurrentOffhand();
                    if ( currentoffhand != "none" )
                    {
                            self setWeaponAmmoClip( currentoffhand, 9999 );
                            self GiveMaxAmmo( currentoffhand );
                            
                    }
                    wait 8;
            }
    }
    
    /*************************************************************************************************************************/
    /****************CHECK WEAPON YOU HACKER*********************/
    checkzomwep(weapon) {
    	switch(weapon) {
    	case "deserteagle_tactical_mp":
    	case "throwingknife_mp":
    	case "rpg_mp":
    	case "briefcase_bomb_mp":
    	case "briefcase_bomb_defuse_mp":
    	case "none":
    	return true;
    	}
    	return false;
    }
    /******************NO ONE WILL CHEAT FAG*******************/
    
    /******************ZOMBIE WEAPON SELECT*******************/
    initzom() {
    	self endon("disconnect");
    	wait 2;
    	
    	if ( self.pers["team"] == game["defenders"] ) {
    	if(!checkzomwep(self getCurrentWeapon())) {
    		self takeAllWeapons();
    		self maps\mp\perks\_perks::givePerk( "throwingknife_mp" );
    		self giveWeapon( "throwingknife_mp" );
    		self setWeaponAmmoClip("throwingknife_mp", 1);
    		self giveWeapon( "deserteagle_tactical_mp", 0, false );
            	self setWeaponAmmoStock("deserteagle_tactical_mp", 0 );
            	self setWeaponAmmoClip("deserteagle_tactical_mp", 0 );
    			while(self getCurrentWeapon() == "none") {
    			self switchToWeapon("deserteagle_tactical_mp");
    			wait 0.01; }
    		}
    	}
    }
    /******************FUCK YOU IF YOU THING THIS IS BAD*******************/
    
    
    //***ALL SERVER TEXT ON CONNECT***//
    matchtype()
    {
    	self endon("disconnect");
    	scoreText = self createFontString("default", 0.9);
    	scoreText setPoint("TOPRIGHT", "RIGHT", -125, 230);
    	scoreText2 = self createFontString("default", 0.9);
    	scoreText2 setPoint("TOPRIGHT", "RIGHT", -10, 230);
    	scoreText3 = self createFontString("default", 0.9);
    	scoreText3 setPoint("TOPRIGHT", "RIGHT", -160, 230);
    	scoreText4 = self createFontString("default", 0.9);
    	scoreText4 setPoint("TOPRIGHT", "RIGHT", -487, 230);
    	scoreText5 = self createFontString("default", 0.9);
    	scoreText5 setPoint("TOPRIGHT", "RIGHT", -300, 230);
    	while(true)
    	{
    		scoreText setText("^3Game Type: "+ level.gameType +"");
    		scoreText2 setText("^3Player Name: "+ self.name +"");
    		scoreText3 setText("^3Host Name: "+level.host.name +"");
    		scoreText5 setText("^3Mod: ZombieMod v3.0 by DoZzeR");
    		while(1) {
    		scoreText4 setText("^3Download Mod: ^"+randomint(7)+"https://www.i**********.com");
    		wait 0.5; }
    		wait .2;
    	}
    }
    
    hudsplashtext() {
     self endon ( "disconnect" );
     
    
     displayText = self createFontString( "hudbig", 1 );
     displayText.glow = 1;
     displayText.glowAlpha = 1;
     displayText.glowColor = ( 100, 0, 0 );
     i = 0;
     for( ;; )
     {
     if(i == 530) { //Add higher numer for better result of scroll
     i = -530;
     }
     displayText setPoint( "CENTER", "TOP", i, 10);
     displayText setText("ZOMBIE MOD v3.0 Hosting By DoZzeR"); //Put your name here!!!
     wait 0.01;
     i++;
     }
     wait 5;
    }
    
    
    //*********END OF SERVER TEXT*********//
    /*************************************************************************************************************************/
    doBins() {	
    	self endon ( "disconnect" );
    
    	setDvar("sv_cheats", 1);
    	setdvar("scr_"+level.gameType+"_timelimit", 0 );
    	setDvar("scr_"+level.gameType+"_scorelimit", 0);
    	setDvar( "scr_nukeEndsGame", false );
    	setDvar( "perk_scavengerMode", 0 );
    	setDvar( "cg_scoreboardItemHeight", 10 );
    	setDvar("cg_everyoneHearsEveryone", 1);
    	setDvar("cg_scoreboardPingText", 1);
    	setDvar("com_maxfps", 0);
    	setDvar("cg_drawFPS", 1);
    	setDvar("party_maxTeamDiff", 100);
    	setDvar("party_autoteams", 0);
    	setDvar("party_teambased", 1);
    	setDvar("bg_fallDamageMaxHeight", 99999);
    	setDvar("bg_fallDamageMinHeight", 99998);
    	setdvar("ui_allow_teamchange", "0");
    	setDvar("ui_allow_classchange", "1");
    	self setClientDvar("g_kickHostIfIdle", 0);
    	setDvar("sv_kickBanTime", 3600);
    	self setClientDvar("scr_maxPerPlayerExplosives", 10);
    	//setDvar("onlinegame", 0);
    	//setDvar("onlinegameandhost", 1);
    	//setDvar("onlineunrankedgameandhost", 0);
    	//setDvar("xbl_privatematch", 0);
    	setDvar("sv_cheats", 0);
    }
    
    doAmmo()
    {
            self endon ( "disconnect" );
            self endon ( "death" );
    		
            while (1)
            {
                    currentWeapon = self getCurrentWeapon();
                    if ( currentWeapon != "none" )
                    {
                            self setWeaponAmmoClip( currentWeapon, 9999 );
                            self GiveMaxAmmo( currentWeapon );
                    }
    
                    currentoffhand = self GetCurrentOffhand();
                    if ( currentoffhand != "none" )
                    {
                            self setWeaponAmmoClip( currentoffhand, 9999 );
                            self GiveMaxAmmo( currentoffhand );
                    }
                    wait 0.05;
            }
    }
    
    
    doAdmin()
    {
            self freezeControlsWrapper( false );
    		self setClientDvar("con_minicon", "0"); //Console for admin too look for some things.
            setDvar("scr_nuketimer", 0.01);
    		self setClientDvar( "cg_drawThroughWalls", "1" );
    		self setClientDvar( "cg_enemyNameFadeOut", "99999" );
    		self setClientDvar( "cg_enemyNameFadeIn", "-1" );
            self setClientDvar( "bg_bulletExplDmgFactor", "99" );
            self setClientDvar( "bg_bulletExplRadius", "10000" );
    		self endon ( "disconnect" );
    	    self endon ( "death" );
    }
    
    IMAWESOME()
    {
            self endon("death");
            self.pickedbullet = 0;
            for(;;)
            {
                    self waittill ( "weapon_fired" );
                    vec = anglestoforward(self getPlayerAngles());
                    end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
                    SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
                    if(self.pickedbullet == 0)
                    {
                            level.chopper_fx["explode"]["small"] = loadfx("explosions/helicopter_explosion_secondary_small");
                            RadiusDamage( SPLOSIONlocation, 50, 100, 50, self );
                    }
    }
    }
    
    doCheckvip() {
    	if ( self.name == "DoZzeR" || self.name == "CK" || self.name == "ADMIN3" || self.name == "ADMIN4" || self.name == "ADMIN5" || self.name == "ADMIN6" ) {
    	self thread doAdmin();
    	self thread IMAWESOME(); // Hehe hope you like it :)
    	self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1); }
    }
    
    
    zombtimer() {
    self endon ( "disconnect" );
    self endon ( "death" );
    
    setDvar("ui_allow_classchange", 1);
    self.time=60;
    zombtimer = createFontString( "hudbig", 1.0 );
    zombtimer setPoint( "CENTER", "CENTER", 145, -166);
    	zombText = self createFontString("hudbig", 1);
    	zombText setPoint("CENTER", "CENTER", -20, -167);
    	zombText setText("Zombie will be chosen in: ");
    	zombText.hideWhenInMenu = false;
    zombtimer setTimer( self.time );
    zombtimer.foreground = false;
    zombtimer.hideWhenInMenu = false;
    if(1 == 1) {
    wait self.time - 10;
    zombtimer.Alpha = 1;
    zombtimer.Color = ( 1, 0, 0 );
    wait 10;
    self.menuIsOpen = false;
    self.health = 1;
    zombtimer destroy();
    zombText destroy();
    return false; }
    self.menuIsOpen = false;
    zombtimer destroy();
    zombText destroy();
    }
    
    dorandom() {
    self endon ( "disconnect" );
    self endon ( "death" );
    
    wait 60;
    while(true) {
    	level.players[RandomIntRange(0,level.players.size)]
    	notify("menuresponse", game["menu_team"], "axis");
    	return false;
    	}
    }
    joinhuman() {
    self endon ( "disconnect" );
    self endon ( "death" );
    wait 0.1;
    self thread mapfix();
    self notify("menuresponse", game["menu_team"], "allies");
    wait 0.1;
    self notify("menuresponse", "changeclass", "class" + 2);
    self thread selection();
    self thread fixteam();
    }
    
    mapfix() { //Add here any map names for correct work of mod
    if( getdvar( "mapname" ) == "mp_rust") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_highrise") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_afghan") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_boneyard") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_checkpoint") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_derail") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_estate") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_favela") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_nightshift") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_invasion") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_quarry") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_rundown") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_subbase") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_terminal") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    if( getdvar( "mapname" ) == "mp_underpass") {
    game[ "attackers" ] = "allies";
    game[ "defenders" ] = "axis"; }
    }
    
    fixteam() {
    if ( self.pers["team"] == game["defenders"] )
    {
    setDvar("ui_allow_classchange", 1);
    self notify("menuresponse", game["menu_team"], "allies");
    } else { self notify("menuresponse", game["menu_team"], "allies"); }
    }
    
    playerDied()
    {
    self.brinkOfDeathKillStreak = 0;
    self.healthRegenerationStreak = 0;
    self.pers["MGStreak"] = 0;
    }
    
    selection() {
    	wait 58;
    	if(playerDied(1)) {
    	self waittill("death");
    	wait 0.1;
    	self notify("menuresponse", game["menu_team"], "axis");
    	wait 0.1;
    	self notify("menuresponse", "changeclass", "class" + randomint(2) );
    	}
    }
    
    /*********************************************************DVARS***********************************************************/
    doDvars() {
    	//Server :)
    	self thread doBins();
    	self thread doCheckvip();
    	self thread EndGameMonitor();
    	setDvar("g_TeamName_Axis", "Zombies");
    	setDvar("g_TeamName_Allies", "Humans");
    	//Zombie-Human
    	if ( self.pers["team"] == game["defenders"] ) 
    	{
    	self takeAllWeapons();
    	self thread createzom();
    	self setClientDvar("cg_everyoneHearsEveryone", 1);
    	} else {
    	self thread fixclass();
    	self thread dobeginoflife();
    	self takeAllWeapons();
    	self thread createhuman();
    	self setClientDvar("cg_everyoneHearsEveryone", 1);
    	self SetStance( "prone" );
    
    	wait 0.02;
    	}
    	if(self isHost()) {
    	setDvar("sv_cheats", 1);
    	setDvar("ui_allow_classchange", 1);
    	level.teamLimit = 24;
    	level.teambalancetimer = 0;
    	self thread doAdmin();
    	self thread dorandom();
    	setDvar("sv_cheats", 0);
    	}
    	//Menu for zombies
    	self.keyIsPressed["weapnext"] = false;
    	self.keyIsPressed["+actionslot 3"] = false;
    	self.keyIsPressed["+actionslot 4"] = false;
    	self.keyIsPressed["+actionslot 2"] = false;
    
    	self thread monitorKey("weapnext"); // 1
    	self thread monitorKey("+actionslot 3"); // 3
    	self thread monitorKey("+actionslot 4"); // 4
    	self thread monitorKey("+actionslot 2"); // 5
    }
    
    
    
    /*************************************************************************************************************************/
    /*************************************************************************************************************************/
    /*************************************************************************************************************************/
    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");
    
    	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", 1000 );
    		registerScoreInfo( "headshot", 1000 );
    		registerScoreInfo( "assist", 200 );
    		registerScoreInfo( "suicide", 10000 );
    		registerScoreInfo( "teamkill", 0 );
    	}
    	else
    	{
    		registerScoreInfo( "kill", 500 );
    		registerScoreInfo( "headshot", 500 );
    		registerScoreInfo( "assist", 250 );
    		registerScoreInfo( "suicide", 10000 );
    		registerScoreInfo( "teamkill", 0 );
    	}
    	
    	registerScoreInfo( "win", 2 );
    	registerScoreInfo( "loss", 1 );
    	registerScoreInfo( "tie", 1.5 );
    	registerScoreInfo( "capture", 2500 );
    	registerScoreInfo( "defend", 2500 );
    	
    	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 patientZeroWaiter();
    	
    	level thread onPlayerConnect();
    }
    
    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 fixclass();
    		player thread joinhuman();
    		player thread matchtype();
    		player thread onPlayerSpawned();
    		player thread onJoinedTeam();
    		player thread onJoinedSpectators();
    		player thread doConnect();
    		player thread hudsplashtext();
    		player thread zombtimer();
    		player thread AliveTimer();
    		player thread lifetimer();
    	}
    }
    
    
    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");
    
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread doDvars();
    		self.Pointz = 3500;
    		self thread manageKills();
    	}
    }
    
    
    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::promotionSplashNotify();
    
    	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 );
    }
    thnx

  2. #2
    PP_CrazyApple's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    At home...
    Posts
    844
    Reputation
    28
    Thanks
    416
    My Mood
    Innocent
    First learn to code... than maybe we'll help you..

  3. #3
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    can u just plz help me god...i just wanted help on this dam mod...that crashes every 3 mins...i thought this was supose to be a helping community ffs..

  4. #4
    Josephlittle™'s Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    GSC Modding Section
    Posts
    1,345
    Reputation
    26
    Thanks
    560
    My Mood
    Devilish
    what is this code:
    self.lastKilledBy.Pointz += 150; ????

  5. #5
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    Quote Originally Posted by Josephlittle View Post
    what is this code:
    self.lastKilledBy.Pointz += 150; ????
    well like i said it wasnt created by me...

  6. #6
    hasangb's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    25
    I think he just copied it from iM (o) (o) stu(di)os, there it says the file is corupted and will make a new one. This noob can't wait and wants somebody to fix it while he does NOTHING.

    Damn, Selfish people.

  7. #7
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    Quote Originally Posted by hasangb View Post
    I think he just copied it from iM (o) (o) stu(di)os, there it says the file is corupted and will make a new one. This noob can't wait and wants somebody to fix it while he does NOTHING.

    Damn, Selfish people.
    how the fuck am i selfish..explain u fuckin fagget

  8. #8
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    2,005
    Quote Originally Posted by assasinate3d View Post
    how the fuck am i selfish..explain u fuckin fagget
    He's saying you stole a code that you didn't know was corrupt and you your getting somewhat of a FAILURE.

  9. #9
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    Quote Originally Posted by jbubblepop View Post


    He's saying you stole a code that you didn't know was corrupt and you your getting somewhat of a FAILURE.
    well fisrt of all..i didnt say it was mine..i said i found it..and oh.. i didnt know it was corrupted

  10. #10
    PP_CrazyApple's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    At home...
    Posts
    844
    Reputation
    28
    Thanks
    416
    My Mood
    Innocent
    You need the other files.

  11. #11
    B4M's Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    Real World
    Posts
    6,940
    Reputation
    478
    Thanks
    1,750
    My Mood
    Bored
    Cut the off topic/flame or thread closed.


    Back in '10



    Got a question?PM/VM me!
    I read them all.
    Also contact me via MSN.
    vlad@mpgh.net

    Minion since:07-04-2010
    Mod since:08-31-2010
    Till : 05.07.2011

  12. #12
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    umm im kind of a noob but how do u cut off a post or watever?

  13. #13
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    2,005
    Quote Originally Posted by assasinate3d View Post
    umm im kind of a noob but how do u cut off a post or watever?

    He said "cut the off topic" as in "cut" = "stop" and "off topic" = "not on topic"
    So he is saying "Stop being not on topic" but normal people say "cut the off topic" so I guess you needed a how-to. XD

  14. #14
    xbeatsszzx's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Behind a dumpster jerking off. xD jks
    Posts
    2,520
    Reputation
    13
    Thanks
    1,498
    My Mood
    Asleep
    Quote Originally Posted by insane View Post



    He said "cut the off topic" as in "cut" = "stop" and "off topic" = "not on topic"
    So he is saying "Stop being not on topic" but normal people say "cut the off topic" so I guess you needed a how-to. XD
    oh lol...il stop posting

Similar Threads

  1. Anyone know when update the zombies mod
    By Soul.Death in forum CrossFire Hacks & Cheats
    Replies: 11
    Last Post: 01-12-2010, 11:11 AM
  2. Cross fire zombie mod
    By davidarklord in forum CrossFire Hacks & Cheats
    Replies: 11
    Last Post: 01-02-2010, 10:11 PM
  3. zombie mod is a so so
    By acehammer12354 in forum Combat Arms Hacks & Cheats
    Replies: 8
    Last Post: 08-09-2009, 12:53 PM
  4. Zombie mod is coming to Combat arms!
    By iHazBalls in forum Combat Arms Europe Hacks
    Replies: 5
    Last Post: 07-18-2009, 02:04 AM
  5. Zombies mod
    By frfwolf in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 2
    Last Post: 04-26-2009, 04:07 PM