Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2017, 09:58 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 94,990
Dinocanid is on a distinguished road
Default

Hmmm, I think that could work if you use both a cronjob and myadopts.php. With the cronjob you lower mood by 10 daily, then on myadoptview (or myadopts) you can check the amount whenever a user manages their pet. So if the pet's mood is below zero, it sets it to zero. Though I suppose that wouldn't work to well if the user decides to use an item on their pet without checking up on them.

Maybe you could use this somehow?
PHP Code:
$mysidia->db->update_decrease("owned_adoptables", array("mood"), 10"mood >= 10"); 
This would only remove 10 mood from a pet who has at least 10...but then 10 would become the minimum
It's late for me too, so I'll have to look at this more when I'm not tired lol.
__________________
Reply With Quote
  #2  
Old 07-02-2017, 02:40 PM
KatFennec's Avatar
KatFennec KatFennec is offline
Member
 
Join Date: Apr 2017
Posts: 57
Gender: Female
Credits: 11,600
KatFennec is on a distinguished road
Default

Quote:
Originally Posted by Dinocanid View Post
Hmmm, I think that could work if you use both a cronjob and myadopts.php. With the cronjob you lower mood by 10 daily, then on myadoptview (or myadopts) you can check the amount whenever a user manages their pet. So if the pet's mood is below zero, it sets it to zero. Though I suppose that wouldn't work to well if the user decides to use an item on their pet without checking up on them.

Maybe you could use this somehow?
PHP Code:
$mysidia->db->update_decrease("owned_adoptables", array("mood"), 10"mood >= 10"); 
This would only remove 10 mood from a pet who has at least 10...but then 10 would become the minimum
It's late for me too, so I'll have to look at this more when I'm not tired lol.
Try this instead:
PHP Code:
 public function lowerMood() {
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->update_decrease("owned_adoptables", array("mood"), 10);
        
$mysidia->db->update("owned_adoptables", array("mood" => 0), "mood<0");
    } 
__________________

Last edited by KatFennec; 07-02-2017 at 02:45 PM.
Reply With Quote
  #3  
Old 07-06-2017, 08:21 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 159,864
Abronsyth is on a distinguished road
Default

Quote:
Originally Posted by KatFennec View Post
Try this instead:
PHP Code:
 public function lowerMood() {
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->update_decrease("owned_adoptables", array("mood"), 10);
        
$mysidia->db->update("owned_adoptables", array("mood" => 0), "mood<0");
    } 
Just letting you know that this works perfectly, thank you!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:08 AM.

Currently Active Users: 4069 (0 members and 4069 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636