Jump to content
MakeWebGames

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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 :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...