Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Speed Hack detect (https://forums.graalonline.com/forums/showthread.php?t=134267553)

Stowen 12-13-2012 02:43 PM

Speed Hack detect
 
Hey guys, this is the first script I've released publicly. It nothing special at all, just thought it would maybe be useful to some. Thanks to Chris for supplying a distance formula. Thanks to scriptless for helping slim it down, and making it more efficient.

PHP Code:

//I will leave it up to you to apply checks for staff members,
//so staff don't end up logged or jailed.
//#CLIENTSIDE
function onCreated() {
  
this.x1 player.x;
  
this.y1 player.y;
  
setTimer(1);
}

function 
onTimeOut() {
  
dist(this.x1this.y1player.xplayer.y);
  
// set the values to current position
  
this.x1 player.x;
  
this.y1 player.y;
  
setTimer(1);
}

function 
dist(x1y1x2y2) { 
  
this.dist = (((x1 x2) ^ 2) + ((y1 y2) ^ 2)) ^ 0.5;
  
player.chat this.dist;
  
distCheck(this.dist);
}

function 
CheckDist(dist) {
  if (
dist 15) {
     
//This is where you put an action for speed hackers.
     //Logging it, or sending them to jail are good ideas.
  
}



ffcmike 12-14-2012 12:07 AM

So what happens when a player changes level or has their X/Y adjusted by script?

fowlplay4 12-14-2012 06:08 PM

Quote:

Originally Posted by ffcmike (Post 1709388)
So what happens when a player changes level or has their X/Y adjusted by script?

They get jailed/disconnection because no server would ever do that.

/s

Stowen 12-22-2012 09:15 PM

Its a simple shell, not a complete system. Modifications can be added where/when needed. If a mod can delete this please, that would be much appreciated. :)

Joshua_P2P 12-27-2012 10:25 AM

it looks good so far you should make it better and tell skyld maybe he will put it in the useful codes thread


All times are GMT +2. The time now is 02:57 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.