//  ________/\\\\\\\\\__________________________________________________________        
//   _____/\\\////////___________________________________________________________       
//    ___/\\\/_________________________________________________________/\\\__/\\\_      
//     __/\\\______________/\\/\\\\\\\___/\\\\\\\\\_____/\\\\\\\\\\\___\//\\\/\\\__     
//      _\/\\\_____________\/\\\/////\\\_\////////\\\___\///////\\\/_____\//\\\\\___    
//       _\//\\\____________\/\\\___\///____/\\\\\\\\\\_______/\\\/________\//\\\____   
//        __\///\\\__________\/\\\__________/\\\/////\\\_____/\\\/_______/\\_/\\\_____  
//         ____\////\\\\\\\\\_\/\\\_________\//\\\\\\\\/\\__/\\\\\\\\\\\_\//\\\\/______ 
//          _______\/////////__\///___________\////////\//__\///////////___\////________

#include duffman\_common;

init( modVersion )
{
	addSpawnThread(::maxfps);
}

maxfps() 
{
	self endon("disconnect");
	
	if ( isDefined(self.pers["isBot"]) )
		return;
	
	for(;;)
	{
		//self.currentfps = self getfps();
		if( self.currentfps>340)
		{
			self iPrintlnbold("^1Aviso de FPS!!! Max ^1[333]^7 Seu FPS Atual! "+ self.currentfps );
			self iprintln("detected fps: "+ self.currentfps);
			self iPrintlnbold("^1 Mude Para 333 Ou Abaixo!!!");
			self freezecontrols(true);
			//while(self.currentfps>320)
			{
				wait 1;
				//self.currentfps = self getfps();
				self iPrintlnbold("^1 Mude Para 333 Ou Abaixo");
			}
			self freezecontrols(false);
			self iPrintlnbold("^1Obrigado!!");
		}
		wait 0.05;
	}
	wait 5;
}