Thread: TPS Recorder
View Single Post
  #22  
Old 06-06-2006, 05:33 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
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);

Hillarious.


Quote:
Originally Posted by Maniaman
Haha, nice one!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote