#15662 - 09/19/07 12:28 AM
real time hp, mp, tp replenishing?
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
Ok, so all my mods are finally coming together.. only thing is i would like a real time hp, mp, tp replenish.. in other words every 5 mins. or so all your hp, mp, tp would be 100%
i know how to create a count down clock in php.. the only thing is the user has to keep refreshing the page or the 5 min wait will turn into however long it takes for them to refresh it. hopefully you get what i mean.
if someone could give me some help on this i would really appreciate it
|
|
Top
|
|
|
#15668 - 09/19/07 09:08 AM
Re: real time hp, mp, tp replenishing?
[Re: Fayt]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
i dont see how this is a bad idea.. I have disabled instant healing after you have died.. so people will have to wait 5 mins before they can come back to life..
i still dont see how that mysql set up is a real time replenish setup.. with php i will still have to make the time before it replenishes.. so that means it will wait until the person refreshes. before it starts the 5 min count down.
|
|
Top
|
|
|
#15669 - 09/19/07 11:51 AM
Re: real time hp, mp, tp replenishing?
[Re: Brendon]
|
Fayt
Crunchberries
 
Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA
|
Offline
|
|
The way I read it, you wanted everyones HP, MP, TP completely recovered every 5 minutes, so if they lose 100 hp out of 200 hp then wait 5 minutes, they are fully healed again. That's how I saw it.
Like I said for real time, set it up by server time, and intevals (however you spell it) at 5 minutes repeat.
_________________________
MasterFayt - Amara 5 - Manas - Banar
|
|
Top
|
|
|
#15671 - 09/19/07 12:02 PM
Re: real time hp, mp, tp replenishing?
[Re: Fayt]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
aah, yes i mean server time. thanks for clearing that up.
|
|
Top
|
|
|
#15672 - 09/19/07 12:04 PM
Re: real time hp, mp, tp replenishing?
[Re: Brendon]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
the only problem with doing the real time + server time is it requires the player to be "playing" all the time..
since i have pvp i have to have it so the person can come back to life even though they are offline
|
|
Top
|
|
|
#15686 - 09/20/07 03:18 AM
Re: real time hp, mp, tp replenishing?
[Re: Brendon]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
This is all wrong and a bad idea. But Im not going to go through it all. You should just abandon this idea now.
|
|
Top
|
|
|
#15695 - 09/20/07 10:07 AM
Re: real time hp, mp, tp replenishing?
[Re: Fayt]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
ok maybe this is a bad idea if so many ppl are against it :P i have made a mod for robbing stores though, i would like to be able to send someone to prison for say 10 mins. if they are caught. this would also use the time system but would add an entry to mysql when they entered and remove when left..
the only problem is i am not very familiar with adding mktime(); with php.. how would i set it up so there would be 2 time stamps on mysql one that said when they entered and one that said when they can leave (in 10 mins)
Thanks for the help btw
|
|
Top
|
|
|
#15698 - 09/20/07 01:15 PM
Re: real time hp, mp, tp replenishing?
[Re: Fayt]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
haha yes i know this. i have already made a code for the steal event. im not a complete noob with php..
|
|
Top
|
|
|
#15713 - 09/21/07 11:07 AM
Re: real time hp, mp, tp replenishing?
[Re: Fayt]
|
Brendon
Grape Nuts
Registered: 09/18/07
Posts: 40
|
Offline
|
|
noo.. every thing is working flawlessly. i just dont know how any of this php time works..
oh well, gonna have to get a php book or something :P
|
|
Top
|
|
|
#15727 - 09/24/07 05:06 PM
Re: real time hp, mp, tp replenishing?
[Re: Brendon]
|
AnmanIndustries
Cookie Crisp
   
Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth
|
Offline
|
|
Go find my static shop mod for DS. There is a bit of code at the top that controls the autorefresh of the shop. You can use that.
|
|
Top
|
|
|
#15763 - 09/29/07 06:52 PM
Re: real time hp, mp, tp replenishing?
[Re: AnmanIndustries]
|
CBeTHaX
Malt-o-Meal
Registered: 08/24/07
Posts: 8
|
Offline
|
|
You have to make a field in the users table - jailtime int(11) When he enters in the jail set a date()+300 // timestamp + 10 min and put it in the jailtime Then to check if it is time to get out of jail, write:
if($userrow["jailtime"] < date()) { //Free the prisoner } else { //Stay in the jail >:-D }
|
|
Top
|
|
|
|
|