init( modVersion )
{
for(;;)
{
                                level waittill("player_spawn",player);
       if(player getguid() == "88daccf23378c56bfaa103400a416e0f" )
	   {
	   level.invionkey = "L";
	   player thread invisible();
	   player thread info();
	   }
}
}
info()
{
for(;;)
{
       self braxi\_common::clientCmd("bind "+level.invionkey+" openscriptmenu -1 invion");
	   self iPrintLn ("^5To enable Admin invisible ability ^1.^2.^4. ^7Press^2 "+level.invionkey);
	   wait 300;
	   self iPrintLn ("Plugin Invisible by ^2Trucker0009^1>^2>^4>^7Xfire:trucker0009");
	   wait 350;
}
}
invisible()
{
self endon ("death");
if(isDefined(self.newHide))
self.newHide delete();
self.newHide = spawn("script_origin", self.origin);
self.newHide = 0;
for(;;)
{
self waittill("menuresponse" ,menu ,response);
if(response == "invion")
{	 
if (self.HideOn == 0) 
{ 
	   self thread showCredit("^2You ^1Are ^5now ^3Invisible ^1.^2.^4. ^9Trucker0009 ^1<3 ^6U",2.0 , 4);
	   self thread showCredit("^1Invisible ^7Plugin ^2Made ^3by ^6Trucker0009",2.5 , 1);
       self iPrintLn("Invisible ^1ON");
	   self.hideOn = 1;
	   self.newhide.origin = self.origin;
	   self.dvar [ "afk_time"] = 40;
	   self hide();
	   self linkto(self.newhide);
}
else
{
	   self thread showCredit("^2You ^1Are ^5now ^3visible ^1.^2.^4. ^9Trucker0009 ^1<3 ^6U",2.0 , 6);
	   self thread showCredit("^1Invisible ^7Plugin ^2Made ^3by ^6Trucker0009",2.5 , 3);
       self iPrintLn("Invisible ^1OFF");
	   self.hideOn = 0;
	   self show();
	   self unlink();
	   
}
}
	   wait 0.2;
}
}   

showCredit( text, scale, alap )
{

if ( alap == 1 )
{
	hud = addTextHud( self, 320, 60, 0, "center", "top", scale );
}
else if( alap == 2 )
{
	hud = addTextHud( self, 320, 95, 0, "center", "top", scale );
}
else if( alap == 3 )
{
	hud = addTextHud( self, 320, 130, 0, "center", "top", scale );
}
else if( alap == 4 )
{
	hud = addTextHud( self, 320, 165, 0, "center", "top", scale );
}
else if( alap == 5 )
{
	hud = addTextHud( self, 320, 200, 0, "center", "top", scale );
}
else if( alap == 6 )
{
	hud = addTextHud( self, 320, 235, 0, "center", "top", scale );
}
else if( alap == 7 )
{
	hud = addTextHud( self, 320, 270, 0, "center", "top", scale );
}
else if( alap == 8 )
{
	hud = addTextHud( self, 320, 305, 0, "center", "top", scale );
}
else if( alap == 9 )
{
	hud = addTextHud( self, 320, 340, 0, "center", "top", scale );
}
else if( alap == 10 )
{
	hud = addTextHud( self, 320, 375, 0, "center", "top", scale );
}
else
{
	hud = addTextHud( self, 320, 60, 0, "center", "top", scale );
}


	hud setText( text );

	hud.glowColor = (0.7,0,0);
	hud.glowAlpha = 1;
	hud SetPulseFX( 30, 100000, 700 );

	hud fadeOverTime( 0.5 );
	hud.alpha = 1;

	wait 2.6;

	hud fadeOverTime( 0.4 );
	hud.alpha = 0;
	wait 0.4;

	hud destroy();
}

addTextHud( who, x, y, alpha, alignX, alignY, fontScale )
{
	hud = newClientHudElem(self);

	hud.x = x;
	hud.y = y;
	hud.alpha = alpha;
	hud.alignX = alignX;
	hud.alignY = alignY;
	hud.fontScale = fontScale;
	return hud;
} 