Eruondo Posted July 7, 2009 Posted July 7, 2009 My users have asked me if I could do a little more work on the crimes, or, more spesificly, that your bravebar does not upgrade every time you level up, but rather when you get so and so much crime experience. I thought it was a good idea, so I wonder if there is anyone here who has made something similar to it, (for free), so I don't have to make it from scratch? If there is not, I'll post it for you here when I've coded it, :D Quote
Danny696 Posted July 7, 2009 Posted July 7, 2009 Re: Crime Update im not sure what you mean and post it in the right topic next time Quote
gideon prewett Posted July 8, 2009 Posted July 8, 2009 Re: Crime Update i think he means like mines where u have exp then u go to the next mine so u do crimes and get crime exp to level up your brave rather than it going up when u level up Quote
Danny696 Posted July 8, 2009 Posted July 8, 2009 Re: Crime Update you need to change global func ill see if i can do it Quote
Eruondo Posted July 8, 2009 Author Posted July 8, 2009 Re: Crime Update i think he means like mines where u have exp then u go to the next mine so u do crimes and get crime exp to level up your brave rather than it going up when u level up Exactly! Quote
Danny696 Posted July 8, 2009 Posted July 8, 2009 Re: Crime Update you need to edit the check_level so it doesnt change the brave when the user levels up then you need to add a new function so when the user gets a certain amount of crime exp there brave goes up ill see what i can do about the seond one but the first youll have to do yourself Quote
Danny696 Posted July 9, 2009 Posted July 9, 2009 Re: Crime Update Ok Ive Done Them Both First Thing to Do It Add These Querys: ALTER TABLE `users` ADD `braveLVL` INT(3) NOT NULL DEFAULT '1'; ALTER TABLE `users` ADD `cEXPneeded` INT(11) NOT NULL DEFAULT '500'; Replace The Function check_level With This: function check_level() { global $db; global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir['exp'] >= $ir['exp_needed']) { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['maxenergy']+=2; $ir['hp']+=50; $ir['maxhp']+=50; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); $db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,maxenergy=maxenergy+2,hp=hp+50,maxhp=maxhp+50 where userid=$userid"); } } Then Just Before The ?> Add This 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); $db->query("UPDATE users SET brave=brave+2,maxbrave=maxbrave+2, braveLVL=braveLVL+1 where userid=$userid"); } } And Yes I Know I Used INT(3) because i dont think anyone will get over brave lvl 999 you can change it if you want Quote
Haunted Dawg Posted July 9, 2009 Posted July 9, 2009 Re: Crime Update it's simple as: if($ir['crimexp'] >= VALUE) { $brave = 2 mysql_query('UPDATE `users` SET `brave` = (`brave` + ',$brave,'),`maxbrave` = (`maxbrave` + ',$brave,'),`crimexp` = 0 WHERE `userid` = ',$ir['userid']); } Quote
Danny696 Posted July 9, 2009 Posted July 9, 2009 Re: Crime Update upadted my post with it all done :D Quote
Eruondo Posted July 9, 2009 Author Posted July 9, 2009 Re: Crime Update This is great, Thanks! :-D +1 Quote
Eruondo Posted July 9, 2009 Author Posted July 9, 2009 Re: Crime Update I've changed it a little bit, (Set max nerve and fixed two small errors) and I'll post it here, in case anyone else wants to this great upgrade. :-D if ($ir['braveLVL'] < 100) { $ir['crimeEXPneeded']=(int) (($ir['braveLVL']+1)*($ir['braveLVL']+1)*($ir['braveLVL']+1)*4.2+(500*$ir['braveLVL'])); if($ir['crimexp'] >= $ir['crimeEXPneeded']) { $ir['braveLVL']+=1; $ir['brave']+=5; $ir['maxbrave']+=5; //$ir['cEXPneeded'] = (int) ($ir['braveLVL']*500); $ir['crimeEXPneeded'] = (int) (($ir['braveLVL']+1)*($ir['braveLVL']+1)*($ir['braveLVL']+1)*4.2+(500*$ir['braveLVL'])); $db->query("UPDATE users SET brave=brave+5,maxbrave=maxbrave+5,braveLVL=braveLVL+1 WHERE userid=$userid"); } } Quote
Eruondo Posted July 9, 2009 Author Posted July 9, 2009 Re: Crime Update I've changed it a little bit, (Set max nerve and fixed two small errors) and I'll post it here, in case anyone else wants to use this great upgrade. :-D if ($ir['braveLVL'] < 100) { $ir['crimeEXPneeded']=(int) (($ir['braveLVL']+1)*($ir['braveLVL']+1)*($ir['braveLVL']+1)*4.2+(500*$ir['braveLVL'])); if($ir['crimexp'] >= $ir['crimeEXPneeded']) { $ir['braveLVL']+=1; $ir['brave']+=5; $ir['maxbrave']+=5; //$ir['cEXPneeded'] = (int) ($ir['braveLVL']*500); $ir['crimeEXPneeded'] = (int) (($ir['braveLVL']+1)*($ir['braveLVL']+1)*($ir['braveLVL']+1)*4.2+(500*$ir['braveLVL'])); $db->query("UPDATE users SET brave=brave+5,maxbrave=maxbrave+5,braveLVL=braveLVL+1 WHERE userid=$userid"); } } Quote
DeaTH_RideR Posted June 3, 2010 Posted June 3, 2010 I know this is really old but i was wondering if somebody would be so kind as to remake this .pls 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.