REGGIE KRAY Posted January 20, 2009 Share Posted January 20, 2009 Where abouts do I find the user exp increments, if I can understand them then I will try and make it so gangs gain exp rather than respect points. Thanks Reggie Quote Link to comment Share on other sites More sharing options...
REGGIE KRAY Posted January 20, 2009 Author Share Posted January 20, 2009 Re: Help with Exp on V2 needed please. I have found it in Global functions 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['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=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,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid"); } } Thanks anyway. Quote Link to comment Share on other sites More sharing options...
Dave Posted January 21, 2009 Share Posted January 21, 2009 Re: Help with Exp on V2 needed please. I have found it in Global functions 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['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=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,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid"); } } Thanks anyway. I think its done on $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); Read it like a some exp_needed = level+1*level+1*level+1*2.2 so if your level was 2 it would look like exp_needed = 2+1*2+1*2+1*2.2 Donno if that helped. Quote Link to comment Share on other sites More sharing options...
POG1 Posted January 21, 2009 Share Posted January 21, 2009 Re: Help with Exp on V2 needed please. $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); Read it like a some exp_needed = level+1*level+1*level+1*2.2 so if your level was 2 it would look like exp_needed = 2+1*2+1*2+1*2.2 Donno if that helped. exp_needed = 2+1*2+1*2+1*2.2 without the brakets it wouldn't work properly' exp_needed = (2+1)*(2+1)*(2+1)*2.2 Quote Link to comment Share on other sites More sharing options...
REGGIE KRAY Posted January 21, 2009 Author Share Posted January 21, 2009 Re: Help with Exp on V2 needed please. Cheers for that so far ive got ALTER TABLE `gang` ADD `ganglevel` INT(11) NOT NULL DEFAULT '1', ALTER TABLE `gang` ADD `gangEXP` INT(11) NOT NULL DEFAULT '0'; function check_ganglevel() { global $db; global $ir,$c,$gangid,$gangdata; $gangdata['exp_needed']=(int) (($gangdata['ganglevel']+1)*($gangdata['ganglevel']+1)*($gangdata['ganglevel']+1)*5); if($gangdata['gangEXP'] >= $gangdata['exp_needed']) { $expu=$gangdata['exp']-$gangdata['exp_needed']; $gangdata['ganglevel']+=1; $gangdata['gangEXP']=$expu; $gangdata['exp_needed']=(int) (($gangdata['ganglevel']+1)*($gangdata['ganglevel']+1)*($gangdata['ganglevel']+1)*5); $db->query("UPDATE gang SET ganglevel=ganglevel+1,gangEXP=$expu where gangid=$gangid"); } } My gang Exp is fine it goes up with attacks won but the gang level stays at level '6' for all gangs no matter what their Exp Any advice given I would be very gratefull. Thanks Reggie 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.