snaketooth22 Posted August 13, 2011 Share Posted August 13, 2011 I've created a list of crimes,. and when ive tested them on a demo user,. the EXP goes up to 17 then wont go no further,. does anybody know how i would be able to solve this ??,. ive tried doing the crimes 20 times over and the EXP just wont go up no further,... Quote Link to comment Share on other sites More sharing options...
Rory_M Posted August 13, 2011 Share Posted August 13, 2011 Is this an engine or custom, what is the code? Please try to explain a bit more. :) Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 mc v2 code engine,. but it has had a number of modification added to the game,. Quote Link to comment Share on other sites More sharing options...
Rory_M Posted August 13, 2011 Share Posted August 13, 2011 Ok, can you add the code within [*PHP*]code here[/*PHP*] without the stars, so people can have a look at it. Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 what code would you need to see ?? criminal.php or header.php,.. or something else Quote Link to comment Share on other sites More sharing options...
Maniak Posted August 13, 2011 Share Posted August 13, 2011 In global_func.php the "check_level()" function is what we'll need. Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 function check_level() { global $ir; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); } ^^This ?? then theres a modification function that i have below this Quote Link to comment Share on other sites More sharing options...
Maniak Posted August 13, 2011 Share Posted August 13, 2011 (edited) Yeah that would be it, is that the whole of the function.. The standard one is something like: function check_level() { global $db, $ir, $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`='.abs(intval($expu)).', `energy`=energy+2, `brave`=brave+2, `maxenergy`=maxenergy+2, `maxbrave`=maxbrave+2, `hp`=hp+50, `maxhp`=maxhp+50 WHERE (`userid`='.$userid.')'); } } Edited August 13, 2011 by Maniak Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 riight ill give this a try,. this does look familiar as it goes Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 QUERY ERROR: Unknown column '$expu' in 'field list' Query was 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`=2) I now get this error if i enter that script Quote Link to comment Share on other sites More sharing options...
Maniak Posted August 13, 2011 Share Posted August 13, 2011 Try what's there now :). Quote Link to comment Share on other sites More sharing options...
Anonymous Posted August 13, 2011 Share Posted August 13, 2011 (edited) I had to read that a couple of times, but it would appear that given $expu is computed as $expu = ($ir['exp']-$ir['exp_needed']); then the need for abs(intval(...)) is pointless. The error message: QUERY ERROR: Unknown column '$expu' in 'field list' seems self explanatory to me - and even suggests exactly what the problem is. Wrapping $expu with abs(intval(..)) will, in all expectations, yield the same error. A decent syntax highlighting editor should pick this up. ie: check your quotes. Edited August 13, 2011 by Anonymous Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 im lost here,. can yuh make this a little bit easier for me to understand,. so what exactly should i be doing to solve this issue,. ?? Quote Link to comment Share on other sites More sharing options...
runthis Posted August 13, 2011 Share Posted August 13, 2011 i am sure its simpler than all that,check your crimes on how you made it act on success, somewhere you fucked up your logic when creating the crimes and doing the formula for gaining experience. Quote Link to comment Share on other sites More sharing options...
W3Theory || Peter Posted August 13, 2011 Share Posted August 13, 2011 i am sure its simpler than all that,check your crimes on how you made it act on success, somewhere you fucked up your logic when creating the crimes and doing the formula for gaining experience. If you saw in one of his firsts posts where he posted the lines for his function that is checking the level, there was nothing in there to update a player. So it had to do with the function, now he is having a little error after adding in what someone gave him. Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 ((WILL*0.7)/1.4)+(LEVEL/4) Crime XP Given = 1 dont think its anything to do with the formula Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 it was going on until i got to 17EXP,. then it didnt work,. and nothing was changed to the coding in that time,.. can anyone give any instructions to carry out and ill see if it solves the problem.,. I appreciate the help so far :) Quote Link to comment Share on other sites More sharing options...
W3Theory || Peter Posted August 13, 2011 Share Posted August 13, 2011 We stated to you, it's the check level function. It's pretty simple and straight forward, the function checks your experience to see where you are at and then if you are above it will advance you up a level. PS: 17exp is the default max exp you can get for level 1. Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 how can i change it so it has to reach 100% till it goes up to the next level ?? Quote Link to comment Share on other sites More sharing options...
W3Theory || Peter Posted August 13, 2011 Share Posted August 13, 2011 Someone posted already what the check level function should look like.. Quote Link to comment Share on other sites More sharing options...
Dominion Posted August 13, 2011 Share Posted August 13, 2011 May I ask if you're using dayo's "user level" mod? Quote Link to comment Share on other sites More sharing options...
Dominion Posted August 13, 2011 Share Posted August 13, 2011 Yes, you may. Speak :P Well I am in the room with a labrador, and asking him may be pointless. I will type if you don't mind. ;) Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 i am using a level 1,. and also i do not have an exp_needed query in my database ,.. should i insert 1,. ??,. and wat should its features include,. can someone send me the injection code if there is one ?? Quote Link to comment Share on other sites More sharing options...
W3Theory || Peter Posted August 13, 2011 Share Posted August 13, 2011 Please read through this thread, someone has already posted the script needed for the function. Quote Link to comment Share on other sites More sharing options...
snaketooth22 Posted August 13, 2011 Author Share Posted August 13, 2011 and far as i know dayo's mod is not in use,. 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.