battle points error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    battle points error

    i want to increase battle points from 100 to 500 but it doesnt increases.it remains 100 only after updating battle points.it also show that battle points updated successfully but they not increasing. anybody please help me in this error

    PHP Code:
    //////////////////////////////////////////Give GPs
    else if($action=="batp")
    {
        
    addonline(getuid_sid($sid),"Giving Game Plusses","");
        
    $who $_GET["who"];
        
    $ptg $_POST["ptbp"];
        
    $giv $_POST["giv"];
          echo 
    "<head>";
          echo 
    "<title>$sitename</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";
          echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      
    //$uid = getuid_sid($sid);
      
    $judg mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'"));
      
    $gpst mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'"));
      if(
    ismod(getuid_sid($sid))||$judg[0]>0)
      {
        if (
    $giv=="1")
        {
            
    $gpst $gpst[0]+$ptg;
        }else{
            
    $gpst $gpst[0]-$ptg;
            if(
    $gpst<0)$gpst=0;
        }
        
    $res mysql_query("UPDATE ibwf_users SET battlep='".$gpst."' WHERE id='".$who."'");
      if(
    $res)
            {
              
    $vnick getnick_uid($who);
              if (
    $giv=="1")
              {
                
    $ms1 " Added $ptg points to ";
              }else{
                
    $ms1 " removed $ptg points from ";
              }

              
    mysql_query("INSERT INTO ibwf_mlog SET action='bpoints', details='<b>".getnick_uid(getuid_sid($sid))."</b> $ms1  $vnick', actdt='".time()."'");
                echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>Battle Points Updated Successfully<br/>";
            }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
            }
          }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't do this<br/>";
            }

            echo 
    "<br/>";

    echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo 
    "</p>";
      echo 
    "</body>";


    #2
    PHP Code:
    //////////////////////////////////////////Give GPs
    else if($action=="givegp")
    {
        
    addonline(getuid_sid($sid),"Giving Game Plusses","");
        
    $who $_GET["who"];
        
    $ptg $_POST["ptg"];
        echo 
    "<p align=\"center\">";
      
    //$uid = getuid_sid($sid);
      
    $gpsf mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
      
    $gpst mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$who."'"));
      if(
    $gpsf[0]>=$ptg){
        
    $gpsf $gpsf[0]-$ptg;
        
    $gpst $gpst[0]+$ptg;
        
    $res mysql_query("UPDATE ibwf_users SET gplus='".$gpst."' WHERE id='".$who."'");
      if(
    $res)
            {
              
    $res mysql_query("UPDATE ibwf_users SET gplus='".$gpsf."' WHERE id='".$uid."'");
                echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>Game Plusses Updated Successfully<br/>";
            }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
            }
          }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You don't have enough GPs to give<br/>";
            }

            echo 
    "<br/>";
      
         echo 
    "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a>";
    echo 
    "</p>";
      echo 
    "</body>"
    its from another script, havent tested it though.. just edit or check the tables to match yours.

    sorry, u need to change $gpsf to battle judges and also the table
    Last edited by capofret; 12.05.09, 14:23. Reason: add
    LDSWAPWORLD sigpic
    site closed.
    im busy with other things in life like facebook , send me PM so i can add you
    www.pinoySG.com

    don't ask for help if you're not even helping yourself!
    i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.


    Comment


      #3
      the coding which u given is for game plusess.

      i need battle points.


      anybody please help me.

      my battle points doesnt updating

      Comment


        #4
        try this
        $gpst[0] = $gpst[0]+$ptg;
        }else{
        $gpst[0] = $gpst[0]-$ptg;
        if($gpst[0]<0)$gpst[0]=0;

        Comment


          #5
          i tried as u said but it not working.

          the battle points showing 0 in profile now

          Comment


            #6
            Originally posted by godzilla View Post
            i tried as u said but it not working.

            the battle points showing 0 in profile now
            then try another variable instead of
            $gpst
            because you assigned it as an array variable in this query
            PHP Code:
            $gpst mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'")); 
            maybe it will work

            Comment


              #7
              Originally posted by godzilla View Post
              the coding which u given is for game plusess.

              i need battle points.


              anybody please help me.

              my battle points doesnt updating
              I know, but u just have to edit.. to change gamepluses to battlepoints. Just edit the function and ur mysql query. But the idea is the same so there should be no problem.
              LDSWAPWORLD sigpic
              site closed.
              im busy with other things in life like facebook , send me PM so i can add you
              www.pinoySG.com

              don't ask for help if you're not even helping yourself!
              i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.


              Comment

              Working...
              X