Jump to content
MakeWebGames

Hospital crimes


ADN
 Share

Recommended Posts

I saw an example of hospital crimes here : http://criminalexistence.com/ceforums/i ... ic=17197.0

But, i need something more complicated.

SO, i create in "crimes" table, crimeHTEXT, crimeHTIME, crimeHREASON.

I modify my staff_crimes.php to add/edit a crime with hospital reason, time & text (and my database updates with hospital info).

Now, i take the code from Toxication, and he is look like that :

 

else
{
print $r['crimeHTEXT'];
$chance=rand(1,2);
if ($chance == 1)
{
$hospital=rand(2,7);
mysql_query("UPDATE users SET hospital=$r[crimeHTIME], hospreason=$r[crimeHREASON] WHERE userid=$userid");
}
if ($chance == 2)
{
$jail=rand(2,7);
{
print $r['crimeFTEXT'];
}
mysql_query("UPDATE users SET jail=$r[crimeJAILTIME], jail_reason=$r[crimeJREASON] WHERE userid=$userid");
}
}

I mention that crimeHTIME and crimeHREASON exist in "crimes" and hospital & hospreason exist in "users".

If i failure a crime, and the text say i should be in hospital, well, my database is not updating. I can still do crimes untill my brave go to 0.

Any ideea what is wrong ?

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...