Jump to content
MakeWebGames

Recommended Posts

Posted
$USelectResult=$db->query("SELECT * FROM users WHERE CurrentCrime>0") or die ($db->error());
while ($U=$db->fetch_row($USelectResult))
{
$db->query("UPDATE users SET CrimeTime=CrimeTime-1 WHERE userid={$U['userid']} AND CrimeTime>0") or die ($db->error());
if ($U['CrimeTime'] == 0)
{
	$C1=$db->query("SELECT * FROM Crimes WHERE cID={$U['CurrentCrime']}") or die ($db->error());
	$C=$db->fetch_row($C1) or die ($db->error());
	$db->query("UPDATE users SET CurrentCrime = 0 WHERE userid = {$U['userid']}") or die ($db->error());
	$SuccessPercent = $C['cSUCCESSPERC'];
       $SuccessPerc = rand(1,100);
       if($SuccessPercent >= $SuccessPerc)
       {
	$MoneyGain = rand($C['cMINCASH'],$C['cMAXCASH']);
	$db->query("UPDATE users SET money=money+{$MoneyGain} WHERE userid={$U['userid']}") or die ($db->error());
	$db->query("UPDATE userstats SET labour=labour+{$C['cLABOUR']}, IQ=IQ+{$C['cIQ']} WHERE userid={$U['userid']}") or die ($db->error());
	event_add("INSERT INTO events ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=green><h4>Crime Complete</h4></font><table border=0>
									      <tr>
										    <td>Cash Gained:</td>
											<td>\${$MoneyGain}</td>
										  </tr>
									      <tr>
										    <td>IQ Gained:</td>
											<td>{$C['cIQ']}</td>
										  </tr>
									      <tr>
										    <td>Labour Gained:</td>
											<td>{$C['cLABOUR']}</td>
										  </tr>				
									      <tr colspan=2>
										    <td colspan=2>Complete Speech:</td>
										  </tr>
										  <tr colspan=2>
											<td colspan=2>[size="1"]{$C['cCOMPLETETEXT']}[/size]</td>
										  </tr>		
										</table>')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());
	}
	else
	{
	$Chance = rand(1,2);
	if ($Chance == 1)
	{
	event_add("INSERT INTO events ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=red><h4>Crime Failed</h4></font>')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());
	}
	if ($Chance == 2)
	{
	event_add("INSERT INTO events   ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=red><h4>Crime Failed</h4></font>[b]')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());	
 }		
	}
}
}		
?>

i have this cron and it is not working like it does not send an event or credit anyone can someone please help or fix thankyou

Posted

Re: Cron Problem

 

$USelectResult=$db->query("SELECT * FROM users WHERE CurrentCrime>0") or die ($db->error());
while ($U=$db->fetch_row($USelectResult))
{
$db->query("UPDATE users SET CrimeTime=CrimeTime-1 WHERE userid={$U['userid']} AND CrimeTime>0") or die ($db->error());
if ($U['CrimeTime'] == 0)
{
	$C1=$db->query("SELECT * FROM Crimes WHERE cID={$U['CurrentCrime']}") or die ($db->error());
	$C=$db->fetch_row($C1) or die ($db->error());
	$db->query("UPDATE users SET CurrentCrime = 0 WHERE userid = {$U['userid']}") or die ($db->error());
	$SuccessPercent = $C['cSUCCESSPERC'];
       $SuccessPerc = rand(1,100);
       if($SuccessPercent >= $SuccessPerc)
       {
	$MoneyGain = rand($C['cMINCASH'],$C['cMAXCASH']);
	$db->query("UPDATE users SET money=money+{$MoneyGain} WHERE userid={$U['userid']}") or die ($db->error());
	$db->query("UPDATE userstats SET labour=labour+{$C['cLABOUR']}, IQ=IQ+{$C['cIQ']} WHERE userid={$U['userid']}") or die ($db->error());
	$AlertInsert="INSERT INTO events ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=green><h4>Crime Complete</h4></font><table border=0>
									      <tr>
										    <td>Cash Gained:</td>
											<td>\${$MoneyGain}</td>
										  </tr>
									      <tr>
										    <td>IQ Gained:</td>
											<td>{$C['cIQ']}</td>
										  </tr>
									      <tr>
										    <td>Labour Gained:</td>
											<td>{$C['cLABOUR']}</td>
										  </tr>				
									      <tr colspan=2>
										    <td colspan=2>Complete Speech:</td>
										  </tr>
										  <tr colspan=2>
											<td colspan=2>[size="1"]{$C['cCOMPLETETEXT']}[/size]</td>
										  </tr>		
										</table>')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());
	}
	else
	{
	$Chance = rand(1,2);
	if ($Chance == 1)
	{
	$AlertInsert="INSERT INTO events ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=red><h4>Crime Failed</h4></font>')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());
	}
	if ($Chance == 2)
	{
	$AlertInsert="INSERT INTO events   ('',
									   {$U['userid']},
									   unix_timestamp(),
									   0,
									   '<font color=red><h4>Crime Failed</h4></font>[b]')";
	$AlertInsertSub=$db->query($AlertInsert) or die (mysql_error());	
       }		
	}
}
}
Posted

Re: Cron Problem

Now let me tell you me and toxication made this i was the one who made the cron, this was not ment to be sold but clearly toxication had other idea's so he has gone behind my back and sold it for profit himself

I have the cron that works since i was the one that built it i will not fix it for you becuase it wasnt ment to be sold now you can rant and rave it will not get you anywhere with me

You will have to try get in contact with toxication to sort this out.

Posted

Re: Cron Problem

Now let me tell you me and toxication made this i was the one who made the cron, this was not ment to be sold but clearly toxication had other idea's so he has gone behind my back and sold it for profit himself

I have the cron that works since i was the one that built it i will not fix it for you becuase it wasnt ment to be sold now you can rant and rave it will not get you anywhere with me

You will have to try get in contact with toxication to sort this out.

Toxication would beg for money of me... so doing this dosen't surprise me.

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...