• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Share] Gold to Points (BK CP)

Junior Spellweaver
Joined
Aug 11, 2007
Messages
144
Reaction score
30
Some Bug Fixed*

*Exact Cost Decrease
*Detecting no character
*Detecting Enough Gold to Change to points no - gold.
*Fresh Account Cannot be Change to points
*Character Online Fixed
*99.9% No bug:)

PHP:
 <?php 
require("config.php"); 
function getN ($int) { 
    if ($int == 0) { $char = "SG"; } 
    if ($int == 1) { $char = "MP"; } 
    if ($int == 2) { $char = "PHX"; } 
    if ($int == 4) { $char = "Trading Hole"; } 
return $char; 
} 
echo" 
<script type='text/javascript'> 

function removeElement2(asd) 
{ 
document.getElementById('bb').value=asd; 

} 
</script>"; 
$error=1; 
if($_POST['lostpassword']=='Buy') { 
     
    $error = 2; 
    $account_id = stripslashes($_SESSION['user']); 
    $Nation = stripslashes($_POST['nation']); 
    $name = stripslashes($_POST['name']); 
    $query = "SELECT store_inbox from RanUser.dbo.Web"; 
    $result = $db->Execute($query); 
    $row = $result->fetchrow(); 
    $Cost = $row[0]; 


    $result = mssql_query ("SELECT ChaMoney,ChaLevel,ChaReborn,ChaOnline FROM RanGame1.dbo.Chainfo Where ChaName = '$name'"); 
    $rows=mssql_num_rows($result); 

    if($rows>0) { 
        $rows=mssql_fetch_assoc($result);  
        extract($rows); 
        $reborn2 = ($ChaReborn); 
        $lev = ($ChaLevel); 
        $Gold = ($ChaMoney); 
        $type = ($ChaOnline); 
    if($Gold<$Cost*$Nation) { 
            echo "NOT ENOUGH GOLD TO CHANGE."; 
        $error = 1; 
        } 

    if($type>=1) { 
            echo "CHARACTER SELECTED IS ONLINE"; 
        $error = 1; 
            } 
    } else { 
                    echo "NO CHARACTER SELECTED."; 
        $error = 1;  
    } 
} 
if($error==1) { 
    $query = "SELECT store_inbox from RanUser.dbo.Web"; 
    $result = $db->Execute($query); 
    $row = $result->fetchrow(); 
echo " 

<table width=350 border=0 cellspacing=2 cellpadding=1> 

"; 

  
$login = stripslashes($_SESSION['user']); 
$comanda1="SELECT UserNum from RanUser.dbo.UserInfo where Username = '$login' "; 
$rezultat2=mssql_query($comanda1) or die("Can`t be executed"); 
while($r2=mssql_fetch_array($rezultat2)){ 
$Usernum = $r2["UserNum"]; 
} 
               
                ; 

echo "<br><br><center><div style='width:546px; margin:0 0 0 10px; padding:10px; border:1px solid #484848; background:#0099CC; color:white; text-align:center; line-height:18px'> 
    Welcome to you Gold to Points Exchange! You can exchange your gold to points here!</div> 
<br><br> 
<font color=black size=2><b><center>Exchange Rate $row[0] Gold per 1 Point</font><br><br> 
<table width=480 border=0 cellspacing=0 cellpadding=0 bgcolor=white align=center> 
                    <tr height=19> 
                        <td align=center bgcolor=gray width=80 height=26 style='background: #0099CC; font: 11px verdana, sans-serif; color:#eee;'><font size=-1 color=#fbffff face=Helvetica, Geneva, Arial, SunSans-Regular, sans-serif><strong>ID</strong></font></td> 
                        <td align=left bgcolor=gray width=200 height=26 style='background: #0099CC; font: 11px verdana, sans-serif; color:#eee;'><font size=-1 color=#fbffff face=Helvetica, Geneva, Arial, SunSans-Regular, sans-serif><strong>Name</strong></font></td> 
                        <td align=center bgcolor=gray width=200 height=26 style='background: #0099CC; font: 11px verdana, sans-serif; color:#eee;'><font size=-1 color=#fbffff face=Helvetica, Geneva, Arial, SunSans-Regular, sans-serif><strong>Gold</strong></font></td> 
                        <td align=center bgcolor=gray width=200 height=26 style='background: #0099CC; font: 11px verdana, sans-serif; color:#eee;'><font size=-1 color=#fbffff face=Helvetica, Geneva, Arial, SunSans-Regular, sans-serif><strong>Level</strong></font></td> 
                         
                    </tr> 
"; 


$rezultat4=mssql_query("SELECT * from RanGame1.dbo.Chainfo where Usernum = '$Usernum' ") or die("Cant"); 

while($r3=mssql_fetch_array($rezultat4)) 
{ 
$b1 = $r3['ChaName']; 
$b2 = $r3['ChaNum']; 
$b3 = $r3['ChaReborn']; 
$b4 = $r3['ChaMoney']; 
$b5 = $r3['ChaLevel']; 


     




echo"                     
                    <tr height=19> 
                        <td align=center width=80 height=19 style='border-bottom:#CCCCCC 1px dashed'><b><font color=black size=2>$b2</td> 
                        <td align=left width=200 height=19 style='border-bottom:#CCCCCC 1px dashed'><b><font color=black size=2>$b1</td> 
                        <td align=center width=200 height=19 style='border-bottom:#CCCCCC 1px dashed'><b><font color=black size=2>$b4</td> 
                        <td align=center width=200 height=19 style='border-bottom:#CCCCCC 1px dashed'><b><font color=black size=2>$b5</td> 

</td> 
</tr> 
"; 
} 
echo "                    </table>"; 
} 



echo "<br><center><form name='lostpassword' action='' method='post' onsubmit='return checkform1()' autocomplete='off'> 
        <table CELLSPACING=0 BORDER=0 CELLPADDING=0 align=CENTER> 
            <tr> 
                <td width=100 align=right> 
                <font size=2 color=black><b>Character :   
                </td> 
                <td> 
                <select name=name style='background: #0099CC; font: 11px verdana, sans-serif; color:#eee;'>"; 
                 



$i=0; 
$rezultat4=mssql_query("SELECT * from RanGame1.dbo.Chainfo where Usernum = '$Usernum' ") or die("Cant"); 

while($r3=mssql_fetch_array($rezultat4)) 
{ 
$r1 = $r3['ChaName']; 
$r2 = $r3['ChaNum']; 
$r2++; 
        echo" 
            <option value=$r1>$r1 
        "; 
     
} 
echo " 
                    </select>  
                </td> 
            </tr> 

         
         
            <tr><td width=100 align=right><font size=2 color=black><b>Points :   </td> 
            <td><select name=nation> 
            <option value=1 onclick='removeElement2(1*$row[0])'>1</option> 
            <option value=10 onclick='removeElement2(10*$row[0])'>10</option> 
            <option value=100 onclick='removeElement2(100*$row[0])'>100</option> 
            <option value=1000 onclick='removeElement2(1000*$row[0])'>1000(1k)</option> 
            <option value=10000 onclick='removeElement2(10000*$row[0])'>10000(10k)</option> 
            </select></td></tr> 
            <tr><td width=100 align=right><font size=2 color=black><b>Gold Cost :   </td> 
            <td><input type=text name=bb id=bb value='' size=10 readonly></td></tr> 
            <tr align=center><td align=right><BR><input type=hidden name=lostpassword value='Buy'> 
            <input type=hidden name=Nation value='$r2'> 
            </td></tr><tr><td align=right><input type=submit name=Login value='   Exchange   '></td></tr> 
         
    </form> 


"; 

if($error==2) { 
    $query = "SELECT store_inbox from RanUser.dbo.Web"; 
    $result = $db->Execute($query); 
    $row = $result->fetchrow(); 
    $account_id = stripslashes($_SESSION['user']); 
    $Usernum = ($UserNum); 
    $Alz = ($Alz); 
    $Nation = stripslashes($_POST['nation']); 
    $name = stripslashes($_POST['name']); 
    $Cost = $row[0] * $Nation; 
     
    mssql_query ("UPDATE RanGame1.dbo.ChaInfo SET ChaMoney = ChaMoney - '$Cost' WHERE ChaName = '$name'"); 
    mssql_query ("UPDATE UserInfo SET UserPoint = UserPoint + '$Nation' WHERE UserName = '$account_id' "); 

    $result = mssql_query ("SELECT ChaMoney FROM RanGame1.dbo.ChaInfo Where ChaName = '$name'"); 
    $rows=mssql_num_rows($result); 

    if($rows>0) { 
        $rows=mssql_fetch_assoc($result);  
        extract($rows); 
         
        $Gold = ($ChaMoney); 
    } 
    echo "<center><br><font size=3 color=green>Exchange Succesfully</font><br><br><font size=2>Your Character <b>$name</b> have:</font> <font color=black size=2><b>$Gold</font></b><font size=2> Left</font><br><br><br>"; 
    delayedrefresh('user.php?op=user&option=reborn'); 
} 
?>

explore how to add in your cp:)
 
Junior Spellweaver
Joined
May 10, 2009
Messages
129
Reaction score
1
if im using bkrancp.. just rename the old g2cp then churva done^^ i dunno how to configure the golds to points,
 
Newbie Spellweaver
Joined
Oct 24, 2009
Messages
90
Reaction score
2
only copy paste this code to your cp

you can find it in htdocs:/your folder cp/modules/user/gold2point.php

try it ^^

---------- Post added at 03:58 PM ---------- Previous post was at 03:56 PM ----------

only copy paste this code to your cp

you can find it in htdocs:/your folder cp/modules/user/gold2point.php

try it ^^
 
Junior Spellweaver
Joined
Jul 13, 2011
Messages
175
Reaction score
17
How About On Database Sir? What Column Im Going To Add?
 
Newbie Spellweaver
Joined
Dec 20, 2006
Messages
34
Reaction score
1
hi.. anyone face an issue with gold exchange to points?? i got this problem where if you just enter any id with same password as id character. then transfer point to your character... it still works.. any amount..

any one solve this issue??

please assist./..
 
Mythic Archon
Joined
Oct 18, 2011
Messages
721
Reaction score
38
Where I can change the amount of gold cost? and where I can change the amount of points?
 
Back
Top