DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • September 22, 2018, 12:00:22 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2 3   Go Down
  Print  
Author Topic: Discussion: Cityleaders v1.0.4 and Cityfunds v1.0.2 (Modified)  (Read 12074 times)
0 Members and 1 Guest are viewing this topic.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« on: September 13, 2010, 11:30:24 AM »

I've taken Sixf00t4's 'cityleaders' and 'cityfunds' modules and modified them. His original thread can be found here and the original download found here.

I modified them because there were a few bugs in cityleaders and got carried away and ended up added little extra things. Smiley

City Leaders v1.0.4
Just what it says on the tin. A module to allow for players to become the elected leaders of a city. Here's a run down of what you get.
1) A city hall in *any* city.
2) Citizens of that city can run for election, vote for an runner, or revolt if they don't like the current leader which starts the voting process.
3) Each runner can place a "vote for pedro" type banner in their city.
4) Each elected leader can place a banner in the city, change the cityhall name, change their leader title.
5) Citizens are by default loyal to their home town, but can change their allegiance to another city. This allegiance will stay even after a newday or a dragonkill.
6) Leaders can resign.
7) Leaders can stop non citizens from building/buying dwellings.
8.) Modulehooks in place for modules to hook into.

City Funds v1.0.2
Adds funds to city hall which people can donate to.
1) Adds a donate link inside city hall. People can donate to help fund the city.
2) The leader can see who donated and how much.
3) The leader can tax the gold in the bank belonging to his citizens each newday. Tax percentage is set by the leader. Tax maximum percentage is set by a setting to limit how much leaders can tax.
4) The leader can tax the purchase of weapons/armour in their village. Anyone buying from those shops will have to pay tax.
5) All tax profits go into the city hall funds.
6) Tax can be turned off, but the donation side will remain.
7) Leader can be paid a wage out of the city coffers.
8.) HoF page shows the richest cities.
9) Modulehooks in place for modules to hook into. Add more things to tax. ;-)

Oh look, City Guards, paid for out of the city hall funds. Cheesy

That's it. No major changes so you can just upload and then do a reinstall so the extra hooks/settings kick in.

Feedback, questions, or bugs are welcome. :-)

Download: Here.
File Submission: Here
« Last Edit: May 23, 2013, 03:11:09 PM by Afkamm » Logged

Check My Modules for the latest versions.
Calen
Member

Offline Offline

Posts: 3


View Profile
« Reply #1 on: September 13, 2010, 03:06:50 PM »

*Calen pokes the download here button but cant press it*

I'm using Sixfoot4's modules but always wanted to try to add things in it, Saw the small errors aswell (ie: name city hall turning up into townit instead of actually renaming it) was just starting to work on it he he.


But a download link would be handy *hinthint* (edit:)nevermind .. should have searched first oh well. im going to try it on a testserver and check it out.


Regards, Calen.
« Last Edit: September 13, 2010, 03:14:19 PM by Calen » Logged
Cory2
Militia
**
Offline Offline

Posts: 59



View Profile WWW
« Reply #2 on: September 13, 2010, 03:13:44 PM »

here : http://dragonprime.net/index.php?module=Downloads;sa=dlview;id=1442
Logged

Owner of Dragonmachine.com
Human by nature, Programmer by choice
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« Reply #3 on: September 13, 2010, 03:39:20 PM »

Yes please do test it out. I have it running on Lo6, but just don't have the players to give it a real test. Sad
Logged

Check My Modules for the latest versions.
GRRRilla Ninja
Codemeister
****
Offline Offline

Posts: 321


View Profile
« Reply #4 on: September 13, 2010, 04:21:33 PM »

On lines 343 and 351, there is a function (out) that should be (output) instead. Giving errors when players make donations to city funds.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« Reply #5 on: September 13, 2010, 04:30:20 PM »

Thanks, fixed and uploaded. Same version pack. Smiley
Logged

Check My Modules for the latest versions.
Calen
Member

Offline Offline

Posts: 3


View Profile
« Reply #6 on: September 14, 2010, 01:49:40 PM »

I just noticed this after a DK but i keep paying taxes to my home town. that's 5 times in total, which is 4 times too many.

Namely:
at choosing race,
after choosing the race,
at choosing speciality,
after choosing speciality,
on new day.

(havent noticed it sooner cause i don't DK often and my player group haven't noticed it apparently otherwise i would have been knocking on your door a bit sooner).
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« Reply #7 on: September 14, 2010, 02:59:19 PM »

Oh bother said Mr Pooh.

Each race checks the race city on newday and changes it back to default if it's not what it should be. Thought I was being clever hooking into 'footer-newday' so if a player had changed allegiance I could undo what the race city check did and be sure that it was being done after.

Guess I'll change to 'newday' with an extremely low priority. Smiley

File attached, same version. Thankyou.
Logged

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

Posts: 1745


View Profile
« Reply #8 on: October 09, 2010, 03:42:23 AM »

WickedWizard discovered an error in 'cityleaders'. There was a missing argument in an addnews and a wrong argument in YoM message. Also added an addition check to the IF statement as somehow the code with the error was run when it shouldn't have been. Most odd.

Code:
#
#-----[ OPEN ]-----
#
root/modules/cityleaders.php

#
#-----[ FIND ]-----
#
$leader = get_module_objpref('city',$cityid,'leader');

#
#-----[ AFTER, ADD ]-----
#
$title = get_module_objpref('city',$cityid,'title');

#
#-----[ FIND ]-----
#
if( !empty($leader) )

#
#-----[ REPLACE WITH ]-----
#
if( !empty($leader) && $leader > 0 )

#
#-----[ FIND ]-----
#
$message = translate_inline(array("Congratulations %s,`n`nYou have fought off any competitors that stood against you and remain in office as the %s of %s!", $row['name'], $leader, $cityname));

#
#-----[ REPLACE WITH ]-----
#
$message = translate_inline(array("Congratulations %s,`n`nYou have fought off any competitors that stood against you and remain in office as the %s of %s!", $row['name'], $title, $cityname));

#
#-----[ FIND ]-----
#
addnews("`n`^%s `&remains the elected %s of %s!`0`n", $row['name'], $cityname, TRUE);

#
#-----[ REPLACE WITH ]-----
#
addnews("`n`^%s `&remains the elected %s of %s!`0`n", $row['name'], $title, $cityname, TRUE);

#
#-----[ SAVE/CLOSE FILE ]-----
#

Only one file was edited and it is attached below. Smiley

Edit: Removed attached file as it was no longer the latest version.
« Last Edit: May 17, 2011, 12:55:57 PM by Afkamm » Logged

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

Posts: 102


View Profile WWW
« Reply #9 on: September 08, 2011, 08:56:58 AM »

Sorry for necroing but i just got an error can someone please tell me how can i solve this

Code:
PHP Warning: "Division by zero"
in /home/u621348125/public_html/modules/cityleaders.php at 447.
Call Stack:
2: cityleaders_debug() called from /home/u621348125/public_html/modules/cityleaders/cityleaders_run.php on line 545
3: require_once("/home/u621348125/public_h...") called from /home/u621348125/public_html/modules/cityleaders.php on line 302
4: cityleaders_run() called from /home/u621348125/public_html/runmodule.php on line 33
PHP Warning: "Division by zero"
in /home/u621348125/public_html/modules/cityleaders.php at 448.
Call Stack:
2: cityleaders_debug() called from /home/u621348125/public_html/modules/cityleaders/cityleaders_run.php on line 545
3: require_once("/home/u621348125/public_h...") called from /home/u621348125/public_html/modules/cityleaders.php on line 302
4: cityleaders_run() called from /home/u621348125/public_html/runmodule.php on line 33
[/color][/color]

It Apears wheni click the city hall
Logged

ArthuruhtrA
Mod God
*****
Offline Offline

Posts: 573


chown -R us ./base


View Profile
« Reply #10 on: September 08, 2011, 12:26:22 PM »

Which version/has it been modified?
Logged

I'm around rarely, If you wish to contact me, please email me.
My Modules, such as can be found here.
RaynDarren
Mod God
*****
Offline Offline

Posts: 732


View Profile WWW
« Reply #11 on: January 05, 2012, 11:21:43 PM »

I'd like to suggest an additional alteration.

A link in the grotto or "the U.K." to show who's running for mayor of what village would be handy

~Rayn
Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« Reply #12 on: January 06, 2012, 02:31:42 AM »

It Apears wheni click the city hall

I added the debug function to help me, well, debug. Smiley The problem is that there are no citizens in that city/village so when the code is working out percentages then it's going to be dividing by zero. Only superusers with the developer flag will see this so not to worry. If you don't want it at all then comment out line 454 in the file cityleaders_run.php

Code:
// cityleaders_debug();

Nice suggestion Rayn, I'll add that at some point. :-)
Logged

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

Posts: 732


View Profile WWW
« Reply #13 on: January 13, 2012, 12:23:11 AM »

It's entirely possible that I just missed it in the code you put up Afkamm, but, how do I find out who won the elections?

Some suggestions for additions to City Funds

A unique city funded bar
A round of drinks at the above mentioned bar paid for by the city leader
Reduced healing costs for fighting in your home village/aligned village
Dwelling cost reduction in your home village/aligned village (like a morgage)
Customizable village fountain
« Last Edit: January 13, 2012, 12:32:03 AM by RaynDarren » Logged

Ironmars
Captain of the Guard
***
Offline Offline

Posts: 146



View Profile
« Reply #14 on: January 14, 2012, 12:47:55 PM »

Could it be possible for the leader to appoint a government?
Logged
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  


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

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