Tonka Posted September 10, 2008 Posted September 10, 2008 my users are not getting event's that their gang crimes have failed or succeeded, here is the code from my cron hour $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0"); $q=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangCRIME > 0 AND g.gangCHOURS = 0"); while($r=$db->fetch_row($q)) { $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)) { event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } else { $log=$r['ocSTARTTEXT'].$r['ocFAILTEXT']; $muny=0; $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'failure', $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)) { event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } } Quote
Silver Posted September 11, 2008 Posted September 11, 2008 Re: Cron Hour Gang Crimes I'm not really a v2 expert but perhaps it's because the $c variable isn't supposed to be there... not sure tbh Quote
Tonka Posted September 11, 2008 Author Posted September 11, 2008 Re: Cron Hour Gang Crimes it was working for a bit, but it's stoped for some reason Quote
Floydian Posted September 11, 2008 Posted September 11, 2008 Re: Cron Hour Gang Crimes $c is set as the database connection in version two. Quote
AlabamaHit Posted September 13, 2008 Posted September 13, 2008 Re: Cron Hour Gang Crimes show me the top of your cron i want to say its somethign in the top connecting to the database where its not allowing the event add feature work...post yours and i will compare to mine lol..i fixed it but i dont feel like finding my orginal files...(on external hard drive in closet LOL) Quote
Tonka Posted September 13, 2008 Author Posted September 13, 2008 Re: Cron Hour Gang Crimes <?php include "removed"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "removed"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0"); $q=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangCRIME > 0 AND g.gangCHOURS = 0"); while($r=$db->fetch_row($q)) { $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)) { event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } else { $log=$r['ocSTARTTEXT'].$r['ocFAILTEXT']; $muny=0; $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'failure', $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)) { event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } } if($set['validate_period'] == 60 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } $db->disconnect(); ?> Quote
AlabamaHit Posted September 13, 2008 Posted September 13, 2008 Re: Cron Hour Gang Crimes There should be 2 required pages... Look in your code find require "removed"; add after...this is where you have to decide which cause obviously you removed it LMAO require "class/class_db_{$_CONFIG['driver']}.php"; require "global_func.php"; just add which ever you dont have.... Quote
Tonka Posted September 13, 2008 Author Posted September 13, 2008 Re: Cron Hour Gang Crimes i know that, i removed them before posting Quote
AlabamaHit Posted October 18, 2008 Posted October 18, 2008 Re: Cron Hour Gang Crimes well did that fix it? Quote
radio_active Posted October 20, 2008 Posted October 20, 2008 Re: Cron Hour Gang Crimes Or you could buy floydians sweet OC script which you can find on my game which i paid him to make :lol: Quote
hobbes Posted January 9, 2009 Posted January 9, 2009 Re: Cron Hour Gang Crimes Or you could buy floydians sweet OC script which you can find on my game which i paid him to make :lol: What does his OC script incorporate that the original one doesn't? I may be interested... Quote
redsnake420 Posted January 10, 2009 Posted January 10, 2009 Re: Cron Hour Gang Crimes i need a cron hour fix my gang crimes sometimes go into the negatives how do i fix that Quote
redsnake420 Posted January 29, 2009 Posted January 29, 2009 Re: Cron Hour Gang Crimes has anyone got a fix so my crimes will stop going into the negatives Quote
AlabamaHit Posted January 29, 2009 Posted January 29, 2009 Re: Cron Hour Gang Crimes Yes, i have posted it at least 5 times on here. .lol Quote
redsnake420 Posted January 29, 2009 Posted January 29, 2009 Re: Cron Hour Gang Crimes ok will it work for v2 and do you mind sending me the code in a pm thanks Quote
AlabamaHit Posted January 29, 2009 Posted January 29, 2009 Re: Cron Hour Gang Crimes yes tis works on v2 and No i wont send to in pm There is this super top secert option on this site called SEARCH. I say its super top secert cause no one uses it....Wel no you know... Word of advice if you want to learn. And get any respect. Put some work it yourself Quote
redsnake420 Posted January 30, 2009 Posted January 30, 2009 Re: Cron Hour Gang Crimes you know what, you don't need to be no smart ass little punk, i just asked a simple question and i don't want no jackass answer like the one you just gave me. I'm not no damn little kid and i don't wanna be treated like one, so i suggest you keep those smart ass answers for the little kids on this site. Because i don't wanna hear it, i know what and where the Search functions is. I was just hoping for some Kindness for once on this site. Quote
AlabamaHit Posted January 30, 2009 Posted January 30, 2009 Re: Cron Hour Gang Crimes If you ain't going to use the damn search.. Why the hell would I use it for you..? Quote
redsnake420 Posted January 30, 2009 Posted January 30, 2009 Re: Cron Hour Gang Crimes i do use the damn search every day and you do know for some things its don't help at all also its not like i was asking for the code for free i didnt care if i had to pay for it also i apologize for the cocky remark but i am just tired of seeing everyone give so many shitty ass answers on here Quote
redsnake420 Posted January 31, 2009 Posted January 31, 2009 Re: Cron Hour Gang Crimes i have tried the search and found nothing that can help me with my gang crimes going negative there is no fix on this site that actually shows the code fix Quote
AlabamaHit Posted February 1, 2009 Posted February 1, 2009 Re: Cron Hour Gang Crimes $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0 AND gangCHOURS > 0"); Quote
danger boy Posted February 1, 2009 Posted February 1, 2009 Re: Cron Hour Gang Crimes try this redsnake420 :wink: http://criminalexistence.com/ceforums/i ... ic=27127.0 And stop being harsh on him alabamahit he was simply asking for the code. Quote
redsnake420 Posted February 1, 2009 Posted February 1, 2009 Re: Cron Hour Gang Crimes Thanks Danger Boy, Ill test that out and see if it works. Quote
danger boy Posted February 2, 2009 Posted February 2, 2009 Re: Cron Hour Gang Crimes No problem :wink: 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.