adivirus Posted November 19, 2008 Posted November 19, 2008 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 Quote
Blackdogg Posted November 20, 2008 Posted November 20, 2008 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']}"); Quote
adivirus Posted November 20, 2008 Author Posted November 20, 2008 Re: Organised Crimes problem thanks 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.