ignite Posted March 4, 2007 Share Posted March 4, 2007 I've made some medical items witch reduce certain amounts of time when a user is in hospital. The problem is if a user is in hospital for 19 minuets and uses a small medi kit witch takes of 20 minuets. It will put the user in hospital for -1 minuets. Heres the code i used. if($r['itmname'] == 'Medi kit') { mysql_query("UPDATE users SET hospital=hospital-1 WHERE userid=$userid",$c); } print "You spray a {$r['itmname']} into your mouth. You feel a bit of health coming back to you."; Quote Link to comment Share on other sites More sharing options...
vinyl Posted March 4, 2007 Share Posted March 4, 2007 Re: Medical items add mysql_query("UPDATE users SET hospital=0 where hospital<0"); Quote Link to comment Share on other sites More sharing options...
ignite Posted March 4, 2007 Author Share Posted March 4, 2007 Re: Medical items thanks thats worked a treat. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.