montyash Posted February 20, 2008 Posted February 20, 2008 hi does any1 know how do make it so u go in hospital when you do a crime Quote
zbirc3 Posted February 21, 2008 Posted February 21, 2008 Re: crime hospital time What would be the point? Quote
montyash Posted February 21, 2008 Author Posted February 21, 2008 Re: crime hospital time because u could do a crime like armed robery and get shoot by police Quote
03laceys Posted February 21, 2008 Posted February 21, 2008 Re: crime hospital time i have done this for all my crimes i have no jail on my game only the hospital, on my game there is also no food to get you out of hosp lol. of the top of my head i cant remember the code i will how ever when i get home go onto my host and get the code for you. Quote
montyash Posted February 21, 2008 Author Posted February 21, 2008 Re: crime hospital time ok thanx m8 Quote
Ishy Posted February 23, 2008 Posted February 23, 2008 Re: crime hospital time Here is a simple way of doing it: Open docrime.php and find: else { print $r['crimeFTEXT']; } Then replace that code with: else { print $r['crimeFTEXT']; $hosptime= rand(2,7); mysql_query("UPDATE users SET hospital={$hosptime}, hospreason='Failed a crime' WHERE userid=$userid",$c); } There you have it, that should work, don't think there will be any problems with it. :-D Quote
Klikoka Posted February 23, 2008 Posted February 23, 2008 Re: crime hospital time Here is a simple way of doing it: Open docrime.php and find: else { print $r['crimeFTEXT']; } Then replace that code with: else { print $r['crimeFTEXT']; $hosptime= rand(2,7); mysql_query("UPDATE users SET hospital={$hosptime}, hospreason='Failed a crime' WHERE userid=$userid",$c); } There you have it, that should work, don't think there will be any problems with it. :-D Wouldnt You Need To Take Away The Jail Time Part Of The Code So You Would Edit if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } To if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `hospital` = '$r[crimeJAILTIME]', `hospreason` = 'Failed To Do A Crime' WHERE `userid` = '$userid'"); } } Then You Would Go Into Hospital For Amount Of Time That You Would Have Spent In Jail Quote
Ishy Posted February 23, 2008 Posted February 23, 2008 Re: crime hospital time He asked how to go in hospital when failing a crime, I gave him an easy way :-D Go on as well tho Klikoka He would have to add 2 more fields in tho crimeJTEXT and crimeHTEXT I need mine so they randomly go in hospital on FTEXT Quote
HITMAN 17 Posted February 24, 2008 Posted February 24, 2008 Re: crime hospital time He asked how to go in hospital when failing a crime, I gave him an easy way :-D Go on as well tho Klikoka He would have to add 2 more fields in tho crimeJTEXT and crimeHTEXT I need mine so they randomly go in hospital on FTEXT wats the sql for this then as its a weird sql Quote
Ishy Posted February 24, 2008 Posted February 24, 2008 Re: crime hospital time You wouldn't need an SQL for mine. Quote
montyash Posted February 25, 2008 Author Posted February 25, 2008 Re: crime hospital time make it random like sometimes you go jail and sometimes you go hospital? Quote
montyash Posted February 25, 2008 Author Posted February 25, 2008 Re: crime hospital time sorry my keyboard didnt write the first bit is there a way to make it random like sometimes you go jail and sometimes you go hospital? Quote
Ishy Posted February 25, 2008 Posted February 25, 2008 Re: crime hospital time Replace the other code I had with this: else { print $r['crimeFTEXT']; $chance=rand(1,2); if ($chance == 1) { $hosp=rand(2,7); mysql_query("UPDATE users SET hospital={$hosp}, hospreason='Failed a crime' WHERE userid=$userid",$c); } if ($chance == 2) { $jail=rand(2,7); mysql_query("UPDATE users SET jail={$jail}, jail_reason='Failed a crime' WHERE userid=$userid",$c); } } That should make it random to go to jail or hospital. If have any problems please message me. Enjoy :-) Quote
montyash Posted February 25, 2008 Author Posted February 25, 2008 Re: crime hospital time ok thank you Quote
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.