Jump to content
MakeWebGames

Recommended Posts

Posted

Hello, i have a problem with my og.. it doesn't add to the gang the respect level that the crimes gives it.. in case of success

..

this is my code in case of success

 

$suc=rand(0,1);
if($suc) {
$log=$r['ocSTARTTEXT'].$r['ocSUCCTEXT'];
$muny=(int) (rand($r['ocMINMONEY'],$r['ocMAXMONEY']));
$log=str_replace(array("{muny}","'"),array($muny,"''"),$log);
$db->query("UPDATE gangs SET gangMONEY=gangMONEY+$muny,gangCRIME=0 WHERE gangID={$r['gangID']}");
$db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'success', $muny, '{$r['ocNAME']}', unix_timestamp())");
$i=$db->insert_id();
$qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}");
while($rm=$db->fetch_row($qm))
{
$db->query("INSERT INTO events VALUES ('',{$rm['userid']},unix_timestamp(),'0',\"Your gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.\")");
$db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$rm['userid']}");

 

thanks

Posted

Re: Organised Crimes problem

you want to change the gangupdate statement to somethiing like

$db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+2,gangMONEY=gangMONEY+$muny,gangCRIME=0 WHERE gangID={$r['gangID']}");

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