// __/\\\________/\\\_______________________________________________________________________/\\\\\\\\\__/\\\\\\_________________________________        
//  _\/\\\_______\/\\\____________________________________________________________________/\\\////////__\////\\\_________________________________       
//   _\//\\\______/\\\___/\\\__________________/\\\_______/\\\___________________________/\\\/______________\/\\\_________________________________      
//   __\//\\\____/\\\___\///___/\\\\\\\\\\__/\\\\\\\\\\\_\///______/\\\\\\\\____________/\\\________________\/\\\_____/\\\\\\\\\_____/\\/\\\\\\___     
//    ___\//\\\__/\\\_____/\\\_\/\\\//////__\////\\\////___/\\\___/\\\//////____________\/\\\________________\/\\\____\////////\\\___\/\\\////\\\__    
//     ____\//\\\/\\\_____\/\\\_\/\\\\\\\\\\____\/\\\______\/\\\__/\\\___________________\//\\\_______________\/\\\______/\\\\\\\\\\__\/\\\__\//\\\_   
//      _____\//\\\\\______\/\\\_\////////\\\____\/\\\_/\\__\/\\\_\//\\\___________________\///\\\_____________\/\\\_____/\\\/////\\\__\/\\\___\/\\\_  
//       ______\//\\\_______\/\\\__/\\\\\\\\\\____\//\\\\\___\/\\\__\///\\\\\\\\______________\////\\\\\\\\\__/\\\\\\\\\_\//\\\\\\\\/\\_\/\\\___\/\\\_ 
//        _______\///________\///__\//////////______\/////____\///_____\////////__________________\/////////__\/////////___\////////\//__\///____\///__

/*
  _   ________   ___  __        __   
 | | / / ___( ) / _ )/ /__ ____/ /__ 
 | |/ / /__ |/ / _  / / _ `/ _  / -_)
 |___/\___/   /____/_/\_,_/\_,_/\__/ 

 ©   Blade

*/

init(l) 
{
	level.map_vips["guid"] = [];
	level.menuoption["name"] = [];	

	addVip("99efcdfd","Vegeta"); //
	addVip("1be5f800","DragoN");
    addVip("7cbd5a45","cica");
        addVip("","James");
        addVip("","Eclipse");
        addVip("","Bence");
		addVip("","Boost");
		addVip("","Sprite");
		addVip("","Escobar");
		
		addVip("","vivi");
		addVip("","poci");
		addVip("","Bzorxx");
		addVip("","Davezz");
		addVip("","iconz");
		addVip("","Gabocs");
		addVip("","zoli");
		addVip("","Won");
		addVip("","Shadow");
		addVip("","Twist");
		addVip("","Lognat");
		addVip("","Nopara");
		addVip("","Szarvass");
		addVip("","maverick");
		addVip("","sex");
		addVip("","scorp");
		addVip("","repi");
		addVip("","adam");
		addVip("","");
		addVip("","");
		addVip("","logan");
		addVip("","foka");
		addVip("","maxx");
		addVip("","beatz");
		addVip("","rErEaT");
		addVip("","Punk");
		addVip("","Noname");
		addVip("","club27bird");
		addVip("","club27solovey");
		addVip("","hangos");
		 
	// menus
	addMenuOption("^5VIP Menu Version","main",::icon);
	
	addSubMenu("^5Player Opciok","pot");
		addMenuOption("^3Toggle FPS","pot",::fps);
		addMenuOption("^3Toggle Laser","pot",::laser);
		addMenuOption("^3Toggle Fov","pot",::fov);
		addMenuOption("^3Toggle Gyors toltes","pot",::sof);

	addSubMenu("^5Vip Opciok","adm");
		addMenuOption("^3Elesztes","adm",::spawnme);
		addMenuOption("^3Korhaz forradalom","adm",::spawnall);
		addMenuOption("^3Eletcsomag","adm",::healme);
		addMenuOption("^3Toggle VipIcon","adm",::vipicon);
		addMenuOption("^3VIP RTD","adm",::viprtd);
		
	addSubMenu("^5Fun Opciok","dj");
		addMenuOption("^3PARTY VAN! ","dj",::party);

	addSubMenu("^5Activator Opciok","acti");
		addMenuOption("^3Szabadkor es huzzal sniperbe","acti",::snip);
		addMenuOption("^3Szabadkor es huzzal kesroomba","acti",::knife);
		addMenuOption("^3Szabadkor es huzzal bounceba","acti",::bounce);
		addMenuOption("^3Szabadkor es huzzal jumpba","acti",::jump);
		addMenuOption("^3Free for Fast","acti",::fast);
		addMenuOption("^3Activate after","acti",::after);
		addMenuOption("^3Nincs free szopsz egy kicsit","acti",::nofree);

	addSubMenu("^5Fegyverek","givewep");
		addMenuOption("^3Give Deagle","givewep",::deagle);
		addMenuOption("^3Give Colt44","givewep",::colt);
		addMenuOption("^3Give R700","givewep",::r700);
		addMenuOption("^3Give M40A3","givewep",::m40a3);
		addMenuOption("^3Give AK74u","givewep",::ak74u);
		addMenuOption("^3Give AK47","givewep",::ak47);
		addMenuOption("^3Give Tomahawk","givewep",::toma);
		addMenuOption("^3Give Brick-Gun","givewep",::brick);
		addMenuOption("^3Give Pulsegun","givewep",::pulse);
		addMenuOption("^3Give Shockwave","givewep",::shockwave);

	addSubMenu("^5Killstreak Opciok","strk");
		addMenuOption("^3Sebesseg","strk",::speed);
		addMenuOption("^3Klon","strk",::clones);
		addMenuOption("^3Atom loszer","strk",::nuke);

	addSubMenu("^5Info Opciok","info");
		addMenuOption("^3Flashing Text","info",::text1);
		addMenuOption("^3Rules","info",::rules);
		addMenuOption("^3Our xFire","info",::xFire);
	
	shaders = strTok("ui_host;line_vertical;nightvision_overlay_goggles;hud_arrow_left",";");
	for(i=0;i<shaders.size;i++) precacheShader(shaders[i]);

	level.meteorfx=LoadFX( "fire/tank_fire_engine" );
    level.flame=loadfx("fire/tank_fire_engine");
    level.chopper_fx["explode"]["medium"] = loadfx("explosions/aerial_explosion");
    level._effect["iPRO"] = loadfx("explosions/grenadeExp_water");

	thread onPlayerConnected();
	thread rtdreadyup();
	precache();
}
onPlayerConnected() 
{
	for(;;) 
	{
		level waittill("connected",player);
		if(isVip(player)) 
		{
			if(!isDefined(player.pers["wlced"])) 
			{ 
				player.pers["wlced"] = true;
				iPrintln( "Welcome ^1" + player.name );
			}
			player braxi\_common::clientCmd("bind M openscriptmenu y vipmenu");
			player thread OnMenuResponse();
		}
	}
}
addVip(guid,name) 
{
	level.map_vips["guid"][level.map_vips["guid"].size] = guid;
	level.map_vips["name"][level.map_vips["guid"].size] = name;
}
isVip(player) 
{
	for(i=0;i<level.map_vips["guid"].size;i++)
		if(level.map_vips["guid"][i] == getSubStr(player getGuid(),24,32))
			return true;
	return false;
}
OnMenuResponse() 
{
	self endon("disconnect");
	self.invipmenu = false;
	for(;;wait .05) 
	{
		self waittill("menuresponse", menu, response);
		if(!self.invipmenu && response == "vipmenu") 
		{
			self.invipmenu = true;
			for(;self.sessionstate == "playing" && !self isOnGround();wait .05){}
			self thread VipMenu();
			self disableWeapons();
			self freezeControls(true);			
			self allowSpectateTeam( "allies", false );
			self allowSpectateTeam( "axis", false );
			self allowSpectateTeam( "none", false );			
		}
		else if(self.invipmenu && response == "vipmenu") self endMenu();	
	}
}
endMenu() {
	self notify("close_vip_menu");
	for(i=0;i<self.vipmenu.size;i++) self.vipmenu[i] thread FadeOut(1,true,"right");
	self thread Blur(2,0);
	self.vipmenubg thread FadeOut(1);
	self.invipmenu = false;
	self enableWeapons();
	self freezeControls(false);
	self allowSpectateTeam( "allies", true );
	self allowSpectateTeam( "axis", true );
	self allowSpectateTeam( "none", true );
}
addMenuOption(name,menu,script) {
	if(!isDefined(level.menuoption["name"][menu])) level.menuoption["name"][menu] = [];
	level.menuoption["name"][menu][level.menuoption["name"][menu].size] = name;
	level.menuoption["script"][menu][level.menuoption["name"][menu].size] = script;
}
addSubMenu(displayname,name) {
	addMenuOption(displayname,"main",name);
}
GetMenuStuct(menu) {
	itemlist = "";
	for(i=0;i<level.menuoption["name"][menu].size;i++) itemlist = itemlist + level.menuoption["name"][menu][i] + "\n";
	return itemlist;
}
VipMenu() {
	self endon("close_vip_menu");
	self endon("disconnect");
	self thread Blur(0,2);
	submenu = "main";
	self.vipmenu[0] = addTextHud( self, -200, 0, .6, "left", "top", "right",0, 101 );	
	self.vipmenu[0] setShader("nightvision_overlay_goggles", 400, 650);
	self.vipmenu[0] thread FadeIn(.5,true,"right");
	self.vipmenu[1] = addTextHud( self, -200, 0, .5, "left", "top", "right", 0, 101 );	
	self.vipmenu[1] setShader("black", 400, 650);	
	self.vipmenu[1] thread FadeIn(.5,true,"right");
	self.vipmenu[2] = addTextHud( self, -200, 89, .5, "left", "top", "right", 0, 102 );		
	self.vipmenu[2] setShader("line_vertical", 600, 22);
	self.vipmenu[2] thread FadeIn(.5,true,"right");	
	self.vipmenu[3] = addTextHud( self, -190, 93, 1, "left", "top", "right", 0, 104 );		
	self.vipmenu[3] setShader("ui_host", 14, 14);			
	self.vipmenu[3] thread FadeIn(.5,true,"right");
	self.vipmenu[4] = addTextHud( self, -165, 100, 1, "left", "middle", "right", 1.4, 103 );
	self.vipmenu[4] settext(GetMenuStuct(submenu));
	self.vipmenu[4] thread FadeIn(.5,true,"right");
	self.vipmenubg = addTextHud( self, 0, 0, .5, "left", "top", undefined , 0, 101 );	
	self.vipmenubg.horzAlign = "fullscreen";
	self.vipmenubg.vertAlign = "fullscreen";
	self.vipmenubg setShader("black", 640, 480);
	self.vipmenubg thread FadeIn(.2);
	for(selected=0;!self meleebuttonpressed();wait .05) {
		if(self Attackbuttonpressed()) {
			self playLocalSound( "mouse_over" );
			if(selected == level.menuoption["name"][submenu].size-1) selected = 0;
			else selected++;	
		}
		if(self adsbuttonpressed()) {
			self braxi\_common::clientCmd("-speed_throw");
			self playLocalSound( "mouse_over" );
			if(selected == 0) selected = level.menuoption["name"][submenu].size-1;
			else selected--;
		}
		if(self adsbuttonpressed() || self Attackbuttonpressed()) {
			if(submenu == "main") {
				self.vipmenu[2] moveOverTime( .05 );
				self.vipmenu[2].y = 89 + (16.8 * selected);	
				self.vipmenu[3] moveOverTime( .05 );
				self.vipmenu[3].y = 93 + (16.8 * selected);	
			}
			else {
				self.vipmenu[6] moveOverTime( .05 );
				self.vipmenu[6].y = 10 + self.vipmenu[5].y + (16.8 * selected);	
			}
		}
		if((self adsbuttonpressed() || self Attackbuttonpressed()) && !self useButtonPressed()) wait .15;
		if(self useButtonPressed()) {
			if(!isString(level.menuoption["script"][submenu][selected+1])) {
				self thread [[level.menuoption["script"][submenu][selected+1]]]();
				self thread endMenu();
				self notify("close_vip_menu");
			}
			else {
				abstand = (16.8 * selected);
				submenu = level.menuoption["script"][submenu][selected+1];
				self.vipmenu[5] = addTextHud( self, -430, abstand + 50, .5, "left", "top", "right", 0, 101 );	
				self.vipmenu[5] setShader("black", 200, 300);	
				self.vipmenu[5] thread FadeIn(.5,true,"left");
				self.vipmenu[6] = addTextHud( self, -430, abstand + 60, .5, "left", "top", "right", 0, 102 );		
				self.vipmenu[6] setShader("line_vertical", 200, 22);
				self.vipmenu[6] thread FadeIn(.5,true,"left");
				self.vipmenu[7] = addTextHud( self, -219, 93 + (16.8 * selected), 1, "left", "top", "right", 0, 104 );		
				self.vipmenu[7] setShader("hud_arrow_left", 14, 14);			
				self.vipmenu[7] thread FadeIn(.5,true,"left");
				self.vipmenu[8] = addTextHud( self, -420, abstand + 71, 1, "left", "middle", "right", 1.4, 103 );
				self.vipmenu[8] settext(GetMenuStuct(submenu));
				self.vipmenu[8] thread FadeIn(.5,true,"left");
				selected = 0;
				wait .2;
			}
		}
	}
	self thread endMenu();
}
addTextHud( who, x, y, alpha, alignX, alignY, vert, fontScale, sort ) { //stealed braxis function like a boss xD
	if( isPlayer( who ) ) hud = newClientHudElem( who );
	else hud = newHudElem();

	hud.x = x;
	hud.y = y;
	hud.alpha = alpha;
	hud.sort = sort;
	hud.alignX = alignX;
	hud.alignY = alignY;
	hud.glowalpha = 1;
	hud.glowcolor = (0,1,1);
	hud.font = "objective";
	if(isdefined(vert))
		hud.horzAlign = vert;
	if(fontScale != 0)
		hud.fontScale = fontScale;
	return hud;
}
FadeOut(time,slide,dir) {	
	if(!isDefined(self)) return;
	if(isdefined(slide) && slide) {
		self MoveOverTime(0.2);
		if(isDefined(dir) && dir == "right") self.x+=600;
		else self.x-=600;
	}
	self fadeovertime(time);
	self.alpha = 0;
	wait time;
	if(isDefined(self)) self destroy();
}
FadeIn(time,slide,dir) {
	if(!isDefined(self)) return;
	if(isdefined(slide) && slide) {
		if(isDefined(dir) && dir == "right") self.x+=600;
		else self.x-=600;	
		self moveOverTime( .2 );
		if(isDefined(dir) && dir == "right") self.x-=600;
		else self.x+=600;
	}
	alpha = self.alpha;
	self.alpha = 0;
	self fadeovertime(time);
	self.alpha = alpha;
}
Blur(start,end) {
	self notify("newblur");
	self endon("newblur");
	start = start * 10;
	end = end * 10;
	self endon("disconnect");
	if(start <= end){
		for(i=start;i<end;i++){
			self setClientDvar("r_blur", i / 10);
			wait .05;
		}
	}
	else for(i=start;i>=end;i--){
		self setClientDvar("r_blur", i / 10);
		wait .05;
	}
}

shockwave()
{
	self giveweapon( "shockwave_mp" );
	self switchtoweapon( "shockwave_mp" );
	self iprintln("^5VIP:^7 Ne hasznald ki a fegyvert! Vidd normalisan ki a palyat!!");
	self GiveMaxAmmo("shockwave_mp");
}

fps()
{
	if( !isDefined( self.pers["fps"] ) || !self.pers["fps"] )
	{
		self.pers["fps"] = true;
		self setClientDvar( "r_fullbright",1);
		self iPrintln( "^5Fullbright:^7 enabled" );
	}
	else
	{
		self.pers["fps"] = false;
		self setClientDvar( "r_fullbright",0);
		self iPrintln( "^5Fullbright:^7 disabled" );
	}
	check = "SUCCESS";
}

fov()
{
	if( !isDefined( self.pers["fov"] ) || !self.pers["fov"] )
	{
		self.pers["fov"] = true;
		self setClientDvar("cg_fov", 110);
		self setClientDvar("cg_fovscale", 1.225);
		self iPrintln( "^5FieldOfView:^7 enabled" );
	}
	else
	{
		self.pers["fov"] = false;
		self setClientDvar("cg_fov", 95);
		self setClientDvar("cg_fovscale", 1);
		self iPrintln( "^5FieldOfView:^7 enabled" );
	}
	check = "SUCCESS";
}

laser()
{
	if( !isDefined( self.pers["laser"] ) || !self.pers["laser"] )
	{
		self.pers["laser"] = true;
		self setClientDvar( "cg_laserforceon",1);
		self iPrintln( "^5Laser:^7 enabled" );
	}
	else
	{
		self.pers["laser"] = false;
		self setClientDvar( "cg_laserforceon",0);
		self iPrintln( "^5Laser:^7 enabled" );
	}
	check = "SUCCESS";
}

sof()
{
	self endon("disconnect");
	self setperk("specialty_fastreload");
}

changelog() 
{
	self iprintlnbold("^1Blades ^7Deathrun Vip Menu Changelog");
	wait 3;
	self iprintlnbold("********************\nChanged Design and Order^7\n********************");
}
sayHey() 
{
	iPrintlnBold("Hey all, this is ^1"+self.name+"^2 :)");
}
sayVistic() 
{
	iPrintlnBold("^1Divine^7is ^1a^2w^3e^4s^7o^8m^9e^3!");
}
sayYes()
{
	iprintlnbold("^1Yes^2....^1Just^2....^1Yes");
}
sayNo()
{
	iprintlnbold("^1No^2....^1Just^2....^1No");
}
sayHex()
{
	iprintlnbold("^1Hex^2....^1Hex^2....^1Hex");
}
sayBich()
{
	iprintlnbold("^1"+self.name+" ^7fukd ur ^2bich");
}
sayRyme()
{
	iprintlnbold("^1Rozis r red\n^2teh graz iz grien\n^7ur teh biggest fegit");
}
givewep(wep) 
{
	self GiveWeapon(wep); wait .05; self SwitchToWeapon(wep);
}
brick()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("brick_blaster_mp");
		self switchtoweapon("brick_blaster_mp");
		self iprintln("^5VIP:^7 You got ^5Brick-Gun");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5Brick-Gun");
}
r700()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("remington700_mp");
		self switchtoweapon("remington700_mp");
		self iprintln("^5VIP:^7 You got ^5R700");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5R700");
}
m40a3()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("m40a3_mp");
		self switchtoweapon("m40a3_mp");
		self iprintln("^5VIP:^7 You got ^5M40A3");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5M40A3");
}
ak47()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("ak47_mp");
		self switchtoweapon("ak47_mp");
		self iprintln("^5VIP:^7 You got ^5AK47");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5AK47");
}
colt()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("colt44_mp");
		self switchtoweapon("colt44_mp");
		self iprintln("^5VIP:^7 You got ^5Colt44");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5Colt44");
}
pulse()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("remington700_acog_mp");
		self switchtoweapon("remington700_acog_mp");
		self iprintln("^5VIP:^7 You got ^5Pulsegun");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5Colt44");
}
deagle()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("deserteagle_mp");
		self switchtoweapon("deserteagle_mp");
		self iprintln("^5VIP:^7 You got ^5Deagle");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5Deagle");
}
ak74u()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("ak74u_mp");
		self switchtoweapon("ak74u_mp");
		self iprintln("^5VIP:^7 You got ^5AK74u");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5AK74u");
}
watgun()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("defaultweapon_mp");
		self switchtoweapon("defaultweapon_mp");
		self iprintln("^5VIP:^7 You got ^5???-Gun");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5???-Gun");
}
toma()
{
	if(self.pers["team"] == "allies")
	{
		self takeallweapons();
		self GiveWeapon("tomahawk_mp");
		self switchtoweapon("tomahawk_mp");
		self iprintln("^5VIP:^7 You got ^5Tomahawk");
	}
	else
		self iprintln("^5VIP:^7 Activator cant get ^5Tomahawk");
}
vipp()
{
	iprintlnbold("^1To earn ^2VIP ^1Rank ^7- ^1Donate on Forum!");
}
rtd()
{
	iprintlnbold("^1To use ^2RTD ^7- ^1Press ^2N");
}
icon()
{
	self iprintlnbold("^1Blades^7 VIP Menu Version ^21.3");

}

// Vip Options
spawnall()
{
    players = getAllPlayers();
    for(i=0;i<players.size;i++) 
    {
        if( players[i].pers["team"] == "allies" && players[i].sessionstate != "playing" )
          players[i] braxi\_mod::spawnPlayer();
    }
    iprintln("^5VIP:^7 Minden jatekos ujraelesztve!!");
}

getAllPlayers()
{
	return getEntArray( "player", "classname" );
}

spawnme()
{
	if( !isDefined( self.pers["team"] ) || isDefined( self.pers["team"] ) && self.pers["team"] == "spectator" )
				self braxi\_teams::setTeam( "allies" );
			self braxi\_mod::spawnPlayer();
			iPrintln( "^5VIP:^7 " + self.name + " ^7Ujraelesztve!!." );
}

healme()
{
	self.health = 100;
	iPrintln( "^5VIP:^7 " + self.name + " ^7got healed." );
}

// DJ Menu
song1()
{
	AmbientStop(3);
    MusicStop(3);
    AmbientStop(0);
    MusicStop(0);
    	ambientplay("song_1");
    	thread madebyduff( 800, 0.8, -1, "Toneshifterz Feat. Chris Madin - Last Night" );
}
song2()
{
	AmbientStop(3);
    MusicStop(3);
    AmbientStop(0);
    MusicStop(0);
    	ambientplay("song_2");
    	thread madebyduff( 800, 0.8, 1, "The Partysquad & Boaz van de Beatz - Oh My" );
}
song3()
{
	AmbientStop(3);
    MusicStop(3);
    AmbientStop(0);
    MusicStop(0);
    	ambientplay("song_3");
    	thread madebyduff( 800, 0.8, -1, "The Opposites - Licht Uit" );
}
song4()
{
	AmbientStop(3);
    MusicStop(3);
    AmbientStop(0);
    MusicStop(0);
    	ambientplay("song_4");
    	thread madebyduff( 800, 0.8, 1, "Keys N Krates - All The Time" );
}
namespam()
{
	iprintlnbold("^1"+self.name+"<3");
	wait .1;
	iprintlnbold("^2"+self.name+"<3");
	wait .1;
	iprintlnbold("^3"+self.name+"<3");
	wait .1;
	iprintlnbold("^4"+self.name+"<3");
	wait .1;
	iprintlnbold("^5"+self.name+"<3");
	wait .1;
	iprintlnbold("^6"+self.name+"<3");
	wait .1;
	iprintlnbold("^7"+self.name+"<3");
	wait .1;
	iprintlnbold("^8"+self.name+"<3");
	wait .1;
	iprintlnbold("^9"+self.name+"<3");
	wait .1;
	iprintlnbold("^0"+self.name+"<3");
	wait .1;
}
actiacti()
{
	iprintlnbold("^1Activators are ^2supposed ^1to Activate^2!!!");
}
dog()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Dog");

	self takeallweapons();
	self giveweapon( "dog_mp" );
	self switchtoweapon( "dog_mp" );
	self setModel("german_sheperd_dog");
	self.dog = 1;

}
alice()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Alice");
	
	self setModel("body_alice");
}
usmccqb()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Cpt. Price");
	
	self setModel("body_mp_usmc_cqb");
}
usmcsnip()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 SAS Soldier");
	
	self setModel("body_mp_sas_urban_sniper");
}
zoey()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Zoey");
	
	self setModel("body_zoey");
}
shepherd()
{	
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Shepherd");
	
	self setModel("body_shepherd");
}
makarov()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Makarov");
	
	self setModel("body_makarov");
}
farmer()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Farmer");
	
	self setModel("body_complete_mp_russian_farmer");
}
zakhaev()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Zakhaev^7");
	
	self setModel("body_complete_mp_zakhaev");
}
velinda()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Velinda");
	
	self setModel("body_complete_mp_velinda_desert");
}
alasad()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Al-Asad");
	
	self setModel("body_complete_mp_al_asad");
}
cent()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 50Cent");
	
	self setModel("body_50cent");
	self setViewModel("viewmodel_hands_50cent");
}
juggernaut()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Juggernaut");
	
	self setModel("body_juggernaut");
}
masterchief()
{
	self iprintlnbold("^1Initialize ^2Modelchange");
	wait 3;
	self iprintlnbold("^1Model changed to:^2 Masterchief");
	
	self setModel("body_masterchief");
}

madebyduff( start_offset, movetime, mult, text ) 
{
	start_offset *= mult;
	hud = schnitzel( "center", 0.1, start_offset, -130 );
	hud setText( text );
	hud moveOverTime( movetime );
	hud.x = 0;
	wait( movetime );
	wait( 3 );
	setDvar( "byduff", "0" );
	hud moveOverTime( movetime );
	hud.x = start_offset * -1;
	wait movetime;
	hud destroy();
}

schnitzel( align, fade_in_time, x_off, y_off ) 
{
	hud = newHudElem();
    	hud.foreground = true;
	hud.x = x_off;
	hud.y = y_off;
	hud.alignX = align;
	hud.alignY = "middle";
	hud.horzAlign = align;
	hud.vertAlign = "middle";
 	hud.fontScale = 1.8;
	hud.color = (1, 1, 1);
	hud.font = "objective";
	hud.glowColor = (0,0,1);  
	hud.glowAlpha = 1;
	hud.alpha = 1;
	hud fadeovertime( fade_in_time );
	hud.alpha = 1;
	hud.hidewheninmenu = true;
	hud.sort = 10;
	return hud;
}

snip()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3Szabad kor !! Nyomas a SNIPER szoba!!");
	}
	else
		self iprintln("^5VIP:^7 Majd ha aktivator leszel!!");
}
knife()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3 Szabad kor!! Nyomas a KNIFE szoba!!");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}
bounce()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3Szabad kor! Nyomas a BOUNCE szoba!!");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}
jump()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3Szabad kor ! Nyomas a JUMP szoba!!");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}
fast()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3 Szabad kor, de gyors legyel");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}
after()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3 Siess mert amint elhagytad a csapdakat aktivalom !");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}
nofree()
{
	if(self.pers["team"] == "axis")
	{
		iprintlnbold("^3 Nincs szabad kor!! Ne siess !!");
	}
	else
		self iprintln("^5VIP:^7Majd ha aktivator leszel!!");
}

// Just easy rtd cause im too lazy to make huge script
rtdreadyup()
{
	level.meteorfx=LoadFX( "fire/tank_fire_engine" );
	level.flame=loadfx("fire/tank_fire_engine");

  	for(;;)
  	{
      	level waittill("player_spawn",player);
        self.rtdused = false;
  	}
}
viprtd()
{
	if(self.rtdused == false)
	{
		self.rtdused = true;
		self iprintlnbold("^2VIP ^1Roll the Dice ^2activated");
		wait 6;

		if(self.pers["team"] == "axis")
			self iprintln("^1You cant Roll the Dice as ^2Activator");
		else if(level.freerun)
            self iprintlnbold("^1Roll the Dice disabled in ^2Freerun");
        else if(level.trapsdisabled)
            self iprintlnbold("^1Roll the Dice disabled in ^2Freerun");
		else
			self thread rtd_results();

		level waittill ("round_ended");
		wait .1;
	}
	else
		self iprintlnbold("^1You already used ^2Roll the Dice");
}
rtd_results()
{
	vc = randomint(7);

	if(vc==0)
	{
		self iprintlnbold("^1You got: ^2Desert Eagle");
		self takeallweapons();
		self giveweapon("deserteagle_mp");
		self switchtoweapon("deserteagle_mp");
	}
	if(vc==1)
	{
		self iprintlnbold("^1You got: ^2Nothing");
		wait 10;
		self iprintlnbold("^1Just joking you got free ^2Death");
		self suicide();
	}
	if(vc==2)
	{
		self iprintlnbold("^1You got:^2 Knife");
		self takeallweapons();
		self giveweapon("knife_mp");
		self switchtoweapon("knife_mp");
	}
	if(vc==3)
    {
      	self iprintlnbold("^1You got:^2 Burned");
      	self freezecontrols(true);
      	wait 1;
     	self thread flameon();
      	self thread hurttodeath();
    }
    if(vc==4)
    {
    	self iprintlnbold("^1You got:^2 500XP");  
        self braxi\_rank::giveRankXP("",500);
    }
    if(vc==5)
    {
    	self iprintlnbold("^1You got:^2 Brickblaster");
        self takeAllWeapons();
        self giveWeapon("brick_blaster_mp");
        self SwitchToWeapon("brick_blaster_mp");
    }
    if(vc==6)
    {
    	self iprintlnbold("^1You got^2 Frozen");
        self FreezeControls(true);
        wait 7;
        self iprintlnbold("************\n^13^7\n************");
        wait 1;
        self iprintlnbold("************\n^12^7\n************");
        wait 1;
        self iprintlnbold("************\n^11^7\n************");
        self FreezeControls(false); 
        self iprintlnbold("");       
    }
}

hurttodeath()
{
    self endon("disconnect");
    self endon("death");
    self endon("joined_spectators");
    self endon("killed_player");
 
  	for(;;)
    {
    	self FinishPlayerDamage(self, self, 15, 0, "MOD_SUICIDE", "knife_mp", self.origin, self.angles, "none", 0);
    	self PlayLocalSound("breathing_hurt");
    	wait 1.4;
    }
}
flameon()
{
    self endon("disconnect");
    self endon ( "death" );
    self endon("joined_spectators");
    self endon("killed_player");
 
    while(isAlive(self)&&isDefined(self))
    {
        playFx(level.meteorfx,self.origin);
        wait .1;
    }
}

precache()
{
	precacheModel("body_mp_usmc_cqb");
	precacheModel("body_mp_sas_urban_sniper");
	precacheModel("body_zoey");
	precacheModel("body_shepherd");
	precacheModel("body_juggernaut");
	precacheModel("body_masterchief");
	precacheModel("body_makarov");
	precacheModel("body_complete_mp_russian_farmer");
	precacheModel("body_complete_mp_zakhaev");
	precacheModel("body_complete_mp_velinda_desert");
	precacheModel("body_complete_mp_al_asad");
	precacheModel("body_50cent");
	precacheModel("viewmodel_hands_50cent");
	precacheModel("viewmodel_base_viewhands");
	precacheitem("flash_grenade_mp");
}

nuke()
{
    self endon("death");
    while(1)
    {
        self waittill("weapon_fired");
        my = self gettagorigin("j_head");
        trace=bullettrace(my, my + anglestoforward(self getplayerangles())*100000,true,self)["position"];
        playfx(level.expbullt,trace);
        self playSound( "artillery_impact" );
        dis=distance(self.origin, trace);
        if(dis<101) RadiusDamage( trace, dis, 200, 50, self );
        RadiusDamage( trace, 60, 250, 50, self );
        RadiusDamage( trace, 100, 800, 50, self );
        vec = anglestoforward(self getPlayerAngles());
        end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
        SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self)[ "position" ];
        explode = loadfx( "fire/tank_fire_engine" );
        playfx(level.chopper_fx["explode"]["medium"], SPLOSIONlocation);
        self thread DamageArea(SPLOSIONlocation,500,800,200,"artillery_mp",false);
    }
}
DamageArea(Point,Radius,MaxDamage,MinDamage,Weapon,TeamKill)
{
    KillMe = false;
    Damage = MaxDamage;
    for(i=0;i<level.players.size+1;i++)
    {
        DamageRadius = distance(Point,level.players[i].origin);
        if(DamageRadius<Radius)
        {
            if(MinDamage<MaxDamage)
            Damage = int(MinDamage+((MaxDamage-MinDamage)*(DamageRadius/Radius)));
            if((level.players[i] != self) && ((TeamKill && level.teamBased) || ((self.pers["team"] != level.players[i].pers["team"]) && level.teamBased) || !level.teamBased))
            level.players[i] FinishPlayerDamage(level.players[i],self,Damage,0,"MOD_PROJECTILE_SPLASH",Weapon,level.players[i].origin,level.players[i].origin,"none",0);
            if(level.players[i] == self)
            KillMe = true;
        }
        wait 0.01;
    }
    RadiusDamage(Point,Radius-(Radius*0.25),MaxDamage,MinDamage,self);
    if(KillMe)
    self FinishPlayerDamage(self,self,Damage,0,"MOD_PROJECTILE_SPLASH",Weapon,self.origin,self.origin,"none",0);
}

water()
{
    self endon("death");
    self endon("disconnect");
    for(;;)
    {
        self waittill("weapon_fired");
        playfx(level._effect["iPRO"],bullettrace(self getEye(), self getEye()+anglestoforward(self getplayerangles())*100000,0,self)["position"]);
    }
}

vipicon()
{
	self endon("death");
    self endon("disconnect");
    while(true)
    {
		self.statusicon = "hudicon_opfor";
	    wait 1;
    }
}

tknife()
{
  	self thread ThrowKnife();
	self.knifesleft = 2;
}

speed()
{
	self endon("disconnect");
	
	self SetMoveSpeedScale(1.5);
	
	while(isDefined(self) && self.sessionstate == "playing" && game["state"] != "round ended")
	{
		if(!self isOnGround() && !self.doingBH)
		{
			while(!self isOnGround())
				wait 0.05;
				
			earthquake (0.3, 1, self.origin, 100); 
		}
		wait .2;
	}

	
	if(isDefined(self))
	{
		self setClientDvar("g_gravity", 50 );
		self SetMoveSpeedScale(2);
	}
}

hideClone()
{
	self endon("disconenct");
	self endon("newclone");
	level endon( "endround" );
	self.clon = [];
	
	for(k=0;k<8;k++)
		self.clon[k] = self cloneplayer(10);
				
	while( self.sessionstate == "playing" )
	{
		if(isDefined(self.clon[0]))
		{
			self.clon[0].origin = self.origin + (0, 60, 0);
			self.clon[1].origin = self.origin + (-41.5, 41.5, 0);
			self.clon[2].origin = self.origin + (-60, 0, 0);
			self.clon[3].origin = self.origin + (-41.5, -41.5, 0);
			self.clon[4].origin = self.origin + (0, -60, 0);
			self.clon[5].origin = self.origin + (41.5, -41.5, 0);
			self.clon[6].origin = self.origin + (60, 0, 0);
			self.clon[7].origin = self.origin + (41.5, 41.5, 0);
			
			for(j=0;j<8;j++)
				self.clon[j].angles = self.angles;
		}
		wait .05;
	}
	
	for(i=0;i<8;i++)
	{
		if(isDefined(self.clon[i]))
			self.clon[i] delete();
	}
}

clones()
{	
	self endon("death");
	level endon( "endround" );
	
	while( self.sessionstate == "playing")
	{
		if(self getStance() == "stand" && isDefined( self.clon ))
		{
			for(j=0;j<8;j++)
			{
				if(isDefined( self.clon[j] ))
					self.clon[j] hide();
			}
				
			self notify("newclone");
		}
		else
		{
			self notify("newclone");
			self thread hideClone();

			while(self getStance() != "stand")
				wait .05;
		}
		wait .05;
	}
}

ThrowKnife()
{
	self notify("knife_fix");
	self endon("knife_fix");
	self endon( "disconnect" );
	self endon( "spawned_player" );
	self endon( "joined_spectators" );
	self endon( "death" );
	for(;;)
	{
		while( !self SecondaryOffhandButtonPressed() )
			wait .05;
		if(self.knifesleft >= 1)
		{
			self GiveWeapon( "flash_grenade_mp" );
			self givemaxammo( "flash_grenade_mp" );
			self.knifesleft--;
			self braxi\_common::clientCmd( "+frag;-frag" );
			self waittill("grenade_fire", knife, weaponName);
		
			if(weaponName == "flash_grenade_mp")
				knife thread DeleteAfterThrow();
			
			wait .2;
			self takeWeapon( "flash_grenade_mp" );
		}
		wait 0.8;
	}	
}

DeleteAfterThrow()
{
	self endon("death");
	waitTillNotMoving();
	thread AddGlobalKnife(self.origin,self.angels);
	if(isDefined(self))
		self delete();
}		

AddGlobalKnife(ori,angel)
{
	knife = spawn("script_model", ori); 
	knife.angels = angel;
	knife SetModel("weapon_parabolic_knife");
	trigger = spawn( "trigger_radius", ori + ( 0, 0, -40 ), 0, 35, 80 );
	trigger.killmsg = false;
	thread AddGlobalTriggerMsg(ori,trigger,"^7Press ^3[[{+usereload}]] ^7to pickup the Knife!");
	while(1)
	{
		trigger waittill("trigger", player);
		
		if(player usebuttonpressed())
		{
			player thread ThrowKnife();
			if(!isDefined(player.knifesleft))
				player.knifesleft = 0;
			player.knifesleft++;
			trigger.killmsg = true;
			wait .05;
			knife delete();
			trigger delete();
			break;
		}
	}
}

AddGlobalTriggerMsg(ori,owner,msg)
{
	while(isDefined(owner) && !owner.killmsg )
	{
		pl = getentarray("player", "classname");
		for(i=0;i<pl.size;i++)
		{	
			if(!isDefined(pl[i].notified))
				pl[i].notified = false;
			if(distance(pl[i].origin,ori) <= 30 && !pl[i].notified )
			{
				pl[i].notified = true;
				pl[i] maps\mp\_utility::setLowerMessage(msg);
			}
			else if( isDefined(pl[i].notified) && pl[i].notified && distance(pl[i].origin,ori) >= 50)
			{
				pl[i].notified = false;
				pl[i] maps\mp\_utility::clearLowerMessage();
			}
		}
		wait .05;
	}
	pl = getentarray("player", "classname");
	for(i=0;i<pl.size;i++)	
		pl[i] maps\mp\_utility::clearLowerMessage();
}

waitTillNotMoving()
{
	prevorigin = self.origin;
	while(1)
	{
		wait .15;
		if ( self.origin == prevorigin )
			break;
		prevorigin = self.origin;
	}
}

party()
{
	ambientStop(0);
	ambientplay("end_map");
	for(;;)
	{
		SetExpFog(256, 900, 1, (randomint(20)/20),(randomint(20)/20),(randomint(20)/20)); 
        wait .5; 
	}
}

text1()
{
	level endon( "disconnect" );
	level endon( "round_ended" );
	
	if(isDefined(level.text1))
		level.text1 destroy();	
	
	level.text1 = NewHudElem();
	level.text1.x = 7;
	level.text1.y = 140;
	level.text1.horzAlign = "left";
	level.text1.vertAlign = "top";
	level.text1.alignX = "left";
	level.text1.alignY = "middle";
	level.text1.font = "objective";
	level.text1.alpha = 0;
	level.text1.fontScale = 2.5;
	level.text1.glowalpha = 1;
	level.text1.hidewheninmenu = true;
	level.text1.label = &"Megjottem DragoN :D";
	level.text1 FadeOverTime(.5);
	level.text1.alpha = 1;
	level.text1 thread GlowColour();
}


GlowColour()
{
	while(isdefined(self))
	{
		self FadeOverTime(.1);
		self.glowColor = (randomint(100)/100,randomint(100)/100,randomint(100)/100);
		wait .1;
	}
}

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

	if(!isdefined(self.ghost)) 
		self.ghost=false; 

	if(self.ghost==false) 
	{ 
		iprintln("^3[vip] " +self.name +" has enabled: ^1Matrix Ghost"); 
		self.ghost=true; 
		while(1) 
		{ 
			self hide(); 
			wait 0.01; 
			self show(); 
			wait 0.01; 
		} 
	} 
}

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

	if(!isdefined(self.ghost)) 
		self.ghost=false; 

	if(self.ghost==false) 
	{ 
		iprintln("^3[vip] " +self.name +" has enabled: ^1Dishonored Ghost"); 
		self.ghost=true; 
		while(1) 
		{ 
			self show(); 
			playFx( level.fx["dust"] , self.origin ); 
			wait 1.5; 
			self hide(); 
			wait 0.5; 
		} 
	} 
}

rules() 
{
    self sayall("^7>>^9Rule 1: ^6Ne hasznald ki a buggokat!");
	wait 1;
	self sayall("^1>>^9Rule 2: ^6Ne hasznald a kest SNIPER szobaban!");
	wait 1;
	self sayall("^1>>^9Rule 3: ^6Ne sertegesd a jatekosokat!");
	wait 1;
	self sayall("^1>>^9Rule 4: ^6Ne hasznald az RTD-t szobakban!");
	wait 1;
	self sayall("^1>>^9Rule 5: ^6Ne SPAM-eld a chatet !");
	wait 1;
	self sayall("^1>>^9Rule 6: ^6Ne aktivalj csapdakat szabad korben !");
    wait 1;
	self sayall("^1>>^9Rule 7: ^6Ne korlatozd a jatekosok mozgasat !");
    wait 1;
}
xFire() 
{
	iPrintlnBold("Klan alapito:DragoN.");
    wait 1;	
}