//======================================================================================
//
// Project: 		CIVIL's MW2 Movie Mod						
//											
// Author:		Civil, :Add your name if you modify something:			
//											
// Purpose: 		VER#13 - IW4 Movie mod w/ dvars integration			
//											
// Last Update: 	07/23/2015 16:20				
//											
// Desc + ToDo: 	Desc - Main file						
//	
//======================================================================================
//											
//   Feel free to use the code, just give CREDIT where CREDIT is due !!!
//   If you had problems, just contact me on skype (about.txt)	
//   Don't try to change smth by yourself if you have problems	
//											
//======================================================================================

#include maps\mp\gametypes\_hud_message;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
#using_animtree( "destructibles" );

ayy()
{
    	precacheShader("rank_prestige9");
	level.civil = "rank_prestige9";
	level thread LetsStart();
}

LetsStart()
{

	level._effect["billey"] = loadfx("props/cash_player_drop");
	level._effect["blood"] = loadfx("impacts/flesh_hit_body_fatal_exit");
	
	precacheModel( "weapon_light_stick_tactical_bombsquad" );
	precacheModel( "test_sphere_silver" );
	precacheItem("lightstick_mp");
	
	wait 0.1;
	level thread PrimaryDvars();
}

PrimaryDvars()
{
    for(;;)
    {
        level waittill( "connected", player );
	thread maps\mp\movie\_cmds::init();
        player thread PlayerSpawn();
    }
}

PlayerSpawn()
{
    self endon( "disconnect" );
    for(;;)
    {
        self waittill("spawned_player");
	self thread HelloWorld();

	setDvar("camera_thirdperson", "0");
	self show();

	self maps\mp\perks\_perks::givePerk("specialty_falldamage");
	notifyData = spawnstruct();
	notifyData.sound = "mp_level_up";
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

	//----------------------------------
	// REGEN	
	thread RegenAmmo();
        thread RegenEquip();
	thread RegenSpec();

	//----------------------------------
	//SPAWN AND OTHER BOT SHIT
	thread BotSpawn();
	thread BotSetup(); 
	thread BotAim();
	self thread BotModel();      // Works only when put "self" so yh
	thread VerifyModel();

	//----------------------------------
	//SPEED
        thread SpeedNormal();
        thread SpeedSlow();
	thread UnlockTimescale();

	//----------------------------------
	//EBs
	thread EnableEB1();
	thread EnableEB2();

	//----------------------------------
	//KILLS
	thread KillBot();
	thread EnableLink();
        
	//----------------------------------
	//ENVIRONEMENT & VISIONS
	thread SpawnProps();
	thread SpawnFxThingy();
	thread SpawnHeli();
	thread SpawnKFC();
	thread Fog();
	thread SetVisions();

	//----------------------------------
	// GAMEPLEYYY
	thread PointsPerKill();
	thread GibeKillStreak();
	thread CoD4Give();
	
	//----------------------------------
	//OTHERS
	thread Handy();
	thread clone();
	thread stick();
	thread loadPos();
        thread noclip();
	//thread Instaclass();
	
    }
}

//====================================== REGEN ========================================

RegenAmmo()
{
	for(;;)
	{
		self notifyOnPlayerCommand( "reload", "+reload" );
		self waittill( "reload" );

		wait 0.420;

		if (self.pers["rAmmo"] == "true")
		{
			currentWeapon = self getCurrentWeapon();
			self giveMaxAmmo( currentWeapon );
		}
	}
}

RegenEquip()
{
	for(;;)
	{
		self notifyOnPlayerCommand( "frag", "+frag" );
		self waittill( "frag" );

		currentOffhand = self GetCurrentOffhand();
		self.pers["equ"] = currentOffhand;

		wait 2;

		if (self.pers["rEquip"] == "true")
		{
			self setWeaponAmmoClip( currentOffhand, 9999 );
			self GiveMaxAmmo( currentOffhand );
		}
	}
}

RegenSpec()
{
	for(;;)
	{
		self notifyOnPlayerCommand( "smoke", "+smoke" );
		self waittill( "smoke" );

		currentOffhand = self GetCurrentOffhand();
		self.pers["equSpec"] = currentOffhand;

		wait 2;

		if (self.pers["rSpec"] == "true")
		{
			self giveWeapon( self.pers["equSpec"] );
			self giveMaxAmmo( currentOffhand );
			self setWeaponAmmoClip( currentOffhand, 9999 );
		}
	}
}


//================================= BOT RELATED SHIT ==================================


BotSpawn()
{
	self endon("disconnect");
	self endon("death");
	
	self notifyOnPlayerCommand( "mvm_spawn", "mvm_spawn" );
	for(;;)
	{
        self waittill( "mvm_spawn" );

        for(i = 0; i < 1; i++)
        {
                ent[i] = addtestclient();

                if (!isdefined(ent[i]))
                {
                        wait 1;
                        continue;
                }

                ent[i].pers["isBot"] = true;
		ent[i] thread lePrestige();
                ent[i] thread BotChoose();
                wait 0.1;
        }
    }
}

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

    argumentstring = getDvar("mvm_spawn", "");
    arguments = StrTok(argumentstring, " ,");

    setDvar("arg_bot_weap", arguments[0]);
    setDvar("arg_bot_team", arguments[1]);

    while(!isdefined(self.pers["team"]))
            wait .05;
    self notify("menuresponse", game["menu_team"], getDvar("arg_bot_team", "")); // I modified the classes, go boot <3
    wait 0.5;
    if( getDvar("arg_bot_weap", "") == "inter" )				// Change the premade name by the weapon list ?
    {
    	self notify("menuresponse", "changeclass", "class" + 8);
    }
    else if( getDvar("arg_bot_weap", "") == "ballista" )
    {
        self notify("menuresponse", "changeclass", "class" + 7);
    }
    else if( getDvar("arg_bot_weap", "") == "mp5" )
    {
        self notify("menuresponse", "changeclass", "class" + 6);
    }
    else if( getDvar("arg_bot_weap", "") == "m4" )
    {
        self notify("menuresponse", "changeclass", "class" + 5);
    }
    else if( getDvar("arg_bot_weap", "") == "riot" )
    {
        self notify("menuresponse", "changeclass", "class" + 4);
    }
    else if( getDvar("arg_bot_weap", "") == "barrett" )
    {
        self notify("menuresponse", "changeclass", "class" + 3);
    }
    else if( getDvar("arg_bot_weap", "") == "ak47" )
    {
        self notify("menuresponse", "changeclass", "class" + 2);
    }
    else if( getDvar("arg_bot_weap", "") == "ump" )
    {
        self notify("menuresponse", "changeclass", "class" + 1);
    }
    else if( getDvar("arg_bot_weap", "") == "deagle" )
    {
        self notify("menuresponse", "changeclass", "class" + 0);
    }
    self waittill( "spawned_player" );
}

BotSetup()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_setup", "mvm_setup" );
    for(;;)
    {
        self waittill( "mvm_setup" );

        start = self getTagOrigin( "tag_eye" );
        end = anglestoforward(self getPlayerAngles()) * 1000000;
        newpos = BulletTrace(start, end, true, self)["position"];

        foreach( player in level.players ) 
        {

            if(player.name == getDvar("mvm_setup", ""))
            {
                player setOrigin(newpos);
                player thread savespawn();
            }
        }
    }
}

BotAim()
{
    self endon( "death" );
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_aim", "mvm_aim" );
    for(;;)
    {
        self waittill( "mvm_aim" );

        foreach( player in level.players ) 
        {
            if( player.name == getDvar("mvm_aim", "") )
            {        
                player thread BotAim2();
                wait(0.4);
                self notify("stopaim");
            }
        }
    }
}

BotAim2()
{
        self endon( "death" );
        self endon( "disconnect" );
        self endon( "stopaim");
        
        for(;;) 
        {
                wait 0.01;
                aimAt = undefined;
                foreach(player in level.players)
                {
                        if( (player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || ( !isAlive(player) ) )
                                continue;
                        if( isDefined(aimAt) )
                        {
                                if( closer( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ) )
                                        aimAt = player;
                        }
                        else
                                aimAt = player;
                }
                if( isDefined( aimAt ) )
                {
                        self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
                        self notify("stopaim");
                }
        }
}

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

    self notifyOnPlayerCommand( "mvm_model", "mvm_model" );
    for(;;)
    {
	self waittill("mvm_model");

	argumentstring = getDvar("mvm_model", "");
    	arguments = StrTok(argumentstring, " ,");
    	setDvar("arg_client_name", arguments[0]);
    	setDvar("arg_model_name", arguments[1]);
	setDvar("arg_bot_team", arguments[2]);

	foreach( player in level.players ) 
        {
            if( player.name ==  getDvar("arg_client_name", ""))
            {
		player thread BotModel2();
	    }
	}
    }
}


BotModel2()
{
   self endon ( "disconnect" );
   self endon ( "death" );
	{
	
	team = getDvar("arg_bot_team", "");
	//team = self.team;
	player = self;

	if( getDvar("arg_model_name", "") == "assault" )
		{
		player detachAll();
		player [[game[team+"_model"]["ASSAULT"]]]();
		}

	else if( getDvar("arg_model_name", "") == "sniper")	
		{
		player detachAll();
		player [[game[team+"_model"]["SNIPER"]]]();
		}

	else if( getDvar("arg_model_name", "") == "ghillie")	
		{
		player detachAll();
		player [[game[team+"_model"]["GHILLIE"]]]();
		}

	else if( getDvar("arg_model_name", "") == "smg")	
		{
		player detachAll();
		player [[game[team+"_model"]["SMG"]]]();
		}

	else if( getDvar("arg_model_name", "") == "riot")	
		{
		player detachAll();
		player [[game[team+"_model"]["RIOT"]]]();
		}

	else if( getDvar("arg_model_name", "") == "lmg")	
		{
		player detachAll();
		player [[game[team+"_model"]["LMG"]]]();
		}

	else if( getDvar("arg_model_name", "") == "shotgun")	
		{
		player detachAll();
		player [[game[team+"_model"]["SHOTGUN"]]]();
		}
	
	self.modelalready = 1;
		
	lo = (getDvar("arg_client_name", ""),getDvar("arg_model_name", ""),getDvar("arg_bot_team", ""));
	setDvarIfUninitialized( "last_loadout", lo );
	wait 0.1;

	}
}

VerifyModel() // Its just an automatic BotModel thread. Idk how to make it shorter lmao
{
    self endon("death");
    self endon( "disconnect" );
    {
	if( isDefined(self.modelalready))
	{
		argumentstring = getDvar("mvm_model", "");
    		arguments = StrTok(argumentstring, " ,");
    		setDvar("arg_client_name", arguments[0]);
    		setDvar("arg_model_name", arguments[1]);
		setDvar("arg_bot_team", arguments[2]);

		foreach( player in level.players ) 
        	{
            		if( player.name ==  getDvar("arg_client_name", ""))
            		{
				player thread BotModel2();
	    		}
		}
	}
    }
}

//============================================ TIMESCALES=======================================


UnlockTimescale()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_timescale", "mvm_timescale" );
    for(;;)
    {
        self waittill( "mvm_timescale" );
	setDvar( "timescale", getDvar("mvm_timescale", "timescale") );
	self thread UnlockTimescale();
    }
}

SpeedNormal()
{
    self notifyOnplayerCommand( "1", "1" );
    self waittill("1");
    setDvar( "timescale", 1 );
    self thread SpeedSlow();
}

SpeedSlow()
{
    self notifyOnplayerCommand( "0.25", "0.25" );
    self waittill("0.25");
    setDvar( "timescale", 0.25 );
    self thread SpeedSlow();
}

//==================================1337 EXPLOSIVES BULLETS =============================


eb1()
{
	self endon("eb1off");
	self endon("disconnect");

	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);
		dis=distance(self.origin, trace);
		if(dis<101) RadiusDamage( trace, dis, 200, 50, self );
		RadiusDamage( trace, 100, 800, 50, self );
	}
}


EnableEB1()
{
    self endon("death");
    self endon("disconnect");
    self notifyOnPlayerCommand( "mvm_eb_close", "mvm_eb_close" );
    for(;;)
    {
	self waittill("mvm_eb_close");

	if( !isDefined(self.ebclose))
	{
	self thread eb1();
	self iPrintLn( "^5CLOSE EB ^2ON" );
	self.ebclose = 1;
	}
	else if(self.ebclose == 1)
	{
        self notify("eb1off");
	self iPrintLn( "^5CLOSE EB ^1OFF" );
	self.ebclose = undefined;
	}
     }
}

eb2()
{
        self endon( "disconnect" );
	self endon( "eb2off" );

        for(;;) 
        {
                wait 0.01;
                aimAt = undefined;
                foreach(player in level.players)
                {
                        if(player == self)
                                continue;
                        if(!isAlive(player))
                                continue;
                        if(level.teamBased && self.pers["team"] == player.pers["team"])
                                continue;
                        if( isDefined(aimAt) )
                        {
                                if( closer( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ) )
                                        aimAt = player;
                        }
                        else
                                aimAt = player;
                }
                if( isDefined( aimAt ) )
						
		self waittill ( "weapon_fired" );
                aimAt thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_UNKNOWN", self getCurrentWeapon(), (0,0,0), (0,0,0), "HEAD", 0 );
        }
}

EnableEB2()
{
    self endon("death");
    self endon("disconnect");
    self notifyOnPlayerCommand( "mvm_eb_magic", "mvm_eb_magic" );
    for(;;)
    {
	self waittill("mvm_eb_magic");

	if( !isDefined(self.ebmagic))
	{
	self thread eb2();
	self iPrintLn( "^5MAGIC EB ^2ON" );
	self.ebmagic = 1;
	}
	else if(self.ebmagic == 1)
	{
        self notify("eb2off");
	self iPrintLn( "^5MAGIC EB ^1OFF" );
	self.ebmagic = undefined;
	}
     }
}


//================================== KILLS ========================================



KillBot()
{
    self endon("death");
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_kill", "mvm_kill" );
    for(;;)
    {

	self waittill("mvm_kill");

	argumentstring = getDvar("mvm_kill", "");
    	arguments = StrTok(argumentstring, " ,");
    	
	setDvar("arg_client_name", arguments[0]);
    	setDvar("arg_meanofdeath", arguments[1]);
	
	foreach( player in level.players ) 
        {
            if( player.name ==  getDvar("arg_client_name", ""))
            {
		if(isDefined(self.linke))
		{
			player EnableLinkTo();
			player attach(getWeaponModel(player getCurrentWeapon()), "tag_weapon_right");
			player takeweapon(player getCurrentWeapon());
		}	
		player thread KillBot2();
	    }
	}
    }
}

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

	player = self; // lmao
	
	if( getDvar("arg_meanofdeath", "") == "head" )
		{
		player thread [[level.callbackPlayerDamage]]( self, self, 1337, 8, "MOD_SUICIDE", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0 );
		}
	else if( getDvar("arg_meanofdeath", "") == "body")	
		{
		player thread [[level.callbackPlayerDamage]]( self, self, 1337, 8, "MOD_SUICIDE", self getCurrentWeapon(), (0,0,0), (0,0,0), "body", 0 );
		}
	else if( getDvar("arg_meanofdeath", "") == "cash")	
		{
		level._effect["billey"] = loadfx ("props/cash_player_drop"); 
		level.player playFx( level._effect["billey"], self getTagOrigin( "j_spine4" ) );
		player thread [[level.callbackPlayerDamage]]( self, self, 1337, 8, "MOD_SUICIDE", self getCurrentWeapon(), (0,0,0), (0,0,0), "body", 0 );
		}
	else if( getDvar("arg_meanofdeath", "") == "blood")	
		{
        	level._effect["blood"] = loadfx("impacts/flesh_hit_body_fatal_exit");
		playFx( level._effect["blood"], self getTagOrigin( "j_spine4" ) );
		player thread [[level.callbackPlayerDamage]]( self, self, 1337, 8, "MOD_SUICIDE", self getCurrentWeapon(), (0,0,0), (0,0,0), "body", 0 );
		}
	}
}

EnableLink()
{
    self endon("death");
    self endon("disconnect");
    self notifyOnPlayerCommand( "mvm_holdgun", "mvm_holdgun" );
    for(;;)
    {
	self waittill("mvm_holdgun");

	if( !isDefined(self.linke))
	{
	foreach(player in level.players)
		{
		player iPrintLn( "^5HOLD WEAPON ^2ON" );
		self.linke = 1;
		}
	}
	else if(self.linke == 1)
	{
	foreach(player in level.players)
		{
		player iPrintLn( "^5HOLD WEAPON ^1OFF" );
		self.linke = undefined;
		}
	}
     }
}


//============================== ENVIRONEMENT AND VISIONS ================================


Fog()
{
    self endon( "death" ); 
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_fog", "mvm_fog" );
    for(;;)
    {
        self waittill( "mvm_fog" );
        
        argumentstring = getDvar("mvm_fog", "startdist halfwaydist red green blue transtime");
        arguments = StrTok(argumentstring, " ,");

        setDvar("arg_startdist", arguments[0]);
        setDvar("arg_halfwaydist", arguments[1]);
        setDvar("arg_red", arguments[2]);
        setDvar("arg_green", arguments[3]);
        setDvar("arg_blue", arguments[4]);
        setDvar("arg_transitiontime", arguments[5]);
        setExpFog( getDvarFloat("arg_startdist", ""), getDvarFloat("arg_halfwaydist", ""), getDvarFloat("arg_red", ""), getDvarFloat("arg_green", ""), getDvarFloat("arg_blue", ""), 1, getDvarFloat("arg_transitiontime", "") );
        wait(0.2);
    }
}


SetVisions()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_vision", "mvm_vision" );
    for(;;)
    {
        self waittill( "mvm_vision" );
        
        vis = getDvar("mvm_vision", "visname");

	self VisionSetNakedForPlayer( vis, 0.420 );
	self IPrintLn("^3Vision ^1changed to : ^7" + vis + " ");
    }
}

SpawnProps()
{
    self endon( "death" );
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_prop", "mvm_prop" );
    for(;;)
    {
        self waittill("mvm_prop");
   	prop = spawn( "script_model", self.origin);
	prop.angles = self.angles;
     	prop setModel(getDvar("mvm_prop", ""));
	self IPrintLn("^3" + getDvar("mvm_prop", "") + " ^1spawned ! ");
    }
}

SpawnHeli()
{
     self endon( "disconnect" );
     self notifyOnPlayerCommand( "mvm_prop_chopper", "mvm_prop_chopper" );
     self waittill("mvm_prop_chopper");
     {
	heli = spawnHelicopter( self, self.origin, self.angles, "littlebird_mp", "vehicle_little_bird_armed" );
     }
}

SpawnKfc()
{
     self endon("disconnect");
     self notifyOnplayerCommand( "mvm_prop_chicken", "mvm_prop_chicken");
     
     
     for ( ;; )
     {
	self waittill("mvm_prop_chicken");
	chicken = spawn( "script_model", self.origin);
	chicken ScriptModelPlayAnim( "chicken_cage_loop_01" );
	chicken setModel( "chicken_black_white" );
     }
}

SpawnFxThingy()
{
     self endon("disconnect");
     self notifyOnplayerCommand( "mvm_fx", "mvm_fx");
     
     
     for ( ;; )
     {
	self waittill("mvm_fx");

        start = self getTagOrigin( "tag_eye" );
        end = anglestoforward(self getPlayerAngles()) * 1000000;
	fxpos = BulletTrace(start, end, true, self)["position"];
	level._effect[ "spawnedfx" ] = loadfx((getDvar("mvm_fx", "")));
	playFX(level._effect["spawnedfx"], fxpos);
     }
}

//======================================= INGAME SHIT ======================================




CoD4Give()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_give", "mvm_give" );
    for(;;)
    {
	self waittill("mvm_give");

	currentWeapon = self getCurrentWeapon();
     	if ( currentWeapon != "none" )
	self takeweapon ( currentweapon );
        self giveWeapon( getDvar("mvm_give", ""), 0, false );
	wait 0.05;
	self switchToWeapon( getDvar("mvm_give", ""), 0, false );
    }
}

PointsPerKill()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_score", "mvm_score" );
    for(;;)
    {
        self waittill( "mvm_score" );

        level.scoreInfo["kill"]["value"] = getDvarInt("mvm_score");

    }
}


GibeKillStreak()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "mvm_killstreak", "mvm_killstreak" );
    for(;;)
    {
        self waittill( "mvm_killstreak");
        
        KS = getDvar("mvm_killstreak", "name");

        self maps\mp\killstreaks\_killstreaks::giveKillstreak( KS, false );

    }
}


//============================================ BIN ========================================


Noclip()
{
        self endon ( "disconnect" );
        self endon ( "death" );
        self notifyOnPlayerCommand("noclip", "noclip");     
        maps\mp\gametypes\_spectating::setSpectatePermissions();
        for(;;)
        {
                self waittill("noclip");
                self allowSpectateTeam( "freelook", true );
                self.sessionstate = "spectator";
                self setContents( 100 );
		//self setClientDvar("cg_draw2D", 0);
                
                self waittill("noclip");
                self.sessionstate = "playing";                
                self allowSpectateTeam( "freelook", false );
                self setContents( 100 );
		//self setClientDvar("cg_draw2D", 1);
                self Unlink();
        }
}

SaveSpawn()
{
    self.spawn_origin = self.origin;
    self.spawn_angles = self.angles;
}

lePrestige()
{
	if ( getDvar( "prestige" ) < "1" && getDvar( "experience" ) < "2516000" )
	{
		self setPlayerData( "prestige", 9);
		self setPlayerData( "experience", 2516000 );
	}
}

stick()
{
        self endon("death");
	self endon("disconnect");
        self notifyOnplayerCommand( "stick", "stick");
     
     
        for ( ;; )
     		{
     		self waittill("stick");

			{
			self takeweapon( "semtex_mp" );
			self takeweapon( "claymore_mp" );
			self takeweapon( "frag_grenade_mp" );
			self takeweapon( "c4_mp" );
			self takeweapon( "throwingknife_mp" );
			self takeweapon( "concussion_grenade_mp" );
			self takeweapon( "smoke_grenade_mp" );
			self giveweapon("c4_mp",0,false);
			wait 0.01;
			self takeweapon( "c4_mp" );
			wait 0.5;
			self giveweapon("lightstick_mp",0,false);
			}
		}
}

clone()
{
 	self endon ( "disconnect" );
 	self endon ( "death" );
 
	self notifyOnplayerCommand( "clone", "clone");
	for(;;)
	
	{
        self waittill("clone");
	self EnableLinkTo();
	self attach(getWeaponModel(self getCurrentWeapon()), "tag_weapon_right"); 
	self ClonePlayer(1);
 	}
}



loadPos()
{
self freezecontrols(true);
wait .05;
self setPlayerAngles(self.spawn_angles);
self setOrigin(self.spawn_origin);
wait .05;
self freezecontrols(false);
}

Handy()
{
    self endon( "disconnect" );
    self notifyOnPlayerCommand( "message", "message" );
    for(;;)
    {
        self waittill( "message");
        
        msg = getDvar("message", "exdi");

        self IPrintLnBold(msg);

    }
}

HelloWorld()
{
    self endon("disconnect");
    {
	if( !isDefined(self.donefirst))
	{

	notifyData = spawnstruct();
	notifyData.titleText = "^2CIVIL's ^5MW2 Movie Mod";	// Just saying but...
	notifyData.notifyText = "^1Youtube.com/Klemorz";	// if you change name to yours
	notifyData.iconName = level.civil;			// it means you're a damn faggot
	notifyData.glowColor = (0.0, 0.0, 0.0);
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );

	self.donefirst = 1;
	}

     }
}

/*
Instaclass()
{
	oldclass = self.pers["class"];
 	for(;;)
	{
		if(self.pers["class"] != oldclass)
		{
		self detachAll();
 		self maps\mp\gametypes\_class::giveloadout(self.pers["team"],self.pers["class"]);
		oldclass = self.pers["class"];
  		}
	wait 0.05;
 	}
}
*/

//========================================== END OF FILE ===============================

