DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • February 17, 2019, 05:56:51 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: limited availabilty mods  (Read 3975 times)
0 Members and 1 Guest are viewing this topic.
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« on: August 30, 2004, 02:49:11 AM »

I am not seeing a way to make a module show up based on how many dragonkills a person has.  I am leaning towards falling victim to a scotoma.
Logged

anpera
Guest
« Reply #1 on: August 30, 2004, 04:22:31 AM »

Write your module like you would do without any limitations. Then, in function modulname_dohook() check for dragonkills first:
Code:
function modulename_dohook($hookname,$args){
   if ($session['user']['dragonkills']>13){
      switch($hookname){
      case "whatever":
         ...
      break;
      case ".....
      break;
      }
   }
   return $args;
}

This module won't get executed if the player has less than 14 dragonkills. Because links to the module are added by "dohook" they don't even appear with less than 14 DKs. By using else you are able to offer different navs for DKs>13 and DKs<14.

Remember that if you're using a newday-runonce hook (or some similar that for example affect "anonymous pages") you must not put that case(s) within this if{}!

If you want the navs to appear but you want them to produce different output for DKs use if ($session['user']['dragonkills']>13){...}else{...} within function modulename_run();
Logged
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #2 on: August 30, 2004, 04:33:05 AM »

I see, I see.  Thank you, omniscient Anpera.
Logged

sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #3 on: September 09, 2004, 06:06:54 AM »

side thought, this means editing other people's modules.  kosher? or should we find another system of making it based on user stats?
Logged

Spider
Guest
« Reply #4 on: September 09, 2004, 07:17:57 AM »

you could write a module to limit availability of other modules as per your desires if you want, using the blocknav function.

I'm not writing code out cos I haven't thought about it too much, but you can definately make a module check dragon kills, and block the relevant module navs if they don't have enough.
Logged
Deimos
Guest
« Reply #5 on: September 09, 2004, 10:49:57 AM »

side thought, this means editing other people's modules.  kosher? or should we find another system of making it based on user stats?
A better system might be just asking the author to modify it, possibly giving them the code changes they should make. If they make it a setting, then the default can be the same as always, while still allowing you to set the.. setting.
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #6 on: September 13, 2004, 07:06:17 PM »

Don't see any reason you couldn't modify someones module, just dont distribute it or call it yours. Am I wrong here?

It wouldnt be core code, and it wouldn't be distributed. Just don't remove their name and replace it with yours kind of thing...
« Last Edit: September 13, 2004, 07:07:17 PM by Arune » Logged
Kendaer
Guest
« Reply #7 on: September 13, 2004, 08:08:31 PM »

Actually, it all depends on what license they release it under.

I would assume that if they don't specify a specific license then it would be considered to be released under CC 2.0, the same as the code.  Therefor it has the same protections, etc.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

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