View Single Post
  #1  
Old 05-11-2006, 08:55 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Protecting from hackers

Alright..
To reduce some stress on the server, I'm calculating damage on the clientside. If you're going to reply 'Do it serverside,' just don't.

Anyway, I have a GetDamage(arg) function. arg is a list of 'modifiers' to include in the attack (i.e. 'range' will return the possible damage range, 'noweapon' will return the player's damage with no weapon equipped)

Once damage has been calculated, I did this:
PHP Code:
temp.dmcheck temp.dmg-1;
temp.dmg--;
if (
temp.dmcheck != temp.dmg) return "HACKER";
temp.dmg++; 
However, it's randomly returning 'HACKER' even though the person isn't hacking. Any ideas?
Reply With Quote