DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • December 11, 2018, 01:25:42 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Newbie Paycheck  (Read 1884 times)
0 Members and 1 Guest are viewing this topic.
draganviper
Captain of the Guard
***
Offline Offline

Posts: 112


Fire Emblem Rules


View Profile WWW
« on: March 16, 2008, 01:42:58 PM »

This is one of my first few modules, so please bear with me if I make any silly mistakes.

With this module, a player with less than an admin settable number of dks will recieve a little paycheck at every newday. The payment amounts are admin settable, and there are 4 intervals for the paycheck amounts based on player age.

Ages:

1-5

6-10

11-15

16-20

will recieve a paycheck. The amounts, as I said, are configurable but they are meant to decrease with time, so that ages 1-5 have a pretty decent amount and 16-20 have a much smaller amount. The catch is, however, that the amount per day is multiplied by the player's level, so although the "older" players get less per level, they should still get more than the "younger" players.

After age 20, the payments abruptly cut off, and the player must go out and get a jo- ....erm... they must go fight for a living.

I had a difficult time trying to avoid abuse of this system through ressurections, but here's what I came up with:

You pick a number of turns in the settings, and all players who have more than that many turns get a check, those who have less are told that they dont get a paycheck just because they came back to life.

Well, have fun, I hope someone finds this useful, and please get back to me with any errors or bugs you find. Thanks guys.

Download here: http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=1375
« Last Edit: March 16, 2008, 08:38:25 PM by draganviper » Logged

=============
Don't Click There! .com, where the user is the judge.
=============
kickme
Global Moderator
Mod God
*****
Offline Offline

Posts: 1589


Yay for elephants!


View Profile WWW
« Reply #1 on: March 16, 2008, 08:27:11 PM »

I had a difficult time trying to avoid abuse of this system through ressurections

Check that httpget('resurrection') != 'true'
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka
draganviper
Captain of the Guard
***
Offline Offline

Posts: 112


Fire Emblem Rules


View Profile WWW
« Reply #2 on: March 16, 2008, 08:36:53 PM »

Wow, I didn't know I could do that! Thanks Kickme!
Logged

=============
Don't Click There! .com, where the user is the judge.
=============
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1748


View Profile
« Reply #3 on: February 13, 2012, 04:19:42 PM »

The code kickme posted has never been added, also I noticed this.

Code:
<?php
$pay1 
get_module_setting("payment1");


$newgold1 $session['user']['gold'] + $session['user']['level'] * $pay1;
$session['user']['gold'] = $newgold1;
output("You recieve your daily paycheck of %s gold, you now have %s gold.",$pay1,$newgold1);

The daily paycheck is $pay1, when in fact it should be $pay1 multiplied by the player's level.

This would be more accurate,
Code:
<?php
$paycheck 
$session['user']['level'] * $pay1;
$session['user']['gold'] += $paycheck;
output("You recieve your daily paycheck of %s gold, you now have %s gold.",$paycheck,$session['user']['gold']);

Although I'd be tempted to leave out how much the player now has because modules that come after may alter the gold still making the gold amount wrong.

Draganviper aka Maynard, are you still around? Smiley
Logged

Check My Modules for the latest versions.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1748


View Profile
« Reply #4 on: February 13, 2012, 06:47:27 PM »

Ok, his profile says he hasn't been here for 2 years so I've gone ahead and modified the module adding resurrection code and fixing the pay thing.

Uploaded, new version is 1.1

Same link as before. Smiley
Logged

Check My Modules for the latest versions.
HunterD
Captain of the Guard
***
Offline Offline

Posts: 107


RPGLink... it's a thing!


View Profile
« Reply #5 on: February 13, 2012, 11:25:43 PM »

Brilliant again!  Thanks!!!
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
66 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search