Jump to content

Iank1968

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Posts posted by Iank1968

  1. All I want it to do is take this line

     

    $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 + mysql_result ($result, $i, "ch_bonus") * 12 + mysql_result ($result, $i, "bd_bonus") * 12 + mysql_result ($result, $i, "rod_bonus") * 12 + mysql_result ($result, $i, "coin_bonus") * 16 + mysql_result ($result, $i, "bill_bonus") * 16 + mysql_result ($result, $i, "chr_bonus") * 50 + mysql_result ($result, $i, "val_bonus") * 25 + mysql_result ($result, $i, "gem_bonus") * 20 + mysql_result ($result, $i, "metal_bonus") * 20;

     

    add all that together for each player and display it on the main page

  2. this code is supose to add everything together and display it on a feed but it doesnt add past the 25 bonus.

     

    heres the code

     

    function GetLoginStories ($user) {
      global $bonus_table;
      
      if (!is_numeric ($user))
        return;
        
      $bonus = array ();
      $bonus["bonus"] = array ();
      $result = Query ("SELECT unix_timestamp(date) as date,reg_add,lj_bonus,ic_bonus,hu_bonus,rod_bonus,chr_bonus,val_bonus,bug_bonus,camp_bonus,ch_bonus,coin_bonus,bill_bonus,bd_bonus,bb_bonus,cookie_bonus,metal_bonus,gem_bonus FROM $bonus_table WHERE uid=$user");
      
      $num = mysql_num_rows ($result);
      
      for ($i=0; $i<$num; $i++) {
        $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 + mysql_result ($result, $i, "ch_bonus") * 12 + mysql_result ($result, $i, "bd_bonus") * 12 + mysql_result ($result, $i, "rod_bonus") * 12 + mysql_result ($result, $i, "coin_bonus") * 16 + mysql_result ($result, $i, "bill_bonus") * 16 + mysql_result ($result, $i, "chr_bonus") * 50 + mysql_result ($result, $i, "val_bonus") * 25 + mysql_result ($result, $i, "gem_bonus") * 20 + mysql_result ($result, $i, "metal_bonus") * 20;
        //$bonus_amt=5;
        $bonus["bonus"][$i] = array (mysql_result ($result, $i, "date"), "<fb:name uid=\"$user\" /> received $bonus_amt Extremebucks on logon!");
      }

     

    can anyone help me as to why its not adding past the $bonus_amt = 25 + mysql_result ($result, $i, "reg_add")

     

    thanks

  3. I wasnt sure where this belonged, so I thought I would ask here first.

     

    Here is some code that adds log ins, but the amount of logins and the amount it displays are always different.

     

    function GetLoginStories ($user) {
      global $bonus_table;
      
      if (!is_numeric ($user))
        return;
        
      $bonus = array ();
      $bonus["bonus"] = array ();
      $result = Query ("SELECT unix_timestamp(date) as date,reg_add,lj_bonus,ic_bonus,hu_bonus,rod_bonus,chr_bonus,val_bonus,bug_bonus,camp_bonus,ch_bonus,coin_bonus,bill_bonus,bd_bonus,bb_bonus,cookie_bonus,metal_bonus,gem_bonus FROM $bonus_table WHERE uid=$user");
      
      $num = mysql_num_rows ($result);
      
      for ($i=0; $i<$num; $i++) {
        $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 + mysql_result ($result, $i, "ch_bonus") * 12 + mysql_result ($result, $i, "bd_bonus") * 12 + mysql_result ($result, $i, "rod_bonus") * 12 + mysql_result ($result, $i, "coin_bonus") * 16 + mysql_result ($result, $i, "bill_bonus") * 16 + mysql_result ($result, $i, "chr_bonus") * 50 + mysql_result ($result, $i, "val_bonus") * 25 + mysql_result ($result, $i, "gem_bonus") * 20 + mysql_result ($result, $i, "metal_bonus") * 20;
        //$bonus_amt=5;
        $bonus["bonus"][$i] = array (mysql_result ($result, $i, "date"), "<fb:name uid=\"$user\" /> received $bonus_amt Extremebucks on logon!");
      }
    

     

    hope you can help with this

     

    thanks

  4. wel the code Iam using is a game, and when several people play it at the sametime my server goes nuts and crashes. server goes from 2 to 13 and crashes. most of it isnt my code and the guy who wrote the code isnt around anymore. Its probably way to mush to ask someone to actually go threw it and recommend ways to streamline it and find where the loops is thats causing the crashes, if thats what it is. I was told that splitting the file puts less strain on the server, but I wanted to ask here about that claim.

  5. no this script was written by someone else who I cannot get ahold of now. its the only problem im having with this script. I thought it would be an easy solution, boy was I wrong lol. Let me get the rest of the code and post that. Hopefully it will be an easy solution.

  6. I am new to PHP so please forgive me. I assume the static updates updates the players profile every 5 seconds to receive login credits which they only get every 3 hours. I did bump it up to 200 and everything is running ok.

     

    When several people where on and playing the app crashed, it hasnt done that since I bumped it to 200. What I want to know is can I get rid of it? is it a nessesary function?

     

    again please forgive me if im not making a whole lot of sense lol

  7. here is the code

    $credit_time = 3*60*60; // how often should we give logon credits (secs)
    $credit_amount = 2500; // the number of cents we give if they logon after that interval
    $static_update = 300; // updates every 5 seconds
    

     

    the updates every 5 seconds, would that bog down the server and cause a major bottleneck? can I get rid of it?

     

    Thanks

  8. I created a login program, for a game, but instead of counting it every 3 hours, it counts it every adventure. here is the code

     

    $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 +

     

    is there anyway to shorten it I might not have enough info here, but would like to know if this can be shortened.

     

    Thanks

  9. I made a login program that allows players to get a specific log in every 3 hours, but it when a player goes on an adventure it calculates the login every single time. Can someone help me with this code please.

     

    function NewRegularInterval ($user) {
      //print "congrats 3 hour interval";
      ?>
      <fb success message="Thanks for playing, you have been given EO$ 25 for logging in." />
      <?
    
      global $users_table;
      Query ("UPDATE $users_table SET regular_intervals = regular_intervals + 1, 
                                  last_logon_credit = NOW()
                WHERE uid=$user");
    return GetRegularIntervals ($user);
    }
    
    function NewBonusInterval ($user, $num) {
      //print "congrats 3 hour interval";
      ?>
    

     

    the log in is supose to be calculated every 3 hours not every adventure lol

     

    Thanks in advance for your help

     

    Sorry about not using the [ code ] before

  10. I made a login program that allows players to get a specific log in every 3 hours, but it when a player goes on an adventure it calculates the login every single time. Can someone help me with this code please.

     

    function NewRegularInterval ($user) {

      //print "congrats 3 hour interval";

      ?>

      <fb success message="Thanks for playing, you have been given EO$ 25 for logging in." />

      <?

     

      global $users_table;

      Query ("UPDATE $users_table SET regular_intervals = regular_intervals + 1, 

                                  last_logon_credit = NOW()

                WHERE uid=$user");

    return GetRegularIntervals ($user);

    }

     

    function NewBonusInterval ($user, $num) {

      //print "congrats 3 hour interval";

      ?>

     

     

    the log in is supose to be calculated every 3 hours not every adventure lol

     

    Thanks in advance for your help

  11. I understand the using local variables is faster then Global. Here are 2 of the global function I created. Would anyone be able to tell me how to make it into a local variable, if thats the best thing to do.

     

    function Query ($q) {

      global $conn;

      $result = mysql_query ($q, $conn);

      if (!$result) {

          }

     

    and the second is

     

    function LogStealAttempt ($user_from, $user_to, $what, $amt) {

      global $logsendneg_table;

      Query ("INSERT INTO $logsendneg_table SET uid_from=$user_from, uid_to=$user_to, what='$what', amt=$amt");

     

    thanks

×
×
  • 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.