AlabamaHit Posted October 31, 2007 Share Posted October 31, 2007 Anyone know how to make it where the people in a gang gets an event when the gang does an organised crime...either sucess or failed? many many thanks in advance..........oh yeah......its on v2 Quote Link to comment Share on other sites More sharing options...
dementor Posted October 31, 2007 Share Posted October 31, 2007 Re: Event ADD something something event add blah blah blah check attackmug.php for a clue :-D Quote Link to comment Share on other sites More sharing options...
parelem Posted October 31, 2007 Share Posted October 31, 2007 Re: Event ADD it's coded into the cron, but it doesn't seem to work. Quote Link to comment Share on other sites More sharing options...
dementor Posted November 1, 2007 Share Posted November 1, 2007 Re: Event ADD aint it in yourgang.php ? Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted November 1, 2007 Author Share Posted November 1, 2007 Re: Event ADD lol, no Quote Link to comment Share on other sites More sharing options...
dementor Posted November 1, 2007 Share Posted November 1, 2007 Re: Event ADD v 2 different then boi cause is my yourgang.php Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted November 2, 2007 Author Share Posted November 2, 2007 Re: Event ADD anyway you can tell me how they have it worded? Quote Link to comment Share on other sites More sharing options...
Wookard Posted November 7, 2007 Share Posted November 7, 2007 Re: Event ADD Is there a trick to getting the OC Cron itself to work? This is what happens when a OC finishes.. oclog.php incorrect usage of file Quote Link to comment Share on other sites More sharing options...
parelem Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD bump Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD I'm using v1... These seem to work for me under success part of the oc cron.. $i=mysql_insert_id($c); $qm=mysql_query("SELECT * FROM users WHERE gang={$r['gangID']}",$c); while($rm=mysql_fetch_array($qm)) { event_add($rm['userid'],"Your Tribes's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } Fail part: $i=mysql_insert_id($c); $qm=mysql_query("SELECT * FROM users WHERE gang={$r['gangID']}",$c); while($rm=mysql_fetch_array($qm)) { event_add($rm['userid'],"Your Tribes's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } Don't know if it'll work for v2 though... I think thats what you wanted? ^^ Quote Link to comment Share on other sites More sharing options...
parelem Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD i don't think the v2 OC cron works at all, but i'm not sure what's wrong with it 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); } } } $i=mysql_insert_id($c); $qm=mysql_query("SELECT * FROM users WHERE gang={$r['gangID']}",$c); was missing the $c, i'll add it and test. Quote Link to comment Share on other sites More sharing options...
gurpreet Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD i don't think the v2 OC cron works at all, but i'm not sure what's wrong with it 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); } } } $i=mysql_insert_id($c); $qm=mysql_query("SELECT * FROM users WHERE gang={$r['gangID']}",$c); was missing the $c, i'll add it and test. Sorry to be a bit noobish but what file is this under? Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD It will be under your OC cron... orgcrime.php ? Quote Link to comment Share on other sites More sharing options...
gurpreet Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD I have no orgcrime.php. The only file starting with "o" I have got is oclog.php Quote Link to comment Share on other sites More sharing options...
parelem Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD it goes in cron_hour.php Quote Link to comment Share on other sites More sharing options...
gurpreet Posted November 11, 2007 Share Posted November 11, 2007 Re: Event ADD Oh ok thanks a lot :) Quote Link to comment Share on other sites More sharing options...
parelem Posted November 13, 2007 Share Posted November 13, 2007 Re: Event ADD hmm...can't get it to work. any ideas, anyone? Quote Link to comment Share on other sites More sharing options...
parelem Posted November 15, 2007 Share Posted November 15, 2007 Re: Event ADD bump Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted November 15, 2007 Share Posted November 15, 2007 Re: Event ADD In your cron file... Make sure your including the file with event_add() function in... require "../../../../global_func.php"; Something like that ^? Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted November 19, 2007 Author Share Posted November 19, 2007 Re: Event ADD Not sure what you mean, lol..But I'm trying a bunch of stuff. Quote Link to comment Share on other sites More sharing options...
redhead Posted March 24, 2008 Share Posted March 24, 2008 Re: Event ADD Did anyone ever figure out what was happening with this? Quote Link to comment Share on other sites More sharing options...
Ghetto Posted March 24, 2008 Share Posted March 24, 2008 Re: Event ADD This should work: $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)) { $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']}"); } } 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)) { $db->query("INSERT INTO events VALUES ('',{$rm['userid']},unix_timestamp(),'0',\"Your gang's Organised Crime Failed. 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']}"); } } } Quote Link to comment Share on other sites More sharing options...
toufail Posted November 4, 2008 Share Posted November 4, 2008 Re: Event ADD $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)) { $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']}"); } } 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)) { $db->query("INSERT INTO events VALUES ('',{$rm['userid']},unix_timestamp(),'0',\"Your gang's Organised Crime Failed. 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']}"); } } } any clue where thi sshould be Quote Link to comment Share on other sites More sharing options...
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.