View Single Post
  #1  
Old 06-30-2007, 08:53 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Bit of a Problem

PHP Code:
public function applyStatChange(statamt) {
  
temp.string 0;
  
tem.plyr 0;
  
  
plyr findPlayer(this.account);
  
  if (
makevar("plyr.clientr.mud." stat) == NULL) return;

  if (
amt != NULL) {
    if (
amt == (abs(amt))) {
      if (
stat == "hp" || "mp") {
        if ((
makevar("plyr.clientr.mud." stat) + amt) <= makevar("plyr.clientr.mud.max" stat)) {
          
makevar("plyr.clientr.mud." stat) += abs(amt);
        }
        else {
          
makevar("plyr.clientr.mud." stat) = makevar("plyr.clientr.mud.max" stat);
        }
      }  
    }
    else {
      if ((
makevar("plyr.clientr.mud." stat) - amt) > 0) {
        echo(
"setting a negative");
        
makevar("plyr.clientr.mud." stat) -= abs(amt);
      }
      else if ((
makevar("plyr.clientr.mud." stat) - amt) <= 0) { 
        echo(
"changing to zero");
        
makevar("plyr.clientr.mud." stat) = 1;
      }
    }
  }
  
reflect("player"3);
  echo(
this.mp);

The adding portion of it works perfectly fine, doesn't go over the max amount or anything like that. However as for the subtracting portion, it tends to go over to -599 before it sets it back to 1 the next time I update. What could be the issue?
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote