View Single Post
  #3  
Old 05-11-2006, 11:47 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by Yen
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?

Good job Excaliber, you don't know how to code!

the temp.dmcheck = temp.dmg-1 never modifies temp.dmg
temp.dmg than has a post decrement of one which causes the temp.dmcheck to = temp.dmg
Reply With Quote