Reborn Fail Pls help me
#1

Hello Com
I have a problem and hope that you help me as I can
my player can not reborn

it always appears this message
In-game cash is only 0 but you need to 500000000 reborn . however, it is present in all enough gold

here the php scripts

<?php

session_start();

$file = 'reborn';
include "config/config.php";
include "styles/style.php";
include "core/plugin.php";
include 'core/functions.php';
include 'core/classes.php';
include 'core/post_check.php';
include "core/core.php";
$tpl->assignGlobal("page_title", "ReBorn System");
if( $User->LoggedIn == true ){
if ($S_rborn_online == "Enable"){
$Ctrl = new statpts();
$uid = $User->ID;
if( $Ctrl->isOnline( $uid ) ){


if( isset( $_POST['step'] ) && $_POST['step'] == md5('step2') ){
if( ctype_digit( $_POST['char'] ) ){
$cid = $_POST['char'];
$clevel = $_POST['level'];
$cname = $_POST['name'];
$creborns = $_POST['reborns'];


if ($clevel >= $S_rborn_level && $creborns <= $S_rborn_allow){

$Ctrl->GetGoldBalance( $cid, $row, $col, $amount );

if ($amount > $S_rborn_gold){
$dgold = $amount - $S_rborn_gold;
$query9T = sprintf("UPDATE %s.t_characters SET a_level=".$S_rborn_slevel.", a_exp=0, a_statpt_remain = (a_statpt_remain+".$S_rborn_rstats.") WHERE a_index = '".$cid."' ", $LC_Db );
$dbh9T = $con_cms_pdo->prepare( $query9T );
$dbh9T->execute();

$query10T = sprintf("UPDATE %s.t_reborn_log SET a_reborns=(a_reborns+1) WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh10T = $con_cms_pdo->prepare( $query10T );
$dbh10T->execute();

$Ctrl->DeductGold( $cid, $row, $col, $dgold );

$tpl->newBlock('success');
$tpl->Assign('msg' , "<font color='green'><font class='main_font'>The reborn was a success! ".$cname." is now reborn Smile<br/>Level ".$S_rborn_slevel." with your stat points + ".$S_rborn_rstats.", Skills not reset.<br/>".$S_rborn_gold." in-game gold has been deducted from ".$cname."</font></font>");
} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>In-game cash is only ".$amount." but you need ".$S_rborn_gold." to reborn.</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>Not met the requirements (Must be $S_rborn_level + under $S_rborn_allow reborns)</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Please select a character');
}} else {
$tpl->newBlock('reborn_char');
$tpl->Assign("rlevel", $S_rborn_level);
$tpl->Assign("rcost", $S_rborn_gold);
$tpl->Assign("rrborns", $S_rborn_allow);
$actionz = md5('step2');
$rand1 = 1;
if( $Ctrl->GetCharacters( $uid ) > 0 ){

foreach( $Ctrl->chars as $curChar ){
$rand1++;
$cid = $curChar['id'];
$cname = $curChar['name'];
$clevel = $curChar['level'];

$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = ".$cid."", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();

if($rebornT['a_reborns'] == NULL){
$rebornT = NULL;
$query8T = sprintf("INSERT INTO %s.t_reborn_log (a_index, a_reborns) VALUES ('".$cid."',0) ", $LC_CMSDb );
$dbh8T = $con_cms_pdo->prepare( $query8T );
$dbh8T->execute();
$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();
}

$tpl->Assign("listchars".$rand1, '<form method="post" id="'.$rand1.'"><tr>
<td style="text-align:center;"><input type="radio" name="char" value="'.$cid.'" onclick="this.form.submit();" /></td>
<td style="text-align:center;"><input type="hidden" name="name" value="'.$cname.'" /><font color="#927D61">'.$cname.'</font></td>
<td style="text-align:center;"><input type="hidden" name="level" value="'.$clevel.'" /><font color="#927D61">'.$clevel.'</font></td>
<td style="text-align:center;"><input type="hidden" name="reborns" value="'.$rebornT['a_reborns'].'" /><font color="#927D61"><font color=orange>'.$rebornT['a_reborns'].'</font> / <font color="#e78282">'.$S_rborn_allow.'</font></font></td>
</tr><input type="hidden" name="step" value="'.$actionz.'" /></form>');
}
}
}

} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'You need to log off the server to use the reborn.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Sorry the reborn system is off-line.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'To use this system, you need to login the website.');
}
$tpl->printToScreen();
credit($cmsV,$Licence,$server_owner);
include 'styles/'.$style.'/tpl/extras/footer.html';
?>php

I ask you to help
thank you so much

and sry for my Bad english Big Grin Google Translator Smile

#2

This is the one I use and it works perfectly

<?php

session_start();
$file = 'reborn';
include "config/config.php";
include "styles/style.php";
include "core/plugin.php";
include 'core/functions.php';
include 'core/classes.php';
include 'core/post_check.php';
include "core/core.php";
$tpl->assignGlobal("page_title", "ReBorn System");
if( $User->LoggedIn == true ){
if ($S_rborn_online == "Enable"){
$Ctrl = new statpts();
$uid = $User->ID;
if( $Ctrl->isOnline( $uid ) ){


if( isset( $_POST['step'] ) && $_POST['step'] == md5('step2') ){
if( ctype_digit( $_POST['char'] ) ){
$cid = $_POST['char'];
$clevel = $_POST['level'];
$cname = $_POST['name'];
$creborns = $_POST['reborns'];


if ($clevel >= $S_rborn_level && $creborns <= $S_rborn_allow){

$Ctrl->GetGoldBalance( $cid, $row, $col, $amount );

if ($amount > $S_rborn_gold){
$dgold = $amount - $S_rborn_gold;
$query9T = sprintf("UPDATE %s.t_characters SET a_level=".$S_rborn_slevel.", a_exp=0, a_statpt_remain = (a_statpt_remain+".$S_rborn_rstats.") WHERE a_index = '".$cid."' ", $LC_Db );
$dbh9T = $con_cms_pdo->prepare( $query9T );
$dbh9T->execute();

$query10T = sprintf("UPDATE %s.t_reborn_log SET a_reborns=(a_reborns+1) WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh10T = $con_cms_pdo->prepare( $query10T );
$dbh10T->execute();

$Ctrl->DeductGold( $cid, $row, $col, $dgold );

$tpl->newBlock('success');
$tpl->Assign('msg' , "<font color='green'><font class='main_font'>The reborn was a success! ".$cname." is now reborn Smile<br/>Level ".$S_rborn_slevel." with your stat points + ".$S_rborn_rstats.", Skills not reset.<br/>".$S_rborn_gold." in-game gold has been deducted from ".$cname."</font></font>");
} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>In-game cash is only ".$amount." but you need ".$S_rborn_gold." to reborn.</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>Not met the requirements (Must be $S_rborn_level + under $S_rborn_allow reborns)</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Please select a character');
}} else {
$tpl->newBlock('reborn_char');
$tpl->Assign("rlevel", $S_rborn_level);
$tpl->Assign("rcost", $S_rborn_gold);
$tpl->Assign("rrborns", $S_rborn_allow);
$actionz = md5('step2');
$rand1 = 1;
if( $Ctrl->GetCharacters( $uid ) > 0 ){

foreach( $Ctrl->chars as $curChar ){
$rand1++;
$cid = $curChar['id'];
$cname = $curChar['name'];
$clevel = $curChar['level'];

$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = ".$cid."", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();

if($rebornT['a_reborns'] == NULL){
$rebornT = NULL;
$query8T = sprintf("INSERT INTO %s.t_reborn_log (a_index, a_reborns) VALUES ('".$cid."',0) ", $LC_CMSDb );
$dbh8T = $con_cms_pdo->prepare( $query8T );
$dbh8T->execute();
$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();
}

$tpl->Assign("listchars".$rand1, '<form method="post" id="'.$rand1.'"><tr>
<td style="text-align:center;"><input type="radio" name="char" value="'.$cid.'" onclick="this.form.submit();" /></td>
<td style="text-align:center;"><input type="hidden" name="name" value="'.$cname.'" /><font color="#927D61">'.$cname.'</font></td>
<td style="text-align:center;"><input type="hidden" name="level" value="'.$clevel.'" /><font color="#927D61">'.$clevel.'</font></td>
<td style="text-align:center;"><input type="hidden" name="reborns" value="'.$rebornT['a_reborns'].'" /><font color="#927D61"><font color=orange>'.$rebornT['a_reborns'].'</font> / <font color="#e78282">'.$S_rborn_allow.'</font></font></td>
</tr><input type="hidden" name="step" value="'.$actionz.'" /></form>');
}
}
}

} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'You need to log off the server to use the reborn.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Sorry the reborn system is off-line.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'To use this system, you need to login the website.');
}
$tpl->printToScreen();
credit($cmsV,$Licence,$server_owner);
include 'styles/'.$style.'/tpl/extras/footer.html';
?>

#3

 

This is the one I use and it works perfectly

<?php

session_start();
$file = 'reborn';
include "config/config.php";
include "styles/style.php";
include "core/plugin.php";
include 'core/functions.php';
include 'core/classes.php';
include 'core/post_check.php';
include "core/core.php";
$tpl->assignGlobal("page_title", "ReBorn System");
if( $User->LoggedIn == true ){
if ($S_rborn_online == "Enable"){
$Ctrl = new statpts();
$uid = $User->ID;
if( $Ctrl->isOnline( $uid ) ){


if( isset( $_POST['step'] ) && $_POST['step'] == md5('step2') ){
if( ctype_digit( $_POST['char'] ) ){
$cid = $_POST['char'];
$clevel = $_POST['level'];
$cname = $_POST['name'];
$creborns = $_POST['reborns'];


if ($clevel >= $S_rborn_level && $creborns <= $S_rborn_allow){

$Ctrl->GetGoldBalance( $cid, $row, $col, $amount );

if ($amount > $S_rborn_gold){
$dgold = $amount - $S_rborn_gold;
$query9T = sprintf("UPDATE %s.t_characters SET a_level=".$S_rborn_slevel.", a_exp=0, a_statpt_remain = (a_statpt_remain+".$S_rborn_rstats.") WHERE a_index = '".$cid."' ", $LC_Db );
$dbh9T = $con_cms_pdo->prepare( $query9T );
$dbh9T->execute();

$query10T = sprintf("UPDATE %s.t_reborn_log SET a_reborns=(a_reborns+1) WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh10T = $con_cms_pdo->prepare( $query10T );
$dbh10T->execute();

$Ctrl->DeductGold( $cid, $row, $col, $dgold );

$tpl->newBlock('success');
$tpl->Assign('msg' , "<font color='green'><font class='main_font'>The reborn was a success! ".$cname." is now reborn Smile<br/>Level ".$S_rborn_slevel." with your stat points + ".$S_rborn_rstats.", Skills not reset.<br/>".$S_rborn_gold." in-game gold has been deducted from ".$cname."</font></font>");
} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>In-game cash is only ".$amount." but you need ".$S_rborn_gold." to reborn.</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign('msg' , "<font color='#FFE600'><font class='main_font'>Not met the requirements (Must be $S_rborn_level + under $S_rborn_allow reborns)</font></font>");
}} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Please select a character');
}} else {
$tpl->newBlock('reborn_char');
$tpl->Assign("rlevel", $S_rborn_level);
$tpl->Assign("rcost", $S_rborn_gold);
$tpl->Assign("rrborns", $S_rborn_allow);
$actionz = md5('step2');
$rand1 = 1;
if( $Ctrl->GetCharacters( $uid ) > 0 ){

foreach( $Ctrl->chars as $curChar ){
$rand1++;
$cid = $curChar['id'];
$cname = $curChar['name'];
$clevel = $curChar['level'];

$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = ".$cid."", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();

if($rebornT['a_reborns'] == NULL){
$rebornT = NULL;
$query8T = sprintf("INSERT INTO %s.t_reborn_log (a_index, a_reborns) VALUES ('".$cid."',0) ", $LC_CMSDb );
$dbh8T = $con_cms_pdo->prepare( $query8T );
$dbh8T->execute();
$query7T = sprintf("SELECT a_reborns FROM %s.t_reborn_log WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh7T = $con_cms_pdo->prepare( $query7T );
$dbh7T->execute();
$rebornT = $dbh7T->fetch();
}

$tpl->Assign("listchars".$rand1, '<form method="post" id="'.$rand1.'"><tr>
<td style="text-align:center;"><input type="radio" name="char" value="'.$cid.'" onclick="this.form.submit();" /></td>
<td style="text-align:center;"><input type="hidden" name="name" value="'.$cname.'" /><font color="#927D61">'.$cname.'</font></td>
<td style="text-align:center;"><input type="hidden" name="level" value="'.$clevel.'" /><font color="#927D61">'.$clevel.'</font></td>
<td style="text-align:center;"><input type="hidden" name="reborns" value="'.$rebornT['a_reborns'].'" /><font color="#927D61"><font color=orange>'.$rebornT['a_reborns'].'</font> / <font color="#e78282">'.$S_rborn_allow.'</font></font></td>
</tr><input type="hidden" name="step" value="'.$actionz.'" /></form>');
}
}
}

} else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'You need to log off the server to use the reborn.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'Sorry the reborn system is off-line.');
} } else {
$tpl->newBlock('error');
$tpl->Assign("msg", 'To use this system, you need to login the website.');
}
$tpl->printToScreen();
credit($cmsV,$Licence,$server_owner);
include 'styles/'.$style.'/tpl/extras/footer.html';
?>

not work

In-game cash is only 0 but you need 500000000 to reborn.

#4
asgar i need help too can you help me i have use that one what you use but it still the same error

#5

mmm I have not done for shop I use a lot of items

and is configured to collect gold

 

 

put this in the file classes.php

function GetitemBalance( $cid, &$invRow, &$invCol, &$invAmount )
{
global $LC_Db; global $con_cms_pdo;
$l = substr($cid, -1);
$query = sprintf
("
SELECT
a_item_idx0,
a_item_idx1,
a_item_idx2,
a_item_idx3,
a_item_idx4,
a_count0,
a_count1,
a_count2,
a_count3,
a_count4,
a_row_idx

FROM
%s.t_inven0".$l."
WHERE
a_char_idx = :cidindex
", $LC_Db );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute( array( ':cidindex' => $cid ));
$invRow = -1;
$invCol = -1;
$invAmount = 0;

while( $row = $dbh->fetch() )
{
$r = $row['a_row_idx'];
for( $c=0; $c<5; $c++ )
{
if( $row['a_item_idx'.$c] == 19999 )// ITEM ID
{
$invRow = $r;
$invCol = $c;
$invAmount = $row['a_count'.$c];
}
}
}
}
function DeductItem($cid, $row, $col, $amount)
{
$l = substr($cid, -1);
global $LC_Db; global $con_cms_pdo;
$query = sprintf
("
UPDATE
%s.t_inven0%d

SET
a_count%d = %s

WHERE
a_char_idx = '%s'

AND
a_row_idx = '%s'

", $LC_Db,
$l,
$col,
$amount,
$cid,
$row );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute();
}

and then change the following line from: reborn.php

if ($clevel >= $S_rborn_level && $creborns <= $S_rborn_allow){

$Ctrl->GetGoldBalance( $cid, $row, $col, $amount );

if ($amount > $S_rborn_gold){
$dgold = $amount - $S_rborn_gold;
$query9T = sprintf("UPDATE %s.t_characters SET a_level=".$S_rborn_slevel.", a_exp=0, a_statpt_remain = (a_statpt_remain+".$S_rborn_rstats.") WHERE a_index = '".$cid."' ", $LC_Db );
$dbh9T = $con_cms_pdo->prepare( $query9T );
$dbh9T->execute();

$query10T = sprintf("UPDATE %s.t_reborn_log SET a_reborns=(a_reborns+1) WHERE a_index = '".$cid."' ", $LC_CMSDb );
$dbh10T = $con_cms_pdo->prepare( $query10T );
$dbh10T->execute();

$Ctrl->DeductGold( $cid, $row, $col, $dgold );

GetGoldBalance  ----->GetItemBalance

DeductGold    ------>DeductItem

#6
thx dude Smile

#7
now i get a empty page x.x

#8

the file should look like

function DeductNas($cid, $amount)
{
global $LC_Db; global $con_cms_pdo;
$query = sprintf
("
Update
%s.t_characters
SET
a_nas = a_nas - :amount
WHERE
a_index = :cidindex
AND
a_enable = 1
", $LC_Db );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute( array( ':amount' => $amount ,':cidindex' => $cid ));
}
function GetitemBalance( $cid, &$invRow, &$invCol, &$invAmount )
{
global $LC_Db; global $con_cms_pdo;
$l = substr($cid, -1);
$query = sprintf
("
SELECT
a_item_idx0,
a_item_idx1,
a_item_idx2,
a_item_idx3,
a_item_idx4,
a_count0,
a_count1,
a_count2,
a_count3,
a_count4,
a_row_idx

FROM
%s.t_inven0".$l."
WHERE
a_char_idx = :cidindex
", $LC_Db );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute( array( ':cidindex' => $cid ));
$invRow = -1;
$invCol = -1;
$invAmount = 0;

while( $row = $dbh->fetch() )
{
$r = $row['a_row_idx'];
for( $c=0; $c<5; $c++ )
{
if( $row['a_item_idx'.$c] == 9999 )
{
$invRow = $r;
$invCol = $c;
$invAmount = $row['a_count'.$c];
}
}
}
}
function DeductItem($cid, $row, $col, $amount)
{
$l = substr($cid, -1);
global $LC_Db; global $con_cms_pdo;
$query = sprintf
("
UPDATE
%s.t_inven0%d

SET
a_count%d = %s

WHERE
a_char_idx = '%s'

AND
a_row_idx = '%s'

", $LC_Db,
$l,
$col,
$amount,
$cid,
$row );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute();
}

function GetGoldBalance( $cid, &$invRow, &$invCol, &$invAmount )
{
global $LC_Db; global $con_cms_pdo;
$l = substr($cid, -1);
$query = sprintf
("
SELECT

hope you serve



Forum Jump:


Users browsing this thread: 1 Guest(s)