DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • April 19, 2019, 08:13:50 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Tieing a reward to the month  (Read 3022 times)
0 Members and 1 Guest are viewing this topic.
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« on: October 14, 2005, 10:31:44 PM »

Okay, my latest module... i wanted to tie the gift to the current month.

How do I make the program regnize the date...

Here's the concept:

It should say something like:

$pay=array(0,10,10,30,10,10,60,10,10,10,10,10,120);
$month=array("","January","February","March","April","May","June", "July","August","September","October", "November","December");
$current=??!?!
output("Since it is the month of  %s, you receive %s gold.",$month[$current],$pay[$current]);

So how do i make $current reflect the proper number for the current month?

« Last Edit: October 14, 2005, 10:32:05 PM by DaveS » Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #1 on: October 15, 2005, 12:21:53 AM »

Code:
$current = date("n");

Here you are Smiley
« Last Edit: October 15, 2005, 12:22:09 AM by XChrisX » Logged

Running for more than three years now:
Turock
Guest
« Reply #2 on: October 15, 2005, 06:44:39 AM »

There is also a module called gift for a date which allows something similar.  You might check that out also.
Logged
DaveS
Mod God
*****
Offline Offline

Posts: 1544


Dfly... you know, as in DaveFly


View Profile
« Reply #3 on: October 15, 2005, 07:28:01 AM »

yeah, figures my "really cool question" would be so darn easy to answer...

If anyone can point me to the module Turok is talking about, please let me know!

(I did find an example in creationaddon.php)

Logged

Check out my Last Module:
The Dragon Eggs Expansion
http://dragonprime.net/index.php?topic=8474.0

About my Retirement:
http://dragonprime.net/index.php?topic=9080

See my complete module list here:
http://dragonprime.net/index.php?topic=3038.0
Dannic
Guest
« Reply #4 on: October 15, 2005, 08:10:58 AM »

The creationaddon is what i was going to point ya to Smiley
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
87 Guests, 1 User
Eliwood
Home Forums News Downloads Login Register Advanced Search