Thread: TPS Recorder
View Single Post
  #19  
Old 06-06-2006, 05:01 PM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
Quote:
Originally Posted by excaliber7388
Made one with a serverside test, runs only 5 seconds, every 10 seconds, to make sure no one has their client going faster. I used a lot of the same ideas ApothiX had, would this work better?
PHP Code:
function onActionclientside()
{
  if(
params[0]=="serversidetest")
  {
    
settimer(1);
    function 
onTimeout()
  {
    
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
    
this.curent=(((playerx^2)+(playery^2))^.5);
    
this.dist_value=this.dist-this.current;
    if(
this.control2==5)
    {
      
this.control2==0;
      
settimer(0);
    }
    
this.control2++;
    if(!
playerx==this.oldx && !playery==this.oldy)
    {
      
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
    }
    
settimer(1);
  }

    
}
  if(
params[0]=="report")
  {
    if(
params[1]>server.speedmax)
    {
      echo(
"Warning: Player \"" player.account "\" is moving at: " params[1] @ " Tiles/sec. This is " server.max_tilespersecond params[1] @ " Tiles/sec faster than the defined maximum. (Speedhack?)"); 
      }
  }
}
//#CLIENTSIDE
function onCreated()
{
  
settmer(1);
  
this.oldx=playerx;
  
this.oldy=playery;
}
function 
onTimeout()
{
  
this.dist=(((this.oldx^2)+(this.oldy^2))^.5);
  
this.curent=(((playerx^2)+(playery^2))^.5);
  
this.dist_value=this.dist-this.current;
  if(
this.control==10)
  {
    
this.control==0;
    
triggeraction(0,0,"serverside","weaponname","serversidetest",this.dist_value);
  }
  
this.control++;
  if(!
playerx==this.oldx && !playery==this.oldy)
  {
    
triggeraction(0,0,"serverside","weaponname","report",this.dist_value);
  }
  
settimer(1);

__________________

Current Maloria Event: (click to go to it)
Reply With Quote