Danny696 Posted July 21, 2009 Posted July 21, 2009 This Was Asked As A Mod. What It Does; Makes your BraveBar Not Go Up EveryTime You Gain A Level Instead To Upgrade It You Have To Do Crimes And Gain CrimeEXP This Encourages Players to Be More Active And Do More Crimes. So Here It Is: Firstly Run These In PHPMyAdmin: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. In Global_Func.php Find Function Check_Level And Replace With This: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then In The Same File Find ?> (Or The End) And Add Before: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then Thats It If You Want To Add Brave Level Any Where Use This You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I Will Update Post In A Min Using Sprinf (learning Sprintf From Reading it & About It) Thanks For Reading Any FeedBack Is Good (bad I'm not bothered about it tells me what i can do better) Danny696 *Updated Using Sprinf* - Danny696 Hope It Works Quote
Eruondo Posted July 21, 2009 Posted July 21, 2009 Re: Crime Update This is what I use. Pretty much the same, but with a maximum maxbrave (100 in this example) and some different gain per level, and different formulas to level up a bravelevel. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Danny696 Posted July 21, 2009 Author Posted July 21, 2009 Re: Crime Update WithOut Using Sprintf: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
endo Posted July 22, 2009 Posted July 22, 2009 Re: Crime Update you dont really need a new function danny696 but im a prude for saving space :P could really shorten that right down to simply having one column set out for their exp and work out the brave from that ie You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. increases the users brave by one for every time their experience reaches above 75* by there current brave of course you can alter that to make it harder or easier to gain brave but that way is simple and effective just put it in the hourly cron or something to update for all users and boom job done no function needed lots of space save etc etc well my 2 cents Quote
thedestroyer Posted August 3, 2009 Posted August 3, 2009 Re: Crime Update This code seriously messed up my game i edited people to set their brave bak to starting brave then it didnt work and my players are goin to be mad now thanks a lot :x Quote
Feky Posted August 3, 2009 Posted August 3, 2009 Re: Crime Update well i altered it a bit and works perfect for me and you should of made a backup before you were going to make a big change Quote
thedestroyer Posted August 3, 2009 Posted August 3, 2009 Re: Crime Update well i altered it a bit and works perfect for me and you should of made a backup before you were going to make a big change How did u get it to work? Quote
CJ - Twitch Posted January 24, 2010 Posted January 24, 2010 I know this is a old topic.. maybe? Does it work with v2? Or is it v2? I can't get it to work... Please help, CJ Quote
Danny696 Posted January 26, 2010 Author Posted January 26, 2010 The FIx::::: open globals.php find: check_level(); add after: check_brave(); Quote
DeaTH_RideR Posted June 7, 2010 Posted June 7, 2010 ill bump :P this just cause im a needy bitch Quote
Uridium Posted June 7, 2010 Posted June 7, 2010 Little error CHANGE function check_brave() { global $db; global $ir,$c,$userid; $ir['cEXPneeded']=(int) ($ir['braveLVL']*500); if($ir['crimeexp'] >= $ir['cEXPneeded']) { $ir['braveLVL']+=1 $ir['brave']+=2; $ir['maxbrave']+=2; $ir['cEXPneeded']=(int) ($ir['braveLVL']*500); $query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], $ir['maxbrave'], $ir['braveLVL'], $ir['braveLVL'], $ir['userid']); $db->query($query); } } TO function check_brave() { global $db; global $ir,$c,$userid; $ir['cEXPneeded']=(int) ($ir['braveLVL']*500); if($ir['crimeexp'] >= $ir['cEXPneeded']) { $ir['braveLVL']+=1; $ir['brave']+=2; $ir['maxbrave']+=2; $ir['cEXPneeded']=(int) ($ir['braveLVL']*500); $query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], $ir['maxbrave'], $ir['braveLVL'], $ir['braveLVL'], $ir['userid']); $db->query($query); } } Quote
Danny696 Posted June 7, 2010 Author Posted June 7, 2010 change $query = sprintf("UPDATE users SET %a=$a+2,%b=%b+2,%c=%c+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], to $query = sprintf("UPDATE users SET %s=$a+2,%s=%s+2,%s=%s+1 WHERE userid=%u", $ir['brave'], $ir['brave'], $ir['maxbrave'], Quote
DeaTH_RideR Posted June 7, 2010 Posted June 7, 2010 lmao let me get back to you on this Ok after Danny helping me fix the level check and me jacking with the brave check for 2hours, i have it all working. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. thanks to everybody that had a hand in helping me get what i wanted for my game. This has been tested and works great :!: :thumbup: 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.