what is problem in that script ?
PHP Code:
fpslimit()
{
self endon ("disconnect");
kick_level = 0;
fps_time = 0;
while(isPlayer())
{
self.fps = self getFps();
if(self.fps < 250)
fps_time = 0 ;
else
fps_time ++ ;
if(fps_time == 5){
if(kick_level == 0){
self iPrintLn("com_maxfps must be set to 250 or below 250");
wait 2;
kick_level ++ ;
}
else{
userid = self getEntityNumber();
self iPrintLn("com_maxfps must be set to 250 or below 250");
wait 2;
kick (userid) ;
}
fps_time = 0;
}
}
}
its for while a player connected(there is not wrong here , only above script have infinite loop)
PHP Code:
Init()
{
level thread MonitorPlayerConnect();
level thread OnFrameUpdate();
}
OnFrameUpdate()
{
while( true )
{
fpsNextFrame();
wait( 0.05 );
}
}
MonitorPlayerConnect()
{
while( true )
{
level waittill( "connected" , player );
if( !isDefined( player ) || !isPlayer( player ) )
continue;
level thread OnClientFrameUpdate( player );
}
}
OnClientFrameUpdate( player )
{
player resetFps();
}