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?