Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-13-2012, 02:43 PM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
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.
  
}


Last edited by Stowen; 12-13-2012 at 04:16 PM..
Reply With Quote
  #2  
Old 12-14-2012, 12:07 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
So what happens when a player changes level or has their X/Y adjusted by script?
Reply With Quote
  #3  
Old 12-14-2012, 06:08 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by ffcmike View Post
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
__________________
Quote:
Reply With Quote
  #4  
Old 12-22-2012, 09:15 PM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
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.
Reply With Quote
  #5  
Old 12-27-2012, 10:25 AM
Joshua_P2P Joshua_P2P is offline
Graal Developer
Joshua_P2P's Avatar
Join Date: Dec 2012
Posts: 74
Joshua_P2P is on a distinguished road
it looks good so far you should make it better and tell skyld maybe he will put it in the useful codes thread
__________________
Keeping it real in Graal since 2010
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:50 PM.


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