Jump to content
MakeWebGames

Canjucks

Members
  • Posts

    423
  • Joined

  • Last visited

  • Days Won

    39

Everything posted by Canjucks

  1. Re: Gym Help Please if someone can help me get this the way I want I will offer a cash reward for doing so.....if anyone is interested in making some quick cash (in terms of it only being a couple of lines of code and not the whole mod) then please pm me your interest.
  2. Re: Sql Help thank you for the help. What I ended up doing was making a new field and making this a primary key with auto increments. And then in the first query instead of sorting by court ID i sorted by court KEY (primary key) and this seems to have worked.   But will give your suggestion a go Alabama just because you took the time to try and help me out :)
  3. Re: Sql Help I do appreciate your help but this is the error i get: Fatal error: Call to undefined method database::fetch_array() on line 15 any ideas?
  4. I want to display all fields from the court table. What is doing is displaying a user but it isn't the last user to go through the courts. I have played around with the sql as far as I can go. I have had some interesting results but only ever one field. It is the last thing I need to get working and as many issues I have had are fixed. Please help me with some suggestions as I truly have run outof ideas for the minute :) Here's the annoying code: $q=$db->query("SELECT * FROM court WHERE courtVERDICT>0 ORDER BY courtID DESC"); while($case=$db->fetch_row($q)) { $q=$db->query("SELECT * FROM users WHERE userid={$case['courtID']}"); $user=$db->fetch_row($q); if($case['courtVERDICT'] == 1) { $outcome="Not Guilty"; } if($case['courtVERDICT'] == 2) { $outcome="Guilty"; } echo "<tr> <td>{$user['username']} [{$user['userid']}]</td> <td>{$case['courtREASON']}</td> <td>$outcome</td> <td>{$case['courtVDAYS']}</td> </tr>"; } echo "</table>";
  5. Re: [MOD] V2 Freeze & Reactivate a Users Bank Account nice mod +1 will have to get around to adding this and testing it out!
  6. Re: Gym Help Please Would this be a better way around it by adding a percentage to multiply by column in the table that refers to table and then it would liook something like this rather than a messy if statement. Find users 'Maxwill' from table Find house 'Percentage' from table While Will > 0 Will = maxwill*percentage Until Will = 0; I would hope that would have the same effect as what I am having now but also having the desired result of continuing until it hits 0.
  7. Re: V2 Code Help cheers for that
  8. Re: V2 Code Help lol i did it. What a lamo!!! What I did was went to the street code looked at what that was for hospital and changed the reasons and gave it a test. So if anyone else has the same issue, have a look at your codes like this one: if ($ir['hp'] <= 0) { $hosptime=(int) rand(1,20); $loseruser = $ir['userid']; $reasonhosp = 'Over cooking it.'; $db->query("UPDATE users SET hospital=$hosptime WHERE userid=$loseruser",$c); $db->query("UPDATE users SET hospreason='$reasonhosp' WHERE userid=$loseruser",$c); event_add($ir['userid'],"Did you have a good time doing it!",$c); die ("WOW, you know how to go too far!! Your off to the hospital for $hosptime "); }
  9. Hey, I have tried a couple bits of code for this but can't seem to nail it. I even went for search on the forums and can't seem to find anything unless I am not using the right search words. What I am trying to achieve is that I have an item and it increases energy and decreases health each time you use it. What happens is that when you hit 0 energy, you can keep using the item to your hearts content without fear of going to hospital. What I am after is the three/four lines of code that will send the user to hospital when the enrgy hits 0. I would have thought the code would look something like this and please correct where i am wrong If ($ir['hp'] <= 0) { $hosptime=rand(5,20); die(" You have over done it and need to spend some time in hospital"); $db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='over cooking it' WHERE userid=$userid"); }
  10. Re: Gym Help Please thats the reason for the post, if it continued to reduce the Will by the set amount. I have tried an else if and it reads it and reduces it but only once, that is why I am asking for help to get a loop until Will = 0
  11. Re: Gym Help Please Thanks for you help floydian i appreciate it greatly but it made very little difference to what was happening in Will you lose. This is the code I have been playing around with to get the reduced Will I want for each level of maxwill. if($ir['maxwill'] >= 100) { $ir['will']=$ir['maxwill']*0.01; } if($ir['maxwill'] >= 125) { $ir['will']=$ir['maxwill']*0.03; } if($ir['maxwill'] >= 200) { $ir['will']=$ir['maxwill']*0.05; } if($ir['maxwill'] >= 300) { $ir['will']=$ir['maxwill']*0.09; } if($ir['maxwill'] >= 400) { $ir['will']=$ir['maxwill']*0.12; } if($ir['maxwill'] >= 500) { $ir['will']=$ir['maxwill']*0.16; } if($ir['maxwill'] >= 600) { $ir['will']=$ir['maxwill']*0.19; } if($ir['maxwill'] >= 700) { $ir['will']=$ir['maxwill']*0.23; } if($ir['maxwill'] >= 700) { $ir['will']=$ir['maxwill']*0.26; } if($ir['maxwill'] >= 800) { $ir['will']=$ir['maxwill']*0.29; } if($ir['maxwill'] >= 900) { $ir['will']=$ir['maxwill']*0.33; } if($ir['maxwill'] >= 1000) { $ir['will']=$ir['maxwill']*0.36; } if($ir['maxwill'] >= 1100) { $ir['will']=$ir['maxwill']*0.39; } if($ir['maxwill'] >= 1200) { $ir['will']=$ir['maxwill']*0.43; } if($ir['maxwill'] >= 1300) { $ir['will']=$ir['maxwill']*0.45; } if($ir['maxwill'] >= 1400) { $ir['will']=$ir['maxwill']*0.47; } if($ir['maxwill'] >= 1500) { $ir['will']=$ir['maxwill']*0.49; } if($ir['maxwill'] >= 2000) { $ir['will']=$ir['maxwill']*0.53; } if($ir['maxwill'] >= 2500) { $ir['will']=$ir['maxwill']*0.57; } if($ir['maxwill'] >= 3000) { $ir['will']=$ir['maxwill']*0.61; } if($ir['maxwill'] >= 3500) { $ir['will']=$ir['maxwill']*0.65; } if($ir['maxwill'] >= 4000) { $ir['will']=$ir['maxwill']*0.68; } if($ir['maxwill'] >= 4500) { $ir['will']=$ir['maxwill']*0.71; } if($ir['maxwill'] >= 5000) { $ir['will']=$ir['maxwill']*0.74; } if($ir['maxwill'] >= 5500) { $ir['will']=$ir['maxwill']*0.77; } if($ir['maxwill'] >= 6000) { $ir['will']=$ir['maxwill']*0.80; } if($ir['maxwill'] >= 6500) { $ir['will']=$ir['maxwill']*0.83; } if($ir['maxwill'] >= 7000) { $ir['will']=$ir['maxwill']*0.85; } if($ir['maxwill'] >= 7500) { $ir['will']=$ir['maxwill']*0.87; } if($ir['maxwill'] >= 8000) { $ir['will']=$ir['maxwill']*0.89; } if($ir['maxwill'] >= 10000) { $ir['will']=$ir['maxwill']*0.94; } if($ir['maxwill'] >= 15000) { $ir['will']=$ir['maxwill']*0.97; } }   What it is doing is finding the correct the maxwill for the player but when you gym again it just stays at that value and doesn't continue to divide by x amount until Will=0. It might be the long way (and ugly) around things but it works initially so I like that part.
  12. Re: Gym Help Please thanx nyna didnt see your post
  13. Re: Gym Help Please gonna have a crack at it in a few minutes will let you know.
  14. Re: Gym Help Please thats the funny part because i used the copy paste and no re-typing. thanx for your help though
  15. Re: Gym Help Please That looks real cool but I have added it. and does help except I added the fnction to my global_func.php and i get a error Fatal error: Call to undefined function to_percent() in /home/piratesn/public_html/global_func.php. I did put in the right file?
  16. Re: Gym Help Please I want to control the Will lost. This is why I am making it specific to the Maxwill of a player. So instead of losing between 1 and 3 percent, I want them to lose a value according to the Maxwill, which will depend on the house they have purchased which of course will range in my games instance between 100 and 15000. I want to make it more attractive to have the most expensive house by being able to gain more but lose less Will. You have cleared up one point for me about what the $ir does and this will help me I believe. My past programming days all those years ago is telling me that I should be able to use that information. I actually missed it when I was looking at it for so long trying to work things out.
  17. Re: Gym Help Please How do I get this if statement to continue to reduce the will by 0.49? I have tried doing an else and all it does is reduce the 49 to 24 and then stops reducing it further to hit 0 which I would want it to do. if($ir['maxwill'] >= 1500) { $ir['will']=$ir['maxwill']*0.49; } -> gets the desired result of reducing the Will I If Maxwill >= 1500 Then Will=Maxwill*0.49 While Maxwill >= 1500 and Will >=0 Do Will=Will*0.49 ->something like that Can someone give me some insight? another angel perhaps, please :)
  18. Re: Gym Help Please I take it no one knows the answer(s)! too elementry for you all? lol
  19. Hi, this has been bugging me that I cannot find a solution without firstly understanding 100% (I am about 65% of the way there but assistance on this is needed to help me the rest of the way :)) I need to better understand what the formula does when calculating Will lost training at the gym.   $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { $gain+=rand(1,3)/rand(800,1200)*rand(800,1200)*(($ir['will']+20)/350); $ir['will']-=rand(1,3); if($ir['will'] < 0) { $ir['will']=0; } $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `exp` = {$ir['exp']} + {$_POST['amnt']} * {$ir['maxwill']} / 350 WHERE `userid` = $userid");   What is happening is that, if you have max will at 8000 you will only lose say 10% of that when the maximum Will (available in the game) is 15000 and you lose 2% which is good, probably would rather that at 4%. I have tested this on a range of levels and it works on the higher levels and not the lower levels (up to level 20 no way as well it should but on higher than 30 its almost perfect as in the Will lost will be about what my expectation would be) Questions: Am I better to make a string so that if your Will = 100 then Will=Will*95% else Will = 200 then Will=Will*92% etc? Then I will not so much have this issue? or could someone please take the time to explain the formula so that this happens without the big ass if statement? or is it possible? I have been reading through contagiously the posts to do with Gym and haven't found an answer that will help me the rest of the way. I have an idea though. It is funny because I have figured out majority of the other bugs on my own but this one is just out of reach. Please help.
  20. Re: Add or Edit new item error its all good I found a solution with a similar topic and gave me the solution and now all works fine http://criminalexistence.com/ceforums/i ... pic=3008.0 can be found on this link. Cheers to you all for helping us out :-D
  21. Re: Add or Edit new item error Tonka, what happened was an item was being edited, was working fine and have not been aware of any new columns being created. Edited this item, that error appears on finish. Edit another item, same error. Create an item, same error. and so on. Do not know how it happened but it has. I am guessing from what you guys are saying is find the column that is not needed and delete it yes? and this will make our problem go away?
  22. Re: [mccode v2] Mine Shaft I would like to make this similar to the mine mod in that it is in reverse and have the crystals first from level 1 and not have the turn base
  23. Re: [mccode v2] Battletent Fix How do I make it so when you defeat the bot you have a button (mug, hospitalize, leave) that it has a Battle Tent Win button? and only shows when the bots are listed in battle tent?
  24. Re: [mccode] Mining mod before as below   <?php include "globals.php"; switch($_GET['action']) { case 'mine': mine_1(); break; case 'minesub': mine_1_sub(); break; case 'mine2': mine_2(); break; case 'mine2sub': mine_2_sub(); break; case 'mine3': mine_3(); break; case 'mine3sub': mine_3_sub(); break; case 'mine4': mine_4(); break; case 'mine4sub': mine_4_sub(); break; case 'mine5': mine_5(); break; case 'mine5sub': mine_6_sub(); break; case 'mine6': mine_6(); break; case 'mine6sub': mine_6_sub(); break; default: mine_index(); break; } function mine_index() { global $ir,$c,$userid,$db; print "<center>Welcome to the mine shaft. There are 3 spots to go mining but thay are restricted depending on your mine level. Your mining level is {$ir['mine_level']} and you have {$ir['mine_exp']}/{$ir['mine_needed']} mining experience </center>"; print "<center> <u>Crystal Mines</u> [[url='mine.php?action=mine']Level 1 mine[/url]] [[url='mine.php?action=mine2']Level 20 mine[/url]] [[url='mine.php?action=mine3']Level 40 mine[/url]] <u>Money Mines</u> [[url='mine.php?action=mine4']Level 10 mine[/url]] [[url='mine.php?action=mine5']Level 30 mine[/url]] [[url='mine.php?action=mine6']Level 40 mine[/url]] </center>"; } $db->query("UPDATE users SET max_power=mine_level*10 WHERE userid=$userid",$c); $db->query("UPDATE users SET mine_level=mine_level+1 WHERE mine_exp > mine_needed AND userid=$userid",$c); $db->query("UPDATE users SET mine_exp=0 WHERE mine_needed < mine_exp AND userid=$userid",$c); $db->query("UPDATE users SET mine_needed=mine_level*1000 WHERE userid=$userid",$c); if ($ir['jailtime'] > 0){ print "<center>The mine is closed to jail birds come back when thay release you</center>"; exit; } if ($ir['hospital'] > 0){ print "<center>You cant go mining while in hospital</center>"; exit; } function mine_1() { global $ir,$c,$userid,$db; if($ir['power'] < 10){ print "You need 10 power to mine here your have {$ir['power']}"; exit; } $db->query("UPDATE users SET power=power-10 WHERE userid=$userid",$c); $rand_gems = rand(1,5); $rand_exp = rand(1,100); echo "<center>You begin mining in the level 1 mine and found $rand_gems crystal(s).</center> "; $db->query("UPDATE users SET crystals=crystals+'$rand_gems',mine_exp=mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } function mine_2() { global $ir,$c,$userid,$db; if($ir['power'] < 15){ print "<center>You need 15 power to mine here your have {$ir['power']}</center>"; exit; } if($ir['mine_level'] < 20){ print "<center>You need to be mining level 20 to mine here you are mining level {$ir['mine_level']}</center>"; exit; } $db->query("UPDATE users SET power=power-15 WHERE userid=$userid",$c); $rand_gems = rand(1,20); $rand_exp = rand(1,300); echo "<center>You begin mining in the level 20 mine and found $rand_gems crystal(s).</center> "; $db->query("UPDATE users SET crystals=crystals+'$rand_gems',mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine2']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } function mine_3() { global $ir,$c,$userid,$db; if($ir['power'] < 25){ print "<center>You need 25 power to mine here your have {$ir['power']}</center>"; exit; } if($ir['mine_level'] < 40){ print "<center>You need to be mining level 40 to mine here you are mining level {$ir['mine_level']}</center>"; exit; } $db->query("UPDATE users SET power=power-25 WHERE userid=$userid",$c); $rand_gems = rand(1,40); $rand_exp = rand(1,600); echo "<center>You begin mining in the level 40 mine and found $rand_gems crystal(s).</center> "; $db->query("UPDATE users SET crystals=crystals+'$rand_gems',mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine3']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } function mine_4() { global $ir,$c,$userid,$db; if($ir['power'] < 10){ print "You need 10 power to mine here your have {$ir['power']}"; exit; } if($ir['mine_level'] < 10){ print "<center>You need to be mining level 10 to mine here you are mining level {$ir['mine_level']}</center>"; exit; } $db->query("UPDATE users SET power=power-10 WHERE userid=$userid",$c); $rand_money = rand(1,1000); $rand_exp = rand(1,100); echo "<center>You begin mining in the level 10 mine and found $$rand_money .</center> "; $db->query("UPDATE users SET money=money+'$rand_money',mine_exp=mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine4']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } function mine_5() { global $ir,$c,$userid,$db; if($ir['power'] < 15){ print "<center>You need 15 power to mine here you have {$ir['power']}</center>"; exit; } if($ir['mine_level'] < 30){ print "<center>You need to be mining level 30 to mine here you are mining level {$ir['mine_level']}</center>"; exit; } $db->query("UPDATE users SET power=power-15 WHERE userid=$userid",$c); $rand_money = rand(1,3000); $rand_exp = rand(1,300); echo "<center>You begin mining in the level 30 mine and found $$rand_money .</center> "; $db->query("UPDATE users SET money=money+'$rand_money',mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine5']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } function mine_6() { global $ir,$c,$userid,$db; if($ir['power'] < 25){ print "<center>You need 25 power to mine here your have {$ir['power']}</center>"; exit; } if($ir['mine_level'] < 40){ print "<center>You need to be mining level 40 to mine here you are mining level {$ir['mine_level']}</center>"; exit; } $db->query("UPDATE users SET power=power-25 WHERE userid=$userid",$c); $rand_money = rand(1,8000); $rand_exp = rand(1,600); echo "<center>You begin mining in the level 40 mine and found $$rand_money .</center> "; $db->query("UPDATE users SET money=money+'$rand_money',mine_exp+'$rand_exp' WHERE userid=$userid",$c); print "<center>[[url='mine.php?action=mine6']Mine again[/url]]</center> "; print "<center>[[url='mine.php']Back[/url]]</center> "; } $h->endpage(); ?>
  25. Re: [mccode] Mining mod Simple answer i know and have that in, but doesn't work on all pages the bottomheader.jpg. I have attempted to mod it inbetween things but doesn't seem to make a difference.
×
×
  • Create New...