Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
I think its other problem which hall of fame can solve :( and merry christmas
|
#2
|
|||
|
|||
Can items be used to increase health or mood?
|
#3
|
||||
|
||||
OK, so I'm trying to get this to work, and I would REALLY APPRECIATE if anyone in here could share whatever magic trick it takes to use an item to restore health. All I get is a white screen, every time.
|
#4
|
||||
|
||||
It's definitely possible, but I've never attempted it so I don't know the code.
__________________
|
#5
|
||||
|
||||
Still need help with scheduled tasks to make the bars go down, since I'm still lost on what to do.
__________________
|
#6
|
||||
|
||||
If your host allows cronjobs, you can just have a page with the tasks you want to perform and set it up through the cpanel ("I want this function from this file to run every day").
All the automatic tasks I've set up are basically like this: PHP Code:
To do it like HoF is saying, you can create a class file for each task you want. For example ResetClicksTask, LowerMoodTask, ... (which can extend a class Task, if you want inheritance) Each task class has a function like executeTask() that does what you want. In this case it would be like PHP Code:
PHP Code:
So when anyone visits the index, the function calls all the tasks that need to run.
__________________
asp.net stole my soul. |
#7
|
||||
|
||||
Thank you! I'll have to try it out right now. I'm using mysidiahost, so it allows cronjobs.
__________________
|
#8
|
||||
|
||||
Okay, so this is what I have in cron.php within the root folder:
PHP Code:
Quote:
__________________
Last edited by Dinocanid; 01-22-2017 at 01:53 PM. |
#9
|
||||
|
||||
I added a section for having the needs to go down every day.
__________________
|
#10
|
||||
|
||||
As a better alternative to my method above, would it be possible to have something like mySQL events? They're said to be able to be an alternative to cronjobs and I have seen options for this in phpMyAdmin, but I've never touched them. I'll try it and see how it works out.
EDIT: Nevermind, you would need super privileges in mySQL to make schedules (basically add permission), which I can't find a way to do.
__________________
Last edited by Dinocanid; 04-19-2017 at 03:59 PM. |
|
|
What's New? |
What's Hot? |
What's Popular? |