Mys 1.3.5 Paycheck Mod

Forum
Last Post
Threads / Messages

GeneticAlpha

Loving Mysidia!
Member
Joined
May 24, 2020
Messages
287
Points
18
Age
31
Location
Tennessee
Mysidian Dollar
13,377
I've made a mod! :D it's a mod that allows your users to get paid weekly and when they collect their money it gets deposited into their bank account. This is an extension of the bank mod made by Dinocanid HERE

So first step would be to install the Bank Mod.
_____

There are a few ways you could do this, you could have all the code be on the bank page, but I went about it a different way. Let me explain in depth so people can understand how I have my system setup.

When members go to my Bank page, there is a If/Else statement that looks to see if the member has collected their pay yet or not, if they haven't, a green link pops up stating: "You have a paycheck available!" so then the user can go to that link that links them to the payment collecting page. After they hit the Cash Check button, it deposits the set amount of money into their bank account. This paycheck becomes available every week using Cron jobs.
_________

Okay, so, to go ahead and get started let's make the files we need. I'll just do a step-by-step tutorial on my exact setup. I made a pay.php file in the root folder, and a payview.php file in the view folder within the root.

Inside the pay.php is this:

pay.php

Then this is inside of the payview.php:

payview.php

Next you need to make(if you don't already have it) a cron.php file in your root folder. You want to add this to it:

cron.php

I have also added in there what my Cron file looks like.

That finishes the files. Next you need the database, so go to PHPMyAdmin and go to your users table and add 2 columns. Set it up like this:

pay | varchar | 3 | Default: None | No NULL

(just hit enter and it'll auto fill the rest)

you also want to add level_pay, set up like so:

level_pay | varchar | 11 | Default: None | No NULL

and hit enter.

Remember you'll need to manually go into a user's database and change their level_pay to something like Entry or Experienced.

Database is now done. Now you need to add the Cron job to allow that paycheck link to pop up every week. Go to your Cron jobs.

Click the drop-down box that says "Common Settings" and click the Once Per Week option, then in the Command box at the bottom paste this:

curl http://dinotracks.mysidiahost.com/cron/pay

except, change the dinotracks to your web address.

That should be it! I don't think I forgot anything. Besides to mention, the level_pay database is what I was using to check and see what the member's experience level was. It checks their level of pay they should get and gives them the correct amount of money. For example, if I have the user as an entry level worker, they get X amount, verses the experienced user getting Y amount, etc.

Let me know if y'all have any questions! :D
 

Attachments

  • bank.png
    bank.png
    1.6 MB · Views: 9
  • paycheck.png
    paycheck.png
    1.8 MB · Views: 9
  • paycheck2.png
    paycheck2.png
    910.3 KB · Views: 9
Last edited:
Oh this looks very interesting, congrats on making your own mod. Btw can you use the resource manager on the forum?
 
This looks fantastic!! Thank you so much, surprised not many have commented on this great Mod!!

Question - where do I input the amount I want added? Also -- I am very not familiar with how to do Cron -- do we leave all the stuff on the page that you have for your own site as well, or just leave certain coding?


I'd like to have all the members be 'Entry' automatically, I presume I'd make that the default?
 
This looks fantastic!! Thank you so much, surprised not many have commented on this great Mod!!

Question - where do I input the amount I want added? Also -- I am very not familiar with how to do Cron -- do we leave all the stuff on the page that you have for your own site as well, or just leave certain coding?


I'd like to have all the members be 'Entry' automatically, I presume I'd make that the default?
Oh no! D: my files had been deleted... I didn't know Google Docs would do that. I'll have to try and update this mod properly.. Entry is default yes. With the Chron job you just create a new one (I get to crons through the mysidia client because there's a button for it) and click the Once Per Week option in the drop down settings and paste curl http://dinotracks.mysidiahost.com/cron/pay but change the dinotracks.mysidiahost.com to your web address. Then in your root folder if you don't already have a cron.php file make one and paste this into it:

public function pay(){
$mysidia = Registry::get("mysidia");
$mysidia->db->update("users", array("pay" => 'no',));

}

and just change anywhere you see dinotracks urls change to yours. Now we're left with me needing to fix the files :( ugh. Because that had all the files needed for the if/else staments that did checks for ig the user's pay was collected or not and would give money. Also as a FYI if you're interested in being in a sim pet collective on Discord let me know. There are four of us who are pretty active with our sim sites and help each other out. <3 Usually faster to respond than on Forums.
 
I am interested in the sim pet collective, for sure, I am not a master coder by any means though! Most of my stuff HOF helped with or I had coded for me, however I have done some mods :)

If I get on Discord I will definitely join and thanks!

Google docs should never delete your files ...

is there a quick and easy way I can just edit somewhere the amount for right now? Or can you tell me what the default was for that?
 
I am interested in the sim pet collective, for sure, I am not a master coder by any means though! Most of my stuff HOF helped with or I had coded for me, however I have done some mods :)

If I get on Discord I will definitely join and thanks!

Google docs should never delete your files ...

is there a quick and easy way I can just edit somewhere the amount for right now? Or can you tell me what the default was for that?
The database pay needs to be set to default no, then level_pay default is set to entry. Because I had the levels being tiers basically and in my if/else statement it was saying stuff like, if level_pay = entry give $111 currency if this button is pressed, or more if they were a better level than entry, etc and change pay to yes so it cannot be collected again until next day.

Is that what you were asking? Feel free to ask anything and I'll answer the best I can and rewrite the whole if statement for you when I have time. If you're in the pet collective I can easier send your chunks of codes for things on any of my stuff. And no worries! Most of us are self taught code or had help but we've done a lot of work and I'm a stay at home mom, fixing to go to college for programming/cyber defense.
 
Last edited:
Oh that will tell me what I need, thank you so much! Yes that's what I was needing to know, thank you for the information.

Yes some of mine is self taught but HOF has taught me a lot as well :)
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top