View Single Post
  #8  
Old 08-04-2008, 11:11 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
I'd do it with this structure:

PHP Code:
function AddMoreExp()
{
  
currentexperience ++;
  if (
currentexperience >= maxexperience) {
    
LevelUp();
  }
}

function 
LevelUp()
{
  if (
currentexperience maxexperience) {
    echo(
"AHMAGAWD CORRUPT STAFF SLASH HACKER ALERT!!!");
    return;
  }

  
currentexperience -= maxexperience;

  
// Level up!

Rough draft, but you get the idea.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote