battle points error

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

6 replies · 384 views · started 17 years ago · 1 min read

3 participants
godzilla Developer · 119 posts #1

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

//////////////////////////////////////////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&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
  echo "</body>";
}
capofret Developer · 225 posts #2
//////////////////////////////////////////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&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

LDSWAPWORLD 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.

External image (may be gone)

godzilla Developer · 119 posts #3

the coding which u given is for game plusess.

i need battle points.

anybody please help me.

my battle points doesnt updating

Anshul Senior · 296 posts #4

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

godzilla Developer · 119 posts #5

i tried as u said but it not working.

the battle points showing 0 in profile now

Anshul Senior · 296 posts #6

godzilla wrote: 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

$gpst = mysql_fetch_array(mysql_query("SELECT battlep FROM ibwf_users WHERE id='".$who."'"));

maybe it will work

capofret Developer · 225 posts #7

godzilla wrote: 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 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.

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close