-
Posts
423 -
Joined
-
Last visited
-
Days Won
39
Content Type
Profiles
Forums
Events
Everything posted by Canjucks
-
Re: V2 Code Help cheers for that
-
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 "); }
-
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"); }
-
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
-
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.
-
Re: Gym Help Please thanx nyna didnt see your post
-
Re: Gym Help Please gonna have a crack at it in a few minutes will let you know.
-
Re: Gym Help Please thats the funny part because i used the copy paste and no re-typing. thanx for your help though
-
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?
-
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.
-
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 :)
-
Re: Gym Help Please I take it no one knows the answer(s)! too elementry for you all? lol
-
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.
-
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
-
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?
-
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
-
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?
-
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(); ?>
-
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.
-
Re: [mccode] Mining mod Problem: I have bottomheader.jpg and when it shows on the index page and when your ming, but when you hit trouble like not enough power the bottomheader.jpg doesnt show and it stuffs my design up. I have figured out that i need this line $h->endpage(); but not entirely sure exactly where i should put it Please help with my issue. I have figured out most problems doing these but this one is annoying me
-
Re: [mccode v2] Staff Applications Answered my question. trial and error and a little persisitance <td> <textarea name=about maxlength=75 wrap=physical cols=60 rows=5 onKeyDown='textCounter(this.form.about,this.form.remLen,75);' onKeyUp='textCounter(this.form.about,this.form.remLen,75);'></textarea> changed where it says cols=60 from cols=75 done the trick love the mod its fantastic
-
Re: [mccode v2] Staff Applications i know its a dumb questio but still gonna ask. I am having a trouble changing the width of the table to fit into my screen. I have changed the 80% to a lesser amount and doesnt seem to want to change. I need to change it so it fits in the screen for width=200 about. Would love someone to help me here (i am getting back into programming and some things are forgotten and some things i have to re-learn) <form action='StaffApps.php' method='post'> <input type=hidden value='$userid' name='ID'> <table width=80% border=1 class=h> <tr> <th colspan=2>Application Form.</th></tr> <tr> <td>Position: </td> <td> <select name='staff' type='dropdown'> <option value='2'>Admin <option value='3'>Secretary <option value='5'>Assistant </select> </td> </tr>
-
Re: [mccode v2] Ian's Investments I like this mod and has gone straight into my game which is working really well. cheers.
-
Re: View pages while in jail or hosp I just fixed this up in my game. One line needs to be added and its so cool cause im only new to PHP...lol realise this is an old post but might help someone else down the track 8-) if($ir['hospital']) { print "<font color='black'>Hospital ($hc) <font color='black'>Inventory "; } elseif($ir['jail']) { print "<font color='black'>Jail ($jc) <font color='black'>Inventory "; }