DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • March 23, 2019, 01:29:39 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Call Random Forest Event  (Read 3203 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« on: February 06, 2005, 08:44:38 AM »

Hi, I want a module to start a random forest event.

I tried to use the following code from forest.php in my module:
Code:
if (module_events("forest", 100) != 0) {
   if (!checknavs()) {
      $session['user']['specialinc'] = "";
      $session['user']['specialmisc'] = "";            
      $op = "";
      httpset("op", "");
   } else {
      page_footer();
   }
}

But that only leads to a call of the last module (alphabetical). At least that works... But it seems, I cannot run another special event...

Any ideas?
Logged

Running for more than three years now:
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: February 06, 2005, 12:54:00 PM »

Try this:
Code:
$sql = "SELECT modulename FROM ".db_prefix("module_event_hooks")." WHERE event_type='forest' ORDER BY RAND(".e_rand().") LIMIT 1";
That should select one at random, and then you can alter the person specialinc to be:
Code:
$session['user']['specialinc']="module:".$sqlresult;
Then it should dump them in the right module.... I think ^_^
« Last Edit: February 06, 2005, 12:57:42 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
25 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search