Jump to content

LOUDMOUTH

Members
  • Posts

    77
  • Joined

  • Last visited

    Never

Everything posted by LOUDMOUTH

  1. Fatal error: Using $this when not in object context in /index.php on line 44
  2. I tried echo 'EXP: '.($this->exp - experience($this->level)).' / '.experience($this->level+1); I got a syntax error
  3. Using this I was able to get the EXP to set 495 exp per level function experience($L) { return $L * 495; } function Get_The_Level($exp) { return floor($exp / 495) + 1; } This echo is returning 0/495 EXP at all times now, echo 'EXP: '.($exp - experience($L)).' / '.experience($L+1); I just need their total exp subtracted from the exp they have. If I can get the echo to work properly I think we have got it, any suggestions?
  4. I made a sample for you here http://pledgeresistance.com/expguidesample.html But as you can see in the sample it kinda gets messy when you get close to 500, I was thinking if the system was Infinite then there would be no need to make the higher levels such a great amount of exp, what do you think?
  5. I am looking for something along these lines Level/Exp 1=494 2=988 3=1,482 4=1,976 5=2,471 6=2,965 7=3,459 8=3,953 9=4,447
  6. Yes I need a logarithmically based EXP system. Like you said Daniel, It would be nice to have the players gradually have to gain more exp as the Level # gets higher. Math isnt my strong point, so any input you may have would help a ton right now I have a Classes.php that has the first codes I posted here. Then I have it echo the EXP in the Index.php here is everything I have in the classes.php page that has to do with the EXP. If I can get that behaving properly then echo is cake. function experience($L) { $a=0; $end=0; for($x=1; $x<$L; $x++) { $a += floor($x+1500*pow(4, ($x/7))); } return floor($a/4); } function Get_The_Level($exp) { $a=0; $end =0; for($x=1; ($end==0 && $x<100); $x++) { $a += floor($x+1500*pow(4, ($x/7))); if ($exp >= floor($a/4)){ } else { return $x; $end=1; } } } function Get_Max_Exp($L){ $end=0; if ($exp == 0){ return 457; $end =1; } for($L=1;($L<100 && $end==0);$L++) { $exp = experience($L); //echo $exp; if ($exp >= $user_class->exp){ return $exp; $end=1; } } } Then further down the page is this $this->exp = $worked['exp']; $this->level = Get_The_Level($this->exp); $this->maxexp = experience($this->level +1); $this->exppercent = ($this->exp == 0) ? 0 : floor(($this->exp / $this->maxexp) * 100); $this->formattedexp = $this->exp." / ".$this->maxexp." [".$this->exppercent."%]"; <td width='35%'><?php echo $user_class->formattedexp; ?></td>
  7. Also this is in the same file as the EXP code $this->exp = $worked['exp']; $this->level = Get_The_Level($this->exp); $this->maxexp = experience($this->level +1); $this->exppercent = ($this->exp == 0) ? 0 : floor(($this->exp / $this->maxexp) * 100); $this->formattedexp = $this->exp." / ".$this->maxexp." [".$this->exppercent."%]";
  8. This echo 'EXP: '.($exp - experience($L)).' / '.experience($L+1); is showing 0/495 for every level now
  9. Thanks for the help. When I get to level 2 I still have the exp from the prior level towards the next level though. this is what It shows right after I got to level 2 EXP: 500 / 1485 [33%] How can I make it EXP: 0/1485 [0%] when you get to level 2
  10. I have this code for a EXP system in a game. The way it is right now it is gaining exp to fast per level. So by the time you get to level 40 the exp is far too great. I am looking for some help with a correct Algorithm to match this Ratio. I have tried changing the $a += floor($x+1500*pow(4, ($x/7))); many times to different equations and have no luck so far at solving this. Anyone have any suggestions? I want level 1 to start off with 450 exp, and per level, increase by around 450. with no max EXP The below code equals this ratio //level 2 - 500 //level 3 - 1500 //level 4 - 3500 //level 5 - 6000 I am looking for this ratio //level 2 - 988 //level 3 - 1482 //level 4 - 1976 //level 5 - 2471 function experience($L) { $a=0; $end=0; for($x=1; $x<$L; $x++) { $a += floor($x+1500*pow(4, ($x/7))); } return floor($a/4); } function Get_The_Level($exp) { $a=0; $end =0; for($x=1; ($end==0 && $x<100); $x++) { $a += floor($x+1500*pow(4, ($x/7))); if ($exp >= floor($a/4)){ } else { return $x; $end=1; } } } function Get_Max_Exp($L){ $end=0; if ($exp == 0){ return 457; $end =1; } for($L=1;($L<100 && $end==0);$L++) { $exp = experience($L); //echo $exp; if ($exp >= $user_class->exp){ return $exp; $end=1; } } }
  11. To monitor your running scripts I would check out Hobbit http://hobbitmon.sourceforge.net/ This will let you rest easy while you have your stuff running. "nohup" and "screen" also check out http://www.felixgers.de/teaching/internet/nohup.html I would start the process with Crons then KILL process with something like this <?php $time = time(); .... while($data){ if((time()-$time) > 1400) exit; //do some processing } That will run it for 4 hours after crons starts it then KILL it.
  12. Then I would set cronjob to run once and then make the looping script only LOOP or REFRESH the number of times you are looking for. I assume its a script you want to run while you sleep and then stop once you are back at your machine?
  13. well you can set crons to run once per minute, hour, day, month, year. So if you setup your Cronjobs correctly then you would only need to start it once, then can let it loop. then disable your cron job later if need be. Hope this helps.
  14. How do I ask for % of $money I want it to show me that $exp is only 50% of $money $money = (25 * $nerve) + 15 * ($nerve - 1); $exp = $money;
  15. Using <a href="index.php?username=myname">Click here to activate your account</a> will only send the person to root directory URL's if they have a browser open and are visiting a site I think.
  16. What did you have in mind as far as site structure goes? I always start with mental image of the finished product, then start building dir and naming everything.
  17. I am trying to get some info to display on a site http://boredasitgets.awardspace.biz/ When I use this, it wont display the info on the page. Can anyone help me make this right :S This is what we have now, not working. { $news_id = intval($_GET['news_id']); $total_results = mysql_result(mysql_query("SELECT COUNT as Num FROM ava_news WHERE id='".$cat_id."'"),0); if ($total_results <= 0) { echo 'This table does not exist'; }
  18. That worked perfectly Thank you guys!
  19. Here is the View message page, where would I add the nl2br code? <? include 'header.php'; ?> <tr><td class="contenthead">Mailbox</td></tr> <tr><td class="contentcontent"> <table width='100%'> <? $result = mysql_query("SELECT * from `pms` WHERE `id`='".$_GET['id']."'"); $row = mysql_fetch_array($result); $from_user_class = new User($row['from']); if ($_GET['id'] != ""){ if (strtoupper($row['to']) == strtoupper($user_class->username)) { echo " <tr> <td width='15%'>Subject:</td> <td width='45%'>".$row['subject']."</td> <td width='15%'>Sender:</td> <td width='25%'>".$from_user_class->formattedname."</td> </tr> <tr> <td>Recieved:</td> <td colspan='3'>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$row['timesent'])."</td> </tr> <tr> <td colspan='3' class='textm'><b>Message</b>:<br><br>".wordwrap($row['msgtext'], 100, "\n", 1)." </td> </tr> <tr> <td colspan='4' align='center'><a href='pms.php?delete=".$row['id']."'>Delete</a> | <a href='pms.php?reply=".$row['id']."'>Reply</a></td> </tr> <tr> <td colspan='4' align='center'><a href='pms.php'>Back To Mailbox</a></td> </tr> "; $result2 = mysql_query("UPDATE `pms` SET `viewed` = '2' WHERE `id`='".$row['id']."'"); } } ?> </table> </td></tr> <? include 'footer.php'; ?>
  20. Here is what I mean. in the first image it shows you the dashes it enters into the text area. in the second is the view of a reply and as you can see it enters those dashes, i just want it to be a blank space in between the message and reply
  21. same thing with \n\n still puts any <code> into the text area :s
  22. It just inserts <br><br> into the message text area <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? "<br><br>".$worked2['msgtext'] : ""; ?></textarea></td>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.