DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • May 18, 2013, 06:16:00 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Stats Not Updating  (Read 1347 times)
0 Members and 1 Guest are viewing this topic.
Ironman
Guest
« on: January 12, 2006, 07:49:59 PM »

I know this is my first complex, village mod for 1.0.x, but I cannot figure out what I'm doing wrong for the life of me.  The statistics in the accounts table are not getting updated.  For example, I have this code:

   case "cs":
      output("After a grueling workout with Court, you actually feel stronger.`n`n");
      output("YOU GAIN 1 STRENGTH!");
      $session['user']['attack']+=1;
      addnav("L?Return to the Lobby","runmodule.php?module=garrisons&op=lobby");
      addnav("V?Return to the Village","village.php");
      break;

When this case is performed, the text and navs appear properly, but the user's attack is not increased.
  Also, a value from the accounts table is not being seen properly.  Another code segment:

   case "massage2":
      if ($session['user']['gold'] < 200)
      {
         output("You rummage through your possessions but can't seem to find 200 gold pieces.  Maybe another time.");
         addnav("L?Return to the Lobby","runmodule.php?module=garrisons&op=lobby");
         addnav("V?Return to the Village","village.php");
      }
      else
      {
         output("Bruno has an amazingly gentle touch for such a large man.  After only 20 minutes, you feel great.`n`n");
         $session['user']['gold']-=200;
<snip>

I tried to get a massage with 600 gold on hand, but the above evaluation was seen as true (that I had less than 200 gold).  I have been through the code numerous times, and even tried reinstalling the module.  The full script can be found at http://dragonprime.net/users/Ironman/garrisons.txt.  Any help is greatly appreciated!
Logged
Eth
Member
Codemeister
****
Offline Offline

Posts: 302


Shameless Drunk


View Profile
« Reply #1 on: January 12, 2006, 07:55:28 PM »

It appears the cause of your problem is that you're missing a simple snippet of code.

Within:
Code:
garrisons_run(){

You need to place:
Code:
global $session;

That should solve the pair of problems you're having.
« Last Edit: January 12, 2006, 08:00:41 PM by Eth » Logged

Purveyor of fine cloaks, gloves, boots, gerbils, and Siamese cats.
Ironman
Guest
« Reply #2 on: January 12, 2006, 08:25:44 PM »

DOH!  Thank you!!
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
12 Guests, 2 Users
Komali, Aeo
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search