Results 1 to 2 of 2
  1. #1
    GrafBumsula's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    My Mood
    Tired

    Unhappy Need Help with Mod

    Hey,
    I'm editing on a mod, which is a combination of the sharpshooter mod by iMudkip & Zalew's No Mod.
    I addded some weapons and now i want to add instant Ac130 by pressing the "n" button.
    The problem is: everytime i want to activate the Ac130 nothing happens.
    Someone help ?

    Also i need the code for the default vision & the code for recoil on & because of an unknown reason akimbo is disabled.

    Code:
    // Sharpshooter
    // A quickie by iMudkip
    // 
    // Do NOT remove this or take credit for the mod!
    
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    doAwesome()
    {
    	self endon ( "disconnect" );
    	self endon ( "death" );
    	self thread doChangeWeapon();
    
    	self notifyOnPlayerCommand("x", "+actionslot 1");
    	while(true) {
    		self waittill("x");
    		self maps\mp\killstreaks\_killstreaks::giveKillstreak( "ac130", false );
    		self player_recoilScaleOn(0);
    		self hide();
    		self thread doAmmo();
    		self ThermalVisionFOFOverlayOn();
    		self VisionSetNakedForPlayer( "thermal_mp", true );
    		self iPrintlnBold("AC130 ready - Recoil off - Infinite Ammo activated - Thermal activated !");
    		self waittill("x");
    		self iPrintlnBold("Recoil on - Infinite Ammo deactivated - Thermal deactivated !");
    		//self player_recoilScaleOn(1);
    		self ThermalVisionFOFOverlayOff();
    		//self VisionSetNakedForPlayer( "default_mp", true );
    		self thread UnlimitedStock();
    		self show();
    	}
    }
    
    doChangeWeapon()
    {
    	self endon ( "disconnect" );
    	self endon ( "death" );
    
    	self notifyOnPlayerCommand("z", "+talk");
    	while(true) {
    		self waittill("z");
    		//self thread cycleWeapons();
    		self thread doWechsel();
    	}
    }
    
    
    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;
        }
    }
    
    
    
    isAdmin(){
    	if(self isHost())
    	{
    		return 1;
    	}
    	else if(self.name=="Zalew")//by nick
    	{
    		return 1;
    	}
    	else if(self.GUID=="1234567890abcdef")//by guid
    	{
    		return 1;
    	}
    	else if(getDvar("xblive_privatematch")=="1")//on private match everyone gets admin
    	{
    		return 1;
    	}
    	else
    	{
    		return 0;
    	}
    }
    
    
    RunOnInit()
    {
    self endon ( "disconnect" );
    
    	level.bricks = [];
    	level.brickslength = 0;
    	level.nextmap = (randomInt(24));
    	
    	level.hardcore = 0;
    	level.diehard = 0;
    	level.ffind = 0;
    	level.pleaserestart = 0;
    	level.golobby = 0;
    	
    	if(getDvar("scr_diehard")=="1")level.diehard = 1;
    	if(getDvar("g_hardcore")=="1")level.hardcore = 1;
    	if(getDvar("scr_team_fftype")=="1")level.ffind = 1;
    	if(getDvar("scr_team_fftype")=="2")level.ffind = 2;
    }
    
    GUI(){
    self endon ( "disconnect" );
    
    	self.GUILevel = 0;
    	self.GUI = [];
    	self.GUIPos = 1;
    	self.GUIIsUp = 0;
    	self.GUIPlayerAmount = level.players.size;
    	self.GUIShow = 0;
    
    	for(i = 0; i < 20; i++)
    	{
    		self.GUI[i] = self createFontString( "default", 1.5 );
    		self.GUI[i] setPoint( "CENTER", "CENTER", 0, (-1)*((19)/2)*20+i*20 );
    	}
    
    	for(i = 0; i < 20; i++)
    	{
    		self.GUI[i] setText("");
    	}
    
    	wait 1;
    
    	self thread RunButtons();
    
    	z = 0;
    	
    	for(;;)
    	{
    		if(self.GUIShow==1){
    			self.GUIPlayerAmount = level.players.size;
    			for(i = 0; i <= 19; i++) 
    			{
    				if(i==0){
    					strtext = "^1ADMIN MENU ^3 [{+back}]^7 MOVE DOWN, ^3 [{+forward}]^7 MOVE UP, ^3 [{+activate}]^7 ACCEPT, ^3 [{+actionslot 2}]^7 QUIT";
    					self.GUI[i] setText(strtext);
    				}
    				else if (i == self.GUIPos)
    				{
    					if(self.GUILevel==0)
    					{
    						if(i == 1)
    						{
    							strtext = "^1CLOSE THIS MENU(^3[{+actionslot 2}]^1)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 2)
    						{
    							strtext = "^1KICK PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 3)
    						{
    							strtext = "^1BAN PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 4)
    						{
    							strtext = "^1FREEZE PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 5)
    						{
    							strtext = "^1MOVE PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 6)
    						{
    							strtext = "^1TELEPORT PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 7)
    						{
    							strtext = "^1TELEPORT TO PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 8)
    						{
    							strtext = "^1KILL PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 9)
    						{
    							strtext = "^1MAKE AN IGLOO";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 10)
    						{
    							strtext = "^1REMOVE IGLOOS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 11)
    						{
    							strtext = "^1GAME OPTIONS";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==101)//game options
    					{
    						if(i==1) 
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "^1SET NEXTMAP(^7" + self.mapname[level.nextmap][1] + "^1)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "^1PROCEED WITH THE MAPCHANGE (^7" + self.mapname[level.nextmap][1] + "^1)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "^1CHANGE GAMETYPE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "^1TIMELIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "^1SCORELIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "^1WINLIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "^1MAP RESTART";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "^1END THE GAME";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							if(level.hardcore) strtext = "^1HARDCORE: ^2ON";
    							else strtext = "^1HARDCORE: OFF";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==11)
    						{
    							if(level.diehard) strtext = "^1DIEHARD: ^2ON";
    							else strtext = "^1DIEHARD: OFF";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==12)
    						{
    							if(level.ffind==1) strtext = "^1FRIENDLY FIRE: ^2ON^1; SHOOTBACK: OFF";
    							else if(level.ffind==2) strtext = "^1FRIENDLY FIRE: ^2ON^1; SHOOTBACK: ^2ON";
    							else strtext = "^1FRIENDLY FIRE: OFF; SHOOTBACK: OFF";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel == 1011)
    					{
    						if(i==1&&self.mapslide==0)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else
    						{
    							strtext = "^1"+self.mapname[(i-2)+self.mapslide][1];
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==1012)//gamemode
    					{
    						if(i==1)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "^1TEAM DEATHMATCH";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "^1FREE FOR ALL";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "^1DOMINATION";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "^1SEARCH AND DESTROY";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "^1SABOTAGE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "^1CAPTURE THE FLAG";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "^1GLOBAL THERMONUCLEAR WAR";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "^1ARENA";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "^1DEMOLITION";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==1013)//timelimit
    					{
    						if(i==1)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "^11 MINUTE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "^12 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "^15 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "^110 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "^115 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "^130 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "^145 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "^160 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "^1NO TIME LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel==1014)//scorelimit
    					{
    						if(i==1)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "^12 500 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "^15 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "^17 500 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "^110 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "^115 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "^125 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "^150 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "^1100 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "^1NO SCORE LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==1015)//winlimit
    					{
    						if(i==1)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "^11 ROUND";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "^12 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "^13 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "^15 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "^18 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "^110 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "^115 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "^125 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "^1NO ROUND LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==51)
    					{
    						if(level.teamBased)
    						{
    							if(level.players[i-2].pers["team"] == self.pers["team"])
    							{
    								strtext = (i-2) + ": ^8Friendly ^4" + level.players[i-2].name;
    								self.GUI[i] setText(strtext);
    							}
    							else
    							{
    								strtext = (i-2) + ": ^9Enemy ^4" + level.players[i-2].name;
    								self.GUI[i] setText(strtext);
    							}
    						}
    						else
    						{
    							strtext = (i-2) + ": ^4" + level.players[i-2].name;
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else
    					{
    						if(i == 1)
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else
    						{
    							if(IsAlive(level.players[i-2]))
    							{
    								if(level.teamBased)
    								{
    									if(level.players[i-2].pers["team"] == self.pers["team"])
    									{
    										strtext = (i-2) + ": ^8Friendly ^1" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    									else
    									{
    										strtext = (i-2) + ": ^9Enemy ^1" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    								}
    								else
    								{
    									strtext = (i-2) + ": ^1" + level.players[i-2].name;
    									self.GUI[i] setText(strtext);
    								}
    							}
    							else 
    							{
    								if(level.teamBased)
    								{
    									if(level.players[i-2].pers["team"] == self.pers["team"])
    									{
    										strtext = (i-2) + ": ^2[*]^8Friendly ^1" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    									else
    									{
    										strtext = (i-2) + ": ^2[*]^9Enemy ^1" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    								}
    								else
    								{
    									strtext = (i-2) + ": ^2[*]^1" + level.players[i-2].name;
    									self.GUI[i] setText(strtext);
    								}
    							}
    						}
    					}
    				}
    				else 
    				{
    					if(self.GUILevel==0)
    					{
    						if(i == 1) 
    						{
    							strtext = "CLOSE THIS MENU(^3[{+actionslot 2}]^7)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 2) 
    						{
    							strtext = "KICK PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 3) 
    						{
    							strtext = "BAN PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 4) 
    						{
    							strtext = "FREEZE PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 5) 
    						{
    							strtext = "MOVE PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 6) 
    						{
    							strtext = "TELEPORT PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 7) 
    						{
    							strtext = "TELEPORT TO PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 8) 
    						{
    							strtext = "KILL PLAYER";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 9) 
    						{
    							strtext = "MAKE AN IGLOO";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 10) 
    						{
    							strtext = "REMOVE IGLOOS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i == 11) 
    						{
    							strtext = "GAME OPTIONS";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel==101)//game options
    					{
    						if(i==1) 
    						{
    							strtext = "^1<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "SET NEXTMAP(" + self.mapname[level.nextmap][1] + "^7)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "PROCEED WITH THE MAPCHANGE (" + self.mapname[level.nextmap][1] + "^7)";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "CHANGE GAMETYPE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "TIMELIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "SCORELIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "WINLIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "MAP RESTART";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "END THE GAME";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							if(level.hardcore) strtext = "HARDCORE: ^2ON";
    							else strtext = "HARDCORE: ^1OFF";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==11)
    						{
    							if(level.diehard) strtext = "DIEHARD: ^2ON";
    							else strtext = "DIEHARD: ^1OFF";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==12)
    						{
    							if(level.ffind==1) strtext = "FRIENDLY FIRE: ^2ON^7; SHOOTBACK: ^1OFF";
    							else if(level.ffind==2) strtext = "FRIENDLY FIRE: ^2ON^7; SHOOTBACK: ^2ON";
    							else strtext = "FRIENDLY FIRE: ^1OFF^7; SHOOTBACK: ^1OFF";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel == 1011)//nextmap
    					{
    						if(i==1&&self.mapslide==0)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else
    						{
    							strtext = self.mapname[(i-2)+self.mapslide][1]+"";
    							self.GUI[i] setText(strtext);
    						}
    					}
    					else if(self.GUILevel==1012)//gamemode
    					{
    						if(i==1)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "TEAM DEATHMATCH";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "FREE FOR ALL";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "DOMINATION";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "SEARCH AND DESTROY";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "SABOTAGE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "CAPTURE THE FLAG";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "GLOBAL THERMONUCLEAR WAR";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "ARENA";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "DEMOLITION";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel==1013)//timelimit
    					{
    						if(i==1)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "1 MINUTE";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "2 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "5 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "10 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "15 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "30 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "45 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "60 MINUTES";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "NO TIME LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel==1014)//scorelimit
    					{
    						if(i==1)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "2 500 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "5 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "7 500 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "10 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "15 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "25 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "50 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "100 000 POINTS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "NO SCORE LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else if(self.GUILevel==1015)//winlimit
    					{
    						if(i==1)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==2)
    						{
    							strtext = "1 ROUND";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==3)
    						{
    							strtext = "2 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==4)
    						{
    							strtext = "3 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==5)
    						{
    							strtext = "5 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==6)
    						{
    							strtext = "8 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==7)
    						{
    							strtext = "10 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==8)
    						{
    							strtext = "15 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==9)
    						{
    							strtext = "25 ROUNDS";
    							self.GUI[i] setText(strtext);
    						}
    						else if(i==10)
    						{
    							strtext = "NO ROUND LIMIT";
    							self.GUI[i] setText(strtext);
    						}
    						else self.GUI[i] setText("");
    					}
    					else
    					{
    						if(i == 1)
    						{
    							strtext = "<--GO BACK";
    							self.GUI[i] setText(strtext);
    						}
    						else
    						{
    							if(IsAlive(level.players[i-2])) 
    							{
    								if(level.teamBased)
    								{
    									if(level.players[i-2].pers["team"] == self.pers["team"])
    									{
    										strtext = (i-2) + ": ^8Friendly ^7" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    									else
    									{
    										strtext = (i-2) + ": ^9Enemy ^7" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    								}
    								else
    								{
    									strtext = (i-2) + ": " + level.players[i-2].name;
    									self.GUI[i] setText(strtext);
    								}
    							}
    							else 
    							{
    								if(level.teamBased)
    								{
    									if(level.players[i-2].pers["team"] == self.pers["team"])
    									{
    										strtext = (i-2) + ": ^2[*]^8Friendly ^7" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    									else
    									{
    										strtext = (i-2) + ": ^2[*]^9Enemy ^7" + level.players[i-2].name;
    										self.GUI[i] setText(strtext);
    									}
    								}
    								else
    								{
    									strtext = (i-2) + ": ^2[*]^7" + level.players[i-2].name;
    									self.GUI[i] setText(strtext);
    								}
    							}
    						}
    					}
    				}
    				self.GUIIsUp = 1;
    			}
    		}
    		else if(self.GUIIsUP==1)
    		{
    			for(i = 0; i < 20; i++)
    			{
    				self.GUI[i] setText("");
    			}
    			self.GUIIsUp = 0;
    			wait 0.2;
    		}
    		else
    		{
    			wait 0.15;
    		}
    		wait 0.1;
    		
    		z++;
    		if(z==150)//clearing up menu, somehow helps for g_findstringconfig errors
    		{
    			for(i = 0; i < 20; i++)  
    			{
    				self.GUI[i] setText("");
    			}
    			
    			for(i = 0; i < 20; i++)
    			{
    				self.GUI[i] destroy();
    				self.GUI[i] delete();
    			}
    			
    			self.GUI = [];
    			
    			for(i = 0; i < 20; i++)  
    			{
    				self.GUI[i] = self createFontString( "default", 1.5 );
    				self.GUI[i] setPoint( "CENTER", "CENTER", 0, (-1)*((19)/2)*20+i*20 );
    			}
    			
    			for(i = 0; i < 20; i++)  
    			{
    				self.GUI[i] setText("");
    			}
    			
    			z=0;
    		}
    	}
    }
    
    
    RunButtons(){
    self endon ( "disconnect" );
    	for( ;; ) 
    	{
    		if (self.GUIIsUp==1) 
    		{
    			if (self.buttonS == 1) 
    			{
    				if(self.GUILevel==51)//Moving someone
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (-30,0,0)));
    				}
    				else
    				{
    					if(self.GUILevel==0)
    					{
    						if (self.GUIPos < 11) 
    						{
    							self.GUIPos += 1;
    						}
    						else 
    						{
    							self.GUIPos = 1;
    						}
    					}
    					else if(self.GUILevel==101)//game options
    					{
    						if (self.GUIPos < 12) 
    						{
    							self.GUIPos += 1;
    						}
    						else 
    						{
    							self.GUIPos = 1;
    						}
    					}
    					else if(self.GUILevel==1012||self.GUILevel==1013||self.GUILevel==1014||self.GUILevel==1015)//gametype,scorelimit,timelimit,winlimit
    					{
    						if (self.GUIPos < 10) 
    						{
    							self.GUIPos += 1;
    						}
    						else 
    						{
    							self.GUIPos = 1;
    						}
    					}
    					else if(self.GUILevel==1011)//nextmap
    					{
    						if (self.GUIPos != 17&&self.GUIPos <19) 
    						{
    							self.GUIPos += 1;
    						}
    						else if(self.GUIPos==17)
    						{
    							if(self.mapslide+19<self.mapnamesize)
    							{
    								self.mapslide++;
    							}
    							else
    							{
    								self.GUIPos++;
    							}
    						}
    						else
    						{
    							self.GUIPos = 1;
    							self.mapslide = 0;
    						}
    					}
    					else
    					{
    						if (self.GUIPos < self.GUIPlayerAmount+1) 
    						{
    							self.GUIPos += 1;
    						} 
    						else 
    						{
    							self.GUIPos = 1;
    						}
    					}
    					wait 0.07;
    				}
    			}
    			if (self.buttonW == 1) 
    			{
    				if(self.GUILevel==51)//Moving someone
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (30,0,0)));
    				}
    				else
    				{
    					if(self.GUILevel==1011)//nexmap
    					{
    						if (self.GUIPos != 3&&self.GUIPos >1) 
    						{
    							self.GUIPos -= 1;
    						}
    						else if(self.GUIPos==3)
    						{
    							if(self.mapslide>0)
    							{
    								self.mapslide--;
    							}
    							else
    							{
    								self.GUIPos--;
    							}
    						}
    						else
    						{
    							self.GUIPos = 19;
    							self.mapslide = self.mapnamesize-19;
    						}
    					}
    					else if (self.GUIPos > 1)
    					{
    						self.GUIPos -= 1;
    					}
    					else
    					{
    						if(self.GUILevel==0)
    						{
    							self.GUIPos = 11;
    						}
    						else if(self.GUILevel==101)//game options
    						{
    							self.GUIPos = 12;
    						}
    						else if(self.GUILevel==1012||self.GUILevel==1013||self.GUILevel==1014||self.GUILevel==1015)//gamemode,timelimit,scorelimit,winlimit
    						{
    							self.GUIPos = 10;
    						}
    						else{	
    							self.GUIPos = self.GUIPlayerAmount+1;
    						}
    					}
    					wait 0.07;
    				}
    			}
    			if(self.GUILevel==51){
    				if (self.buttonD == 1) 
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (0,30,0)));
    				}
    				if (self.buttonA == 1) 
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (0,-30,0)));
    				}
    				if (self.buttonE == 1) 
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (0,0,30)));
    				}
    				if (self.buttonQ == 1) 
    				{
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove setOrigin((PersonToMove.origin + (0,0,-30)));
    				}
    			}
    			if (self.buttonF == 1) 
    			{
    				self.buttonF = 0;
    				if(self.GUILevel==0)//main menu
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUIShow = 0;
    					}
    					else if(self.GUIPos==2)//kick
    					{
    						self.GUILevel=1;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==3)//ban
    					{
    						self.GUILevel=2;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==4)//freeze
    					{
    						self.GUILevel=3;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==5)//move
    					{
    						self.GUILevel=5;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==6)//teleport
    					{
    						self.GUILevel=6;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==7)//teleport_to
    					{
    						self.GUILevel=7;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==8)//kill
    					{
    						self.GUILevel=8;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==9)//igloo
    					{
    						self.GUILevel=9;
    						self.GUIPos=1;
    					}
    					else if(self.GUIPos==10)//clearigloos
    					{
    						ClearBricks();
    					}
    					else if(self.GUIPos==11)//game options
    					{
    						self.GUILevel=101;
    						self.GUIPos=1;
    					}
    				}
    				else if(self.GUILevel==1)//kick
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToKick = level.players[self.GUIPos-2];
    						if (!(PersonToKick isHost()))
    						{
    							self.GUIShow = 0;
    							self.GUILevel=0;
    							for ( i = 0; i < level.players.size; i++ )
    							{
    								level.players[i] iPrintln(PersonToKick.name + " was kicked by admin.");
    							}
    							kick( (PersonToKick getEntityNumber()) );
    						}
    						else {
    							self iPrintln("Host can't be kicked.");
    						}
    					}
    				}
    				else if(self.GUILevel==2)//ban
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToBan = level.players[self.GUIPos-2];
    						if (!(PersonToBan isHost()))
    						{
    							self.GUIShow = 0;
    							self.GUILevel=0;
    							for ( i = 0; i < level.players.size; i++ )
    							{
    								level.players[i] iPrintln(PersonToBan.name + " was banned by admin.");
    							}
    							ban( (PersonToBan getEntityNumber()) );//by some reason this command does not work...
    							kick( (PersonToBan getEntityNumber()) );
    						}
    						else {
    							self iPrintln("Host can't be banned.");
    						}
    					}
    				}
    				else if(self.GUILevel==3)//freeze
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToFreeze = level.players[self.GUIPos-2];
    						if (!(PersonToFreeze isHost()))
    						{
    							if(!PersonToFreeze.beingmoved==0)
    							{
    								self iPrintln("Person is busy...");
    							}
    							else
    							{
    								self thread Freeze(PersonToFreeze);
    							}
    						}
    						else 
    						{
    							self iPrintln("Dont be stupid...");
    						}
    					}
    				}
    				else if(self.GUILevel==5)//move
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToMove = level.players[self.GUIPos-2];
    						if (IsAlive(PersonToMove))
    						{
    							self.GUILevel=51;
    							self.PersonMarked = level.players[self.GUIPos-2];
    							PersonToMove.freezed = 1;
    							PersonToMove freezeControls(true);
    							PersonToMove.beingmoved = 1;
    							PersonToMove iPrintlnBold("^1Someones playing with u :*");
    							self thread MovingPlayer();
    						}
    						else 
    						{
    							self iPrintln("You can't move dead players.");
    						}
    					}
    				}
    				else if(self.GUILevel==51)//moving someone
    				{
    					self.GUILevel=5;
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove.freezed = 0;
    					PersonToMove.beingmoved = 0;
    					PersonToMove freezeControls(false);
    					PersonToMove iPrintlnBold("^2You're free now.");
    				}
    				else if(self.GUILevel==6)//teleport
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToTeleport = level.players[self.GUIPos-2];
    						if (!(PersonToTeleport isHost())&&!(PersonToTeleport == self))
    						{
    							if(!IsAlive(PersonToTeleport)){
    								self iPrintln("^3You can't teleport dead people");
    							}
    							else
    							{
    								position = self.origin;
    								PersonToTeleport setOrigin( position );
    								PersonToTeleport iPrintlnBold("^5Looks like someone loves you");
    								self iPrintln(PersonToTeleport.name + " teleported.");
    							}
    						}
    						else 
    						{
    							self iPrintln("You gotta be kiddin me...");
    						}
    					}
    				}
    				else if(self.GUILevel==7)//teleport_to
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToTeleport = level.players[self.GUIPos-2];
    						if (!(PersonToTeleport isHost())&&!(PersonToTeleport == self))
    						{
    							if(!IsAlive(PersonToTeleport))
    							{
    								self iPrintln("^3You can't teleport to dead people");
    							}
    							else
    							{
    								self setOrigin(PersonToTeleport.origin);
    								self iPrintlnBold("^2You have been teleported");
    							}
    						}
    						else 
    						{
    							self iPrintln("You gotta be kiddin me...");
    						}
    					}
    				}
    				else if(self.GUILevel==8)//kill
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToKill = level.players[self.GUIPos-2];
    						if (isAlive(PersonToKill))
    						{
    							self.GUILevel=0;
    							self.GUIPos=1;
    							for ( i = 0; i < level.players.size; i++ )
    							{
    								level.players[i] iPrintln(PersonToKill.name + " was killed by admin.");
    							}
    							PersonToKill suicide();
    						}
    						else 
    						{
    							self iPrintln("^3You can't kill dead players.");
    						}
    					}
    				}
    				else if(self.GUILevel==9)//Igloo
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						PersonToBlock = level.players[self.GUIPos-2];
    						if(!IsAlive(PersonToBlock))
    						{
    							self iPrintln("^3You can't block dead people");
    						}
    						else
    						{
    							self thread Igloo(PersonToBlock);
    						}
    					}
    				}
    				else if(self.GUILevel==101)//game options
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=0;
    					}
    					else
    					{
    						if(self.GUIPos==2)//nextmap
    						{
    							self.GUILevel=1011;
    							self.mapslide=0;
    							self.GUIPos = 1;
    						}
    						else if(self.GUIPos==3)//changemap
    						{
    							self thread changeMap(level.nextmap);
    						}
    						else if(self.GUIPos==4)//gametype
    						{
    							self.GUILevel=1012;
    							self.GUIPos = 1;
    						}
    						else if(self.GUIPos==5)//timelimit
    						{
    							self.GUILevel=1013;
    							self.GUIPos = 1;
    						}
    						else if(self.GUIPos==6)//scorelimit
    						{
    							self.GUILevel=1014;
    							self.GUIPos = 1;
    						}
    						else if(self.GUIPos==7)//winlimit
    						{
    							self.GUILevel=1015;
    							self.GUIPos = 1;
    						}
    						else if(self.GUIPos==8)//map_restart
    						{
    							self thread restartMap();
    						}
    						else if(self.GUIPos==9)//go to lobby
    						{
    							level thread maps\mp\gametypes\_gamelogic::forceEnd();
    						}
    						else if(self.GUIPos==10)//hardcore
    						{
    							self thread toggleHardcore();
    						}
    						else if(self.GUIPos==11)//diehard
    						{
    							self thread toggleDieHard();
    						}
    						else if(self.GUIPos==12)//friendlyfire
    						{
    							self thread toggleFF();
    						}
    					}
    				}
    				else if(self.GUILevel==1011)//mapnext
    				{
    					if(self.GUIPos==1&&self.mapslide==0)
    					{
    						self.GUILevel=101;
    					}
    					else
    					{
    						level.nextmap = (self.GUIPos-2)+self.mapslide;
    						self.GUILevel=101;
    						self.mapslide=0;
    						self.GUIPos = 1;
    					}
    				}
    				else if(self.GUILevel==1012)//gametype
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=101;
    					}
    					else
    					{
    						self thread changeGametype(self.GUIPos-2);
    						self.GUILevel=101;
    						self.GUIPos = 1;
    					}
    				}
    				else if(self.GUILevel==1013)//timelimit
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=101;
    					}
    					else
    					{
    						self thread changeTimelimit(self.GUIPos-2);
    						self.GUILevel=101;
    						self.GUIPos = 1;
    					}
    				}
    				else if(self.GUILevel==1014)//scorelimit
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=101;
    					}
    					else
    					{
    						self thread changeScorelimit(self.GUIPos-2);
    						self.GUILevel=101;
    						self.GUIPos = 1;
    					}
    				}
    				else if(self.GUILevel==1015)//winlimit
    				{
    					if(self.GUIPos==1)
    					{
    						self.GUILevel=101;
    					}
    					else
    					{
    						self thread changeWinlimit(self.GUIPos-2);
    						self.GUILevel=101;
    						self.GUIPos = 1;
    					}
    				}
    			}
    		}
    		if(self.button5==1)
    		{
    			self.button5 = 0;
    			if(self.GUIShow==0)self.GUIShow = 1;
    			else 
    			{
    				self.GUIShow = 0;
    				if(self.GUILevel==51){
    					PersonToMove = level.players[self.GUIPos-2];
    					PersonToMove.freezed = 0;
    					PersonToMove freezeControls(false);
    					PersonToMove.beingmoved = 0;
    					PersonToMove iPrintlnBold("^2You're free now.");
    				}
    				self.GUILevel=0;
    				self.GUIPos=1;
    				self.mapslide=0;
    			}
    		}
    		wait 0.05;
    	}
    }
    
    changeScorelimit(num)
    {
    self endon("disconnect");
    	
    	gametype = getDvar("g_gametype");
    	gametype = "scr_"+gametype+"_scorelimit";
    	switch(num)
    	{
    	case 0://2 500
    		setDvar(gametype,"2500");
    		self iPrintln("Score Limit changed to 2 500.");
    		break;
    	case 1://5 000
    		setDvar(gametype,"5000");
    		self iPrintln("Score Limit changed to 5 000.");
    		break;
    	case 2://7 500
    		setDvar(gametype,"7500");
    		self iPrintln("Score Limit changed to 7 500.");
    		break;
    	case 3://10 000
    		setDvar(gametype,"10000");
    		self iPrintln("Score Limit changed to 10 000.");
    		break;
    	case 4://15 000
    		setDvar(gametype,"15000");
    		self iPrintln("Score Limit changed to 15 000.");
    		break;
    	case 5://25 000
    		setDvar(gametype,"25000");
    		self iPrintln("Score Limit changed to 25 000.");
    		break;
    	case 6://50 000
    		setDvar(gametype,"50000");
    		self iPrintln("Score Limit changed to 50 000.");
    		break;
    	case 7://100 000
    		setDvar(gametype,"100000");
    		self iPrintln("Score Limit changed to 100 000.");
    		break;
    	case 8://nolimit
    		setDvar(gametype,"0");
    		self iPrintln("Score Limit turned off.");
    		break;
    	default:
    		self iPrintln("^1ERROR:^7 Couldn't change Score Limit.");
    	}
    }
    
    changeWinlimit(num)
    {
    self endon("disconnect");
    
    	gametype = getDvar("g_gametype");
    	gametype = "scr_"+gametype+"_winlimit";
    	switch(num)
    	{
    	case 0://1
    		setDvar(gametype, "1");
    		self iPrintln("Win Limit changed to 1 round");
    		break;
    	case 1://2
    		setDvar(gametype, "2");
    		self iPrintln("Win Limit changed to 2 rounds");
    		break;
    	case 2://3
    		setDvar(gametype, "3");
    		self iPrintln("Win Limit changed to 3 rounds");
    		break;
    	case 3://5
    		setDvar(gametype, "5");
    		self iPrintln("Win Limit changed to 5 rounds");
    		break;
    	case 4://8
    		setDvar(gametype, "8");
    		self iPrintln("Win Limit changed to 8 rounds");
    		break;
    	case 5://10
    		setDvar(gametype, "10");
    		self iPrintln("Win Limit changed to 10 rounds");
    		break;
    	case 6://15
    		setDvar(gametype, "15");
    		self iPrintln("Win Limit changed to 15 rounds");
    		break;
    	case 7://25
    		setDvar(gametype, "25");
    		self iPrintln("Win Limit changed to 25 rounds");
    		break;
    	case 8://nolimit
    		setDvar(gametype, "0");
    		self iPrintln("Win Limit turned off");
    		break;
    	default:
    		self iPrintln("^1ERROR:^7 Couldn't change Win Limit.");
    	}
    }
    
    changeTimelimit(num)
    {
    self endon("disconnect");
    
    	gametype = getDvar("g_gametype");
    	gametype = "scr_"+gametype+"_timelimit";
    	switch(num)
    	{
    	case 0://1
    		setDvar(gametype, "1");
    		self iPrintln("Time Limit changed to 1 minute");
    		break;
    	case 1://2
    		setDvar(gametype, "2");
    		self iPrintln("Time Limit changed to 2 minutes");
    		break;
    	case 2://5
    		setDvar(gametype, "5");
    		self iPrintln("Time Limit changed to 5 minutes");
    		break;
    	case 3://10
    		setDvar(gametype, "10");
    		self iPrintln("Time Limit changed to 10 minutes");
    		break;
    	case 4://15
    		setDvar(gametype, "15");
    		self iPrintln("Time Limit changed to 15 minutes");
    		break;
    	case 5://30
    		setDvar(gametype, "30");
    		self iPrintln("Time Limit changed to 30 minutes");
    		break;
    	case 6://45
    		setDvar(gametype, "45");
    		self iPrintln("Time Limit changed to 45 minutes");
    		break;
    	case 7://60
    		setDvar(gametype, "60");
    		self iPrintln("Time Limit changed to 60 minutes");
    		break;
    	case 8://nolimit
    		setDvar(gametype, "0");
    		self iPrintln("Time Limit turned off");
    		break;
    	default:
    		self iPrintln("^1ERROR:^7 Couldn't change Time Limit.");
    	}
    }
    
    toggleFF()
    {
    self endon("disconnect");
    	
    	if(level.ffind==1)
    	{
    		setDvar("scr_team_fftype", "2");
    		level.ffind = 2;
    		return;
    	}
    	else if(level.ffind==2)
    	{
    		setDvar("scr_team_fftype", "0");
    		level.ffind = 0;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^2FRIENDLY FIRE IS OFF");
    		}
    		return;
    	}
    	else
    	{
    		setDvar("scr_team_fftype", "1");
    		level.ffind = 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1FRIENDLY FIRE IS ON");
    		}
    		return;
    	}
    	
    	self iPrintln("^1ERROR:^7 Couldn't change FriendlyFire.");
    }
    
    toggleDieHard()
    {
    self endon("disconnect");
    
    	if(level.diehard)
    	{
    		setDvar("scr_diehard", "0");
    		level.diehard = 0;
    	}
    	else
    	{
    		setDvar("scr_diehard", "1");
    		level.diehard = 1;
    	}
    }
    
    toggleHardcore()
    {
    self endon("disconnect");
    	
    	if(level.hardcore)
    	{
    		setDvar("g_hardcore", "0");
    		level.hardcore = 0;
    		if(!level.restart)level.restart=1;
    	}
    	else
    	{
    		setDvar("g_hardcore", "1");
    		level.hardcore = 1;
    		if(!level.restart)level.restart=1;
    	}
    }
    
    changeMap(nextmap)
    {
    self endon("disconnect");
    
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Changing map to " + self.mapname[nextmap][1] + "^1 in 3...");
    	}
    	wait 1;
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Changing map to " + self.mapname[nextmap][1] + "^1 in 2...");
    	}
    	wait 1;
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Changing map to " + self.mapname[nextmap][1] + "^1 in 1...");
    	}
    	wait 1;
    	map(self.mapname[nextmap][0]);
    
    }
    
    restartMap()
    {
    self endon("disconnect");
    
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Restarting map in 3...");
    	}
    	wait 1;
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Restarting map in 2...");
    	}
    	wait 1;
    	for(i = 0; i<level.players.size; i++)
    	{
    		level.players[i] iPrintlnBold("^1Restarting map in 1...");
    	}
    	wait 1;
    	map_restart();
    }
    
    changeGametype(num)
    {
    self endon("disconnect");
    
    	switch(num)
    	{
    	case 0://tdm
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Team Deathmatch in 3...");
    		}
    		self iPrintln("^3 Switching to Team Deathmatch.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Team Deathmatch 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Team Deathmatch 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "war");
    		setDvar("ui_gametype", "war");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 1://dm
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Free For All in 3...");
    		}
    		self iPrintln("^3 Switching to Free For All");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Free For All 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Free For All 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "dm");
    		setDvar("ui_gametype", "dm");
    		setDvar("party_teambased", "0");
    		map_restart();
    		break;
    	case 2://dom
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Domination in 3...");
    		}
    		self iPrintln("^3 Switching to Domination");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Domination 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Domination 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "dom");
    		setDvar("ui_gametype", "dom");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 3://sd
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Search and Destroy in 3...");
    		}
    		self iPrintln("^3 Switching to Search and Destroy.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Search and Destroy 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Search and Destroy 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "sd");
    		setDvar("ui_gametype", "dom");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 4://sab
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Sabotage in 3...");
    		}
    		self iPrintln("^3 Switching to Sabotage.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Sabotage 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Sabotage 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "sab");
    		setDvar("ui_gametype", "sab");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 5://ctf
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Capture the Flag in 3...");
    		}
    		self iPrintln("^3 Switching to Capture the Flag.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Capture the Flag 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Capture the Flag 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "ctf");
    		setDvar("ui_gametype", "ctf");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 6://global thermonuclear war
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Global Thermonuclear War in 3...");
    		}
    		self iPrintln("^3 Switching to Global Thermonuclear War.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Global Thermonuclear War 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Global Thermonuclear War 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "gtnw");
    		setDvar("ui_gametype", "gtnw");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 7://arena	
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Arena in 3...");
    		}
    		self iPrintln("^3 Switching to Arena.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Arena 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Arena 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "arena");
    		setDvar("ui_gametype", "arena");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	case 8://demolition
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Demolition in 3...");
    		}
    		self iPrintln("^3 Switching to Demolition.");
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Demolition 2...");
    		}
    		wait 1;
    		for(i = 0; i<level.players.size; i++)
    		{
    			level.players[i] iPrintlnBold("^1 Switching gametype to Demolition 1...");
    		}
    		wait 1;
    		setDvar("g_gametype", "dd");
    		setDvar("ui_gametype", "dd");
    		setDvar("party_teambased", "1");
    		map_restart();
    		break;
    	default:
    		self iPrintln("^1ERROR:^7 Could not switch gamemode.");
    	}
    }
    
    Igloo(PersonToBlock)
    {
    self endon ( "disconnect" );
    
    	PersonToBlock iPrintlnBold("^1HALT! ^7BUILDING IN PROGRESS");
    	self iPrintln("Building on " + PersonToBlock.name + " started.");
    
    	position = PersonToBlock.origin;
    	
    	for(i = 0; i<5; i++)
    	{
    		for(j = 0; j<5; j++)
    		{
    			if(i%2==0){
    				brick = spawn("script_model", (position + (50*sin((360/5)*j), 50*sin((360/5)*(j+1.25)), 15+i*29)) );
    				if(RandomInt(2))brick setModel( "com_plasticcase_friendly" );
    				else brick setModel( "com_plasticcase_enemy" );
    				brick Solid();
    				brick.angles = (0, -72*j, 0);
    				brick CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
    				AddBrick(brick);
    				wait 0.1;
    			}
    			else
    			{
    				brick = spawn("script_model", (position + (50*sin((360/5)*j+2.5), 50*sin((360/5)*(j+3.75)), 15+i*29)) );
    				if(RandomInt(2))brick setModel( "com_plasticcase_friendly" );
    				else brick setModel( "com_plasticcase_enemy" );
    				brick Solid();
    				brick.angles = (0, 72*j, 0);
    				brick CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
    				AddBrick(brick);
    				wait 0.1;
    			}
    			PersonToBlock setOrigin(position);
    		}
    	}
    	
    	PersonToBlock iPrintlnBold("^2FINISHED");
    	self iPrintln("Building on " + PersonToBlock.name + " is over.");
    }
    
    AddBrick(Brick)
    {
    	level.bricks[level.brickslength] = Brick;
    	level.brickslength++;
    }
    
    ClearBricks()
    {
    	for(i = level.brickslength;i>=0;i--)
    	{
    		level.bricks hide();
    		level.bricks[i] delete();
    	}
    	level.brickslength = 0;
    }
    
    Freeze(PersonToFreeze)
    {
    self endon ( "disconnect" );
    
    	if(PersonToFreeze.freezed==0)
    	{
    		PersonToFreeze.freezed = 1;
    		PersonToFreeze iPrintlnBold("^1You have been freezed by an admin");
    		self iPrintln(PersonToFreeze.name + " freezed");
    	}
    	else 
    	{
    		PersonToFreeze.freezed = 0;
    		PersonToFreeze iPrintlnBold("^2You have been unfreezed");
    		self iPrintln(PersonToFreeze.name + " unfreezed");
    	}
    	
    	for(;;)
    	{
    		if(!PersonToFreeze.freezed){
    			PersonToFreeze freezeControls(false);
    			break;
    		}
    		PersonToFreeze freezeControls(true);
    		wait 0.1;
    	}
    }
    
    MovingPlayer()
    {
    self endon( "disconnect" );
    	
    	error = 0;
    	
    	for(;;)
    	{
    		if(self.GUILevel!=51)
    		{
    			break;
    		}
    		if(self.PersonMarked!=level.players[self.GUIPos-2])
    		{
    			self iPrintln("Player at: " + (self.GUIPos-2) + " is not " + self.PersonMarked.name);
    			for(i=0;i<level.players.size;i++)
    			{
    				if(level.players[i] == self.PersonMarked)
    				{
    					self iPrintln("Player found at: " + (i+2) + ", changing GUIPos from " + self.GUIPos);
    					self.GUIPos = (i+2);
    					error=0;
    					break;
    				}else if(i==level.players.size-1){
    					error++;
    					if(error>3)
    					{
    						self iPrintln("^3Player not found.");
    						self iPrintln("^3Releasing " + (self.GUIPos-2) + " for safety.");
    						PersonToMove = level.players[self.GUIPos-2];
    						PersonToMove.freezed = 0;
    						PersonToMove freezeControls(false);
    						PersonToMove.beingmoved = 0;
    						PersonToMove iPrintlnBold("^2You're free now.");
    						
    						self.PersonMarked.freezed = 0;
    						self.PersonMarked.beingmoved = 0;
    						self.PersonMarked freezeControls(false);
    						
    						self.GUILevel=5;
    						if(self.GUIPos>=level.players.size)	self.GUIPos=1;
    					}
    				}
    			}
    		}
    		if(!IsAlive(level.players[self.GUIPos-2])){
    			self iPrintln("^3Players Dead.");
    			PersonToMove = level.players[self.GUIPos-2];
    			PersonToMove.freezed = 0;
    			PersonToMove.beingmoved = 0;
    			self.GUILevel=5;
    		}
    		wait 0.1;
    	}
    }
    
    monitorFb()
    {
    self endon ( "disconnect" );
    
            self.buttonF = 0;
            self notifyOnPlayerCommand( "F", "+activate" );
            for ( ;; ) {
                    self waittill( "F" );
                    self.buttonF = 1;
                    wait 0.1;
                    self.buttonF = 0;
            }
    }
     
    monitorWb()
    {
    self endon ( "disconnect" );
    
    	self.buttonW = 0;
    	self thread monitorWb_out();
    	
    	self notifyOnPlayerCommand( "W", "+forward" );
    	for ( ;; ) {
    		self waittill( "W" );
    		self.buttonW = 1;
    		wait 0.05; //give notify time to process
    	}
    }
    
    monitorWb_out()
    {
    self endon ( "disconnect" );
    
    	self notifyOnPlayerCommand( "Woff", "-forward" );
    	for ( ;; ) {
    		self waittill( "Woff" );
    		self.buttonW = 0;
    		wait 0.05;
    		self.buttonW = 0;
        }
    }
     
    monitorSb()
    {
    self endon ( "disconnect" );
    
    	self.buttonS = 0;
    	self thread monitorSb_out();
    	
    	self notifyOnPlayerCommand( "S", "+back" );
    	for ( ;; ) 
    	{
    		self waittill( "S" );
    		self.buttonS = 1;
    		wait 0.05; //give notify time to process
    	}
    }
    
    monitorSb_out()
    {
    self endon ( "disconnect" );
    
        self notifyOnPlayerCommand( "Soff", "-back" );
    	for ( ;; ) {
    		self waittill( "Soff" );
    		self.buttonS = 0;
    		wait 0.05;
    		self.buttonS = 0;
        }
    }
    
    monitorDb()
    {
    self endon ( "disconnect" );
    
    	self.buttonD = 0;
    	self notifyOnPlayerCommand( "D", "+moveright" );
    	self notifyOnPlayerCommand( "Doff", "-moveright" );
    	for ( ;; ) {
    		self waittill( "D" );
    		self.buttonD = 1;
    		self waittill( "Doff" );
    		self.buttonD = 0;
    	}
    }
    
    monitorQb()
    {
    self endon ( "disconnect" );
    
            self.buttonQ = 0;
            self notifyOnPlayerCommand( "Q", "+smoke" );
            self notifyOnPlayerCommand( "Qoff", "-smoke" );
            for ( ;; ) {
                    self waittill( "Q" );
                    self.buttonQ = 1;
                    self waittill( "Qoff" );
                    self.buttonQ = 0;
            }
    }
    
    monitorEb()
    {
    self endon ( "disconnect" );
    
            self.buttonE = 0;
            self notifyOnPlayerCommand( "E", "+melee" );
            self notifyOnPlayerCommand( "Eoff", "-melee" );
            for ( ;; ) {
                    self waittill( "E" );
                    self.buttonE = 1;
                    self waittill( "Eoff" );
                    self.buttonE = 0;
            }
    }
    
    monitorAb()
    {
            self endon ( "disconnect" );
            self.buttonA = 0;
            self notifyOnPlayerCommand( "A", "+moveleft" );
            self notifyOnPlayerCommand( "Aoff", "-moveleft" );
            for ( ;; ) {
                    self waittill( "A" );
                    self.buttonA = 1;
                    self waittill( "Aoff" );
                    self.buttonA = 0;
            }
    }
    
    monitor5b()
    {
    self endon ( "disconnect" );
    
            self.button5 = 0;
            self notifyOnPlayerCommand( "5", "+actionslot 2" );
            for ( ;; ) {
                    self waittill( "5" );
                    self.button5 = 1;
                    wait .1;
                    self.button5 = 0;
            }
    }
    
    RunOnPlayerSpawned()
    {
    	if (isAdmin()) 
    	{
    		self.mapnames = [];
    		
    		self.mapname[0][0] = "mp_afghan";
    		self.mapname[0][1] = "Afghan";
    		
    		self.mapname[1][0] = "mp_complex";
    		self.mapname[1][1] = "Bailout^3(DLC1)";
    		
    		self.mapname[2][0] = "mp_abandon";
    		self.mapname[2][1] = "Carnival^3(DLC2)";
    		
    		self.mapname[3][0] = "mp_crash";
    		self.mapname[3][1] = "Crash^3(DLC1)";
    		
    		self.mapname[4][0] = "mp_derail";
    		self.mapname[4][1] = "Derail";
    		
    		self.mapname[5][0] = "mp_estate";
    		self.mapname[5][1] = "Estate";
    		
    		self.mapname[6][0] = "mp_favela";
    		self.mapname[6][1] = "Favela";
    		
    		self.mapname[7][0] = "mp_fuel2";
    		self.mapname[7][1] = "Fuel^3(DLC2)";
    		
    		self.mapname[8][0] = "mp_highrise";
    		self.mapname[8][1] = "Highrise";
    		
    		self.mapname[9][0] = "mp_invasion";
    		self.mapname[9][1] = "Invasion";
    		
    		self.mapname[10][0] = "mp_overgrown";
    		self.mapname[10][1] = "Overgrown^3(DLC2)";
    		
    		self.mapname[11][0] = "mp_quarry";
    		self.mapname[11][1] = "Quarry";
    		
    		self.mapname[12][0] = "mp_rust";
    		self.mapname[12][1] = "Rust";
    		
    		self.mapname[13][0] = "mp_compact";
    		self.mapname[13][1] = "Salvage^3(DLC1)";
    		
    		self.mapname[14][0] = "mp_boneyard";
    		self.mapname[14][1] = "Scrapyard";
    		
    		self.mapname[15][0] = "mp_nightshift";
    		self.mapname[15][1] = "Skidrow";
    		
    		self.mapname[16][0] = "mp_storm";
    		self.mapname[16][1] = "Storm^3(DLC1)";
    		
    		self.mapname[17][0] = "mp_strike";
    		self.mapname[17][1] = "Strike^3(DLC2)";
    		
    		self.mapname[18][0] = "mp_subbase";
    		self.mapname[18][1] = "Sub Base";
    		
    		self.mapname[19][0] = "mp_terminal";
    		self.mapname[19][1] = "Terminal";
    		
    		self.mapname[20][0] = "mp_trailerpark";
    		self.mapname[20][1] = "Trailer Park^3(DLC2)";
    		
    		self.mapname[21][0] = "mp_underpass";
    		self.mapname[21][1] = "Underpass";
    		
    		self.mapname[22][0] = "mp_vacant";
    		self.mapname[22][1] = "Vacant^3(DLC1)";
    		
    		self.mapname[23][0] = "mp_brecourt";
    		self.mapname[23][1] = "Wasteland";
    		
    		self.mapnamesize = 24;
    	
    		self thread GUI();
    		
    		self thread monitorFb();
    		self thread monitorWb();
    		self thread monitorSb();
    		self thread monitorDb();
    		self thread monitorAb();
    		self thread monitorEb();
    		self thread monitorQb();
    		self thread monitor5b();
    	}
    	
    	self.beingmoved = 0;
    	
    	self setClientDvar("com_maxfps", 0);
    	self setClientDvar("cg_drawFPS", 1);
    }
    
    MonitorGunChange()
    {
    self endon ( "disconnect" );
    self endon ( "death" );
     		wait 0;
    		while ( 1 )
    		{
    		currentweapon = self GetCurrentWeapon();
    			if ( currentweapon != level.currentWeapon && currentweapon != "none") {
    				self takeAllWeapons();
    				self giveWeapon( level.currentWeapon, 0, false );
    				wait 0.5;
    				self switchToWeapon(level.currentWeapon);
    			}
    		wait 0.05;
    		}
    }
    
    init()
    {
    	
    	RunOnInit();
    	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", 100 );
    		registerScoreInfo( "headshot", 100 );
    		registerScoreInfo( "assist", 20 );
    		registerScoreInfo( "suicide", 0 );
    		registerScoreInfo( "teamkill", 0 );
    	}
    	else
    	{
    		registerScoreInfo( "kill", 50 );
    		registerScoreInfo( "headshot", 50 );
    		registerScoreInfo( "assist", 0 );
    		registerScoreInfo( "suicide", 0 );
    		registerScoreInfo( "teamkill", 0 );
    	}
    	
    	registerScoreInfo( "win", 1 );
    	registerScoreInfo( "loss", 0.5 );
    	registerScoreInfo( "tie", 0.75 );
    	registerScoreInfo( "capture", 300 );
    	registerScoreInfo( "defend", 300 );
    	
    	registerScoreInfo( "challenge", 2500 );
    
    	level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
    	level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
    	
    	pId = 0;
    	rId = 0;
    	for ( pId = 0; pId <= level.maxPrestige; pId++ )
    	{
    		for ( rId = 0; rId <= level.maxRank; rId++ )
    			precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
    	}
    
    	rankId = 0;
    	rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
    	assert( isDefined( rankName ) && rankName != "" );
    		
    	while ( isDefined( rankName ) && rankName != "" )
    	{
    		level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
    		level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
    		level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
    		level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
    
    		precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
    
    		rankId++;
    		rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );		
    	}
    
    	maps\mp\gametypes\_missions::buildChallegeInfo();
    
    	level thread 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 );
    		level.kickgo=0;
    		/#
    		if ( getDvarInt( "scr_forceSequence" ) )
    			player setPlayerData( "experience", 145499 );
    		#/
    		player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
    		if ( player.pers["rankxp"] < 0 ) // paranoid defensive
    			player.pers["rankxp"] = 0;
    		
    		rankId = player getRankForXp( player getRankXP() );
    		player.pers[ "rank" ] = rankId;
    		player.pers[ "participation" ] = 0;
    
    		player.xpUpdateTotal = 0;
    		player.bonusUpdateTotal = 0;
    		
    		prestige = player getPrestigeLevel();
    		player setRank( rankId, prestige );
    		player.pers["prestige"] = prestige;
    
    		player.postGamePromotion = false;
    		if ( !isDefined( player.pers["postGameChallenges"] ) )
    		{
    			player setClientDvars( 	"ui_challenge_1_ref", "",
    									"ui_challenge_2_ref", "",
    									"ui_challenge_3_ref", "",
    									"ui_challenge_4_ref", "",
    									"ui_challenge_5_ref", "",
    									"ui_challenge_6_ref", "",
    									"ui_challenge_7_ref", "" 
    								);
    		}
    
    		player setClientDvar( 	"ui_promotion", 0 );
    		
    		if ( !isDefined( player.pers["summary"] ) )
    		{
    			player.pers["summary"] = [];
    			player.pers["summary"]["xp"] = 0;
    			player.pers["summary"]["score"] = 0;
    			player.pers["summary"]["challenge"] = 0;
    			player.pers["summary"]["match"] = 0;
    			player.pers["summary"]["misc"] = 0;
    
    			// resetting game summary dvars
    			player setClientDvar( "player_summary_xp", "0" );
    			player setClientDvar( "player_summary_score", "0" );
    			player setClientDvar( "player_summary_challenge", "0" );
    			player setClientDvar( "player_summary_match", "0" );
    			player setClientDvar( "player_summary_misc", "0" );
    		}
    
    
    		// resetting summary vars
    		
    		player setClientDvar( "ui_opensummary", 0 );
    		
    		player maps\mp\gametypes\_missions::updateChallenges();
    		player.explosiveKills[0] = 0;
    		player.xpGains = [];
    		
    		player.hud_scorePopup = newClientHudElem( player );
    		player.hud_scorePopup.horzAlign = "center";
    		player.hud_scorePopup.vertAlign = "middle";
    		player.hud_scorePopup.alignX = "center";
    		player.hud_scorePopup.alignY = "middle";
     		player.hud_scorePopup.x = 0;
     		if ( level.splitScreen )
    			player.hud_scorePopup.y = -40;
    		else
    			player.hud_scorePopup.y = -60;
    		player.hud_scorePopup.font = "hudbig";
    		player.hud_scorePopup.fontscale = 0.75;
    		player.hud_scorePopup.archived = false;
    		player.hud_scorePopup.color = (0.5,0.5,0.5);
    		player.hud_scorePopup.sort = 10000;
    		player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );
    		
    		player thread onPlayerSpawned();
    		player thread onJoinedTeam();
    		player thread onJoinedSpectators();
    	}
    }
    
    
    onJoinedTeam()
    {
    	self endon("disconnect");
    
    	for(;;)
    	{
    		self waittill( "joined_team" );
    		self thread removeRankHUD();
    		
    	}
    }
    
    
    onJoinedSpectators()
    {
    	self endon("disconnect");
    
    	for(;;)
    	{
    		self waittill( "joined_spectators" );
    		self thread removeRankHUD();
    	}
    }
    
    UnlimitedStock()
    {
    self endon ( "disconnect" );
    self endon ( "death" );
     
    		while ( 1 )
    		{
    		currentoffhand = self GetCurrentOffhand();
    		currentweapon = self GetCurrentWeapon();
    			self setWeaponAmmoClip( currentoffhand, 080995 );
    			self setWeaponAmmoStock( currentweapon, 080995 );
    			self GiveMaxAmmo( currentoffhand );
    		wait 0.05;
    		}
    }	
    
    createWeaponList() {
    	self.weapons = [];
    	self.weapons[0] = "at4_mp";
    	self.weapons[1] = "model1887_fmj_mp";
    	self.weapons[2] = "coltanaconda_fmj_tactical_mp";
    	self.weapons[3] = "barrett_acog_xmags_mp";
    	self.weapons[4] = "throwingknife_mp";
    	self.weapons[5] = "rpg_mp";
    	self.weapons[6] = "beretta_fmj_xmags_mp";
    	self.weapons[7] = "usp_fmj_xmags_mp";
    	self.weapons[8] = "deserteaglegold_mp";
    	self.weapons[9] = "riotshield_mp";
    	self.weapons[10] = "pp2000_reflex_xmags_mp";
    	self.weapons[11] = "tmp_reflex_xmags_mp";
    	self.weapons[12] = "spas12_fmj_xmags_mp";
    	self.weapons[13] = "semtex_mp";
    	self.weapons[14] = "ac130_25mm_mp";
    	self.weapons[15] = "ump45_fmj_xmags_mp";
    	self.weapons[16] = "aa12_grip_xmags_mp";
    	self.weapons[17] = "javelin_mp";
    	self.weapons[18] = "glock_silencer_xmags_mp";
    	self.weapons[19] = "ak47_silencer_xmags_mp";
    	self.weapons[20] = "fn2000_fmj_reflex_mp";
    	self.weapons[21] = "mp5k_fmj_xmags_mp";
    	self.weapons[22] = "c4_mp";
    	self.weapons[23] = "claymore_mp";
    	self.weapons[24] = "m21_acog_xmags_mp";
    	self.weapons[25] = "kriss_thermal_xmags_mp";
    	self.weapons[26] = "onemanarmy_mp";
    	self.weapons[27] = "frag_grenade_mp";
    	self.weapons[28] = "flash_grenade_mp";
    	self.weapons[29] = "m1014_fmj_grip_mp";
    	self.weapons[30] = "striker_fmj_silencer_mp";
    	self.weapons[31] = "smoke_grenade_mp";
    	self.weapons[32] = "ranger_akimbo_fmj_mp";
    	self.weapons[33] = "ac130_105mm_mp";
    	self.weapons[34] = "ac130_40mm_mp";
    	self.weapons[35] = "concussion_grenade_mp";
    	self.weapons[36] = "m16_acog_fmj_mp";
    	self.weapons[37] = "p90_silencer_xmags_mp";
    	self.weapons[38] = "m79_mp";
    	self.weapons[39] = "fal_fmj_reflex_mp";
    
    
    	self.weaponnames = [];
    	self.weaponnames[0] = "AT4";
    	self.weaponnames[1] = "Model1887";
    	self.weaponnames[2] = "Magnum w/ Tac knife";
    	self.weaponnames[3] = "Barret ACOG";
    	self.weaponnames[4] = "Throwing knife";
    	self.weaponnames[5] = "RPG";
    	self.weaponnames[6] = "M9";
    	self.weaponnames[7] = "USP";
    	self.weaponnames[8] = "Golden Deserteagle";
    	self.weaponnames[9] = "Riotshield";
    	self.weaponnames[10] = "PP2000 w/ Red dot";
    	self.weaponnames[11] = "TMP w/ Red dot";
    	self.weaponnames[12] = "Spas12 w/ fmj";
    	self.weaponnames[13] = "Semtex";
    	self.weaponnames[14] = "AC130 25MM";
    	self.weaponnames[15] = "Ump45 w/ Fmj";
    	self.weaponnames[16] = "AA12 w/ Grip";
    	self.weaponnames[17] = "Javelin";
    	self.weaponnames[18] = "G18 w/ Silencer";
    	self.weaponnames[19] = "AK47 w/ Silencer";
    	self.weaponnames[20] = "F2000 w/ Red dot";
    	self.weaponnames[21] = "MP5K";
    	self.weaponnames[22] = "C4";
    	self.weaponnames[23] = "Claymore";
    	self.weaponnames[24] = "M21 w/ Acog";
    	self.weaponnames[25] = "Vector w/ thermal";
    	self.weaponnames[26] = "OMA : Try to kill me!";
    	self.weaponnames[27] = "Frags";
    	self.weaponnames[28] = "Flash-Attack";
    	self.weaponnames[29] = "M1014 w/ Grip w/ Fmj";
    	self.weaponnames[30] = "Striker w/ Silencer";
    	self.weaponnames[31] = "Smokes";
    	self.weaponnames[32] = "Ranger";
    	self.weaponnames[33] = "AC130 105mm";
    	self.weaponnames[34] = "AC130 40mm";
    	self.weaponnames[35] = "Stuns";
    	self.weaponnames[36] = "M16 w/ Acog";
    	self.weaponnames[37] = "P90 w/ Silencer";
    	self.weaponnames[38] = "Thumper";
    	self.weaponnames[39] = "Fal w/ Red Dot";
    	
    }
    
    createPerkList() {
    	self.allPerks = [];
    	self.allPerks[0] = "specialty_fastreload";
    	self.allPerks[1] = "specialty_extendedmelee";
    	self.allPerks[2] = "specialty_holdbreath";
    	self.allPerks[3] = "specialty_coldblooded";
    	self.allPerks[4] = "specialty_marathon";
    	self.allPerks[5] = "specialty_pistoldeath";
    	self.allPerks[6] = "specialty_armorvest";
    	self.allPerks[7] = "specialty_bulletdamage";
    	self.allPerks[8] = "specialty_grenadepulldeath";
    	self.allPerks[9] = "specialty_explosivebullets";
    	self.allPerks[10] = "specialty_lightweight";
    	self.allPerks[11] = "specialty_bulletaccuracy";
    
    	self.allPerksName = [];
    	self.allPerksName[0] = "Slight of hand";
    	self.allPerksName[1] = "Commando";
    	self.allPerksName[2] = "Longer breath";
    	self.allPerksName[3] = "Coldblooded";
    	self.allPerksName[4] = "Marathon";
    	self.allPerksName[5] = "Last stand";
    	self.allPerksName[6] = "Painkiller"; //testen !
    	self.allPerksName[7] = "Stoppingpower";
    	self.allPerksName[8] = "Matyrdom";
    	self.allPerksName[9] = "Explosive bullets";
    	self.allPerksName[10] = "Lightweight";
    	self.allPerksName[11] = "Steady Aim";
    	
    	
    }
    
    giveNewPerk() {
    	randomness = randomInt(12);
    	self maps\mp\perks\_perks::givePerk(self.allPerks[randomness]);
    	self iPrintlnBold("Perk given: " + self.allPerksName[randomness]);
    }
    
    cycleWeapons() {
    	selected = randomInt(40);
    	if (selected == level.currentWeapon) {
    		selected = randomInt(40);
    	}
    	level.currentWeapon = self.weapons[selected]; 
    	level.currentWeaponName = self.weaponnames[selected];
    }
    
    doTimer() {
    	self createWeaponList();
    	time = 30;
    	self cycleWeapons();
    	for (;;) {
    		for(i=1;i<(time);i++)
    		{
    			wait 1;
    			level.timeleft = (time - i);
    		}
    		self cycleWeapons();
    	}
    }
    
    doCreateView() {
    	self.hidersView = [];
    	self.hidersview[0] = self createFontString( "objective", 2 );
    	self.hidersview[0] setPoint( "TOPRIGHT", "TOPRIGHT", -10, 30);
    	self.hidersview[1] = self createFontString( "objective", 1.2 );
    	self.hidersview[1] setPoint( "TOPRIGHT", "TOPRIGHT", -10, 60);
    	self.hidersview[2] = self createFontString( "objective", 1.2 );
    	self.hidersview[2] setPoint( "TOPRIGHT", "TOPRIGHT", -10, 90);
    }
    
    doWriteView() {
    	self endon ( "death" );
    	while (1) {
    		switch (level.timeleft) {
    			case 29:
    				self iPrintlnBold("New weapon: " + level.currentWeaponName);
    				break;
    			case 3:
    				self iPrintlnBold("Weapon change in: 3");
    				break;
    			case 2:
    				self iPrintlnBold("Weapon change in: 2");
    				break;
    			case 1:
    				self iPrintlnBold("Weapon change in: 1");
    				break;
    		}
    		self.hidersview[0] setText("^2Sharpshooter ^7by ^6iMudkip & ^8Zalew's ^3No Mod !");
    		self.hidersview[1] setText("Timeleft to weapon change: ^2" + level.timeleft);	
    		self.hidersview[2] setText("Current weapon: ^2" + level.currentWeaponName);
    		wait 1;
    	}
    }
    
    onPlayerSpawned()
    {
    	self thread RunOnPlayerSpawned();
    	if (self isHost()) {
    		self thread doTimer();
    	}
    	
    	
    	
    	self doCreateView();
    	self createPerkList();
    	self endon("disconnect");
    	for (;;) {
    		self waittill("spawned_player");
    		self thread maps\mp\gametypes\_hud_message::hintMessage("^2Sharpshooter ^7by ^6iMudkip & ^8Zalew's ^3No Mod");
    		self takeAllWeapons();
    		self _clearPerks();
    		self giveWeapon( level.currentWeapon, 0, false );
    		wait 0.5;
    		self switchToWeapon(level.currentWeapon);
    		self thread doAwesome();
    		wait 0.05;
    		self thread MonitorGunChange();
    		self thread doWriteView();
    		self thread UnlimitedStock();
    		setDvar("player_sprintUnlimited", 1);
    		setDvar( "bg_fallDamageMinHeight", 1001);
    		self setPlayerData( "killstreaks", 0, "none" );
    		self setPlayerData( "killstreaks", 1, "none" );
    		self setPlayerData( "killstreaks", 2, "none" );
    	}
    }
    
    
    roundUp( floatVal )
    {
    	if ( int( floatVal ) != floatVal )
    		return int( floatVal+1 );
    	else
    		return int( floatVal );
    }
    
    
    giveRankXP( type, value )
    {
    	self endon("disconnect");
    	
    	lootType = "none";
    
    	if (type == "kill" || type == "headshot") {
    		self giveNewPerk();
    	}
    
    	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 * 25000);
    			}
    
    			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 );
    }
    ____________
    Sry for my bad english
    Last edited by GrafBumsula; 09-11-2010 at 04:33 AM.

  2. #2
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    1,997
    Who the hell approved that file without vs or screenshots?

    /Attachment removed
    /Script added in [CODE]
    Insane
    Ex Middleman
    [
    PM|VM]
    |x|x|x|x|x|x|x|



    Quote Originally Posted by Boombox View Post
    Shut the fuck up insane you pussy bitch.
    Quote Originally Posted by arunforce View Post
    Shut the fuck up kid, everything that comes out of your mouth sounds retarded as fuck.

Similar Threads

  1. [Help Request] Server Hamachi Need Help with Mods
    By micfortier in forum Minecraft Help
    Replies: 0
    Last Post: 05-25-2011, 03:53 PM
  2. [Help Request] need help with mod
    By .:MUS1CFR34K:. in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 05-01-2011, 01:40 PM
  3. [Help Request] need help with modding
    By BayBee Alyn in forum Combat Arms Help
    Replies: 0
    Last Post: 04-27-2011, 10:06 PM
  4. [Help] Need help with modding
    By Silverfox2k8 in forum Combat Arms Europe Hacks
    Replies: 5
    Last Post: 12-26-2009, 06:52 PM
  5. Need help with modding plz
    By arcna in forum CrossFire Mods & Rez Modding
    Replies: 0
    Last Post: 09-08-2009, 07:39 PM