You just want to update a value every minute you may need to just check with the database (as vujsa said before). This is quite simple to achieve. I use this method often here is a basic blueprint of what is going to occur:
-Step 1: only call when asked (so if selected for attack script or profile). I suggest that you make it into A: a function or B: just make it a require friendly page. Easy in easy out est. est.
-Such as you put in the $username=$name; --> Require --> $Current_health=$currenthealth.
-Step 2: Select for database where username=$username and extract two entries HP and TimeUD (time Updated).
-Step 3: Time() - TimeUD = TimeB (Time between).
-Step 4: TimeB*Rate (should be a number you could however put in an equation for health)=HPA (HP Added).
-Step 5: HP+HPA=NHP(New HP).
-Step 6: Simple if If(NHP>100){NHP=100;}
-Step 7: Update Database with Time() (from above). Update Database with NHP.
-Step 8: Finally just set $currenthealth and finish.
With that said you 'should' be able to figure it out. Basically we are NOT updating the database each minute but rather each time we need to. Then we are simply getting the value. Just change a few things to decrease health over time (stabbed and loosing blood, slowly dieing over time est.).
Here is my Untested Example (Change it accordingly):
CODE
<?php
//In: $username
//Out: $CH
//Only use once each load
//Require with require(); See Manual.
$row = mysql_fetch_array(mysql_query("SELECT * FROM replace_w_db WHERE UserN='$username'") or die(mysql_error()));
$currentHP=$row['HP'];
$LUT=$row['LastUpdatedTime'];
$currentTime=Time();
$TD=$currentTime-$LUT;
$HPD=$TD*0.1;//0.1 HP gain per secound.
$CH=$currentHP+$HPD;//Add HP (change to - if subtract).
//Update DB
$result = mysql_query("UPDATE replace_w_db SET HP='$CH' WHERE UserN='$username'")
or die(mysql_error());
$result = mysql_query("UPDATE replace_w_db SET LastUpdatedTime='$currentTime' WHERE UserN='$username'")
or die(mysql_error());
//Finish off.
?>
It should work (hopefully). If not, you know how to PM.
Good Luck,
Sparkx
EDIT: Spelling + Grammar Error fixed.
Oh ya and if you want every minute just divide $TD by 60 ex: $TD=$TD/60; (insert just after:$TD=...
Comment/Reply (w/o sign-up)