Register for your free account! | Forgot your password?

You last visited: Today at 01:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[REQUEST]PHP Script

Discussion on [REQUEST]PHP Script within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
WarpGeorge's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
[REQUEST]PHP Script

Hello. Can someone, who's having a good knowledge about PHP, make a PHP script that's resets, to a desired character, the amount of money? Like 2 boxes one for Character Name and one for Password and then a button for "Reset" that reads the character money and reset him to 0 if his money are over 999k? If I didn't explained well I'll explain my request again and if it's to hard I request to close this topic.
WarpGeorge is offline  
Old 05/21/2010, 20:12   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
This should be just about what you need, it's nothing great just made it real quick.
You'll have to edit it a bit to fit your database (table names etc) but should work.

Code:
<?php
	$mysql_hostname =  "localhost";
	$mysql_user = 	   "USERNAME";
	$mysql_password =  "PASSWORD";
	$mysql_database =  "DATABASE";
?>

<?php
	if (isset($_POST['uid']) && isset($_POST['gold'])) {
		$user = $_POST['uid'];
		$gold = $_POST['gold'];
		
		$mysql_con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
		or die("Unable to connect to database.");
		mysql_select_db($mysql_database, $mysql_con) or die("Unable to select database.");
		
		$sql = "UPDATE characters SET Gold = 0 WHERE UID = '$uid'";
		
		if (!mysql_query($sql))
			die('Error: ' . mysql_error());
		echo "Updated!";
	}
	else if (isset($_POST['user']) && isset($_POST['pass'])) {
		$user = $_POST['user'];
		$pass = $_POST['pass'];
		
		$mysql_con = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
		or die("Unable to connect to database.");
		mysql_select_db($mysql_database, $mysql_con) or die("Unable to select database.");
		
		$sql = "SELECT UID FROM accounts WHERE Account = '$user' AND Password_Plain = '$pass'";
		
		$uid = mysql_result(mysql_query($sql), 0) or die("Invalid Username or password.");
		
		$sql2 = "SELECT Gold FROM characters WHERE UID = $uid";
		
		$result = mysql_query($sql2) or die("Invalid UID.");
		
		
		if ($row = mysql_fetch_array($result)) {
			$gold = $row['Gold'];
			echo "Money: $gold<br />";
			if ($gold >= 999999) {
				echo "<form method='post'>";
				echo "<input type='hidden' value=$uid name='uid' />";
				echo "<input type='hidden' value=$gold name='gold' />";
				echo "<input type='submit' value='Reset to 0' />";
				echo "</form>";
			}
		}
	}
?>

<form method="post">
<table>
	<tr>
		<td>Username:</td>
		<td><input type='text' name='user' /></td>
	</tr>
	<tr>
		<td>Password:</td>
		<td><input type='password' name='pass' /></td>
	</tr>
	<tr>
		<td></td>
		<td><input type='submit' value="Find" /></td>
	</tr>
</table>
<form>
kinshi88 is offline  
Old 05/21/2010, 21:44   #3
 
elite*gold: 0
Join Date: Apr 2007
Posts: 208
Received Thanks: 43
Kinshi, you cant really make it unless you know what source.
it could be flat file.
DePredaTe is offline  
Old 05/21/2010, 22:14   #4
 
gerble93's Avatar
 
elite*gold: 40
Join Date: Sep 2006
Posts: 1,890
Received Thanks: 805
Quote:
Originally Posted by DePredaTe View Post
Kinshi, you cant really make it unless you know what source.
it could be flat file.
You shouldn't criticise Kinshi..he did what the person asked for with the information he best could get.
gerble93 is offline  
Thanks
1 User
Old 05/21/2010, 22:36   #5
 
elite*gold: 0
Join Date: Apr 2007
Posts: 208
Received Thanks: 43
i wasn't criticizing kinshi at all.
if i was going to criticize anyone it should be the poster. Kinshi was just trying to help.
I don't understand how people expect people to write PHP script for their server if you don't even post the information needed. He posted what he wanted, not what he needed.
DePredaTe is offline  
Old 05/22/2010, 00:50   #6
 
ImmuneOne's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by kinshi88 View Post
This should be just about what you need, it's nothing great just made it real quick.
You'll have to edit it a bit to fit your database (table names etc) but should work.
MysqlConfig.cs
Code:
<?php

$mysql_hostname =  "localhost";
$mysql_user = 	   "USERNAME";
$mysql_password =  "PASSWORD";
$mysql_database =  "DATABASE";

?>
MysqlBase.cs
Code:
<?php

public class MysqlBase
{
   var $_Connection = null;
   var $_Reader = null;
   var $_Command = null;
   var $_Query = null;
   var $_Result = null;

   public function MysqlBase()
   {
     $this->_Connection = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
		or die("Unable to connect to database.");
   }
    
   public function Select($Table, $Section, $FromSection, $FromValue)
   {
     mysql_select_db($mysql_database, $this->_Connection) or die("Unable to select database.");
     $this->_Command = "SELECT $Section FROM $TABLE WHERE $FromSection = '$FromValue'";
     $this->_Reader = mysql_result(mysql_query($this->_Command), (0) or die("Data not found.");
     $this->_Query = mysql_query($this->_Command) or die("Data not found.");
   }
   
   public function Read($Section)
   {
     var $_Value = null;

     if($this->_Result = mysql_fetch_array($this->_Query)
     {
       $_Value = $this->_Result['$Section']; 
     }
     return $_Value;
   }
}

?>
I don't see the point of recreating the connection everytime
ImmuneOne is offline  
Old 05/23/2010, 01:58   #7
 
WarpGeorge's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
Request was for a 5095 database (binaries). I'll try to edit where needed to get this script working. Thanks anyway kinshi even this will not work. I'm trying out now
WarpGeorge is offline  
Old 05/23/2010, 02:07   #8
 
WarpGeorge's Avatar
 
elite*gold: 0
Join Date: May 2010
Posts: 133
Received Thanks: 27
Neah doesn't work ! I wanted this PHP script to prevent people making money glitch ( getting over 2,5 billions gold) but I had an idea and re-scripted the Exchanger (NPC which's exchanging your CPs for gold and made a line which's it's reading the value of your character money and if you have more or equal to 999kk give you a fail msg and stop exchanging you money). I request to close this topic but don't delete it because maybe some people will need that kinshi work or Immuneone. ty and sorry for disturbing you people with that script. i`ll never ask again for something that can be done with another methods that i have knowledge about them sorry again
WarpGeorge is offline  
Reply

« question | Question »

Similar Threads Similar Threads
[Request]pvp script
08/17/2010 - Dekaron Private Server - 1 Replies
hi can some1 know script with who i can reset all char pvp point
script request
09/28/2009 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 1 Replies
Hello, I'm playing on a server with stack sub and im using pr/bd. I was wondering how to set l2w to equip duals, dance and equip bow back after finished dancing, if anyone knows please share. Thank you.
[Request] Script help 2
05/17/2009 - Lineage 2 - 0 Replies
Ok guys, I got a new idea for a script :p but Im not sure if this 1 is possible either. Since im on a private servers where u have full buffs all the time my bish cant keep up with ressing my bots sometimes and then when the skill is reloaded she wont ress them anymore. Is there a way to make script that does resses them after the skill is reloaded?
[REQUEST] Can i Request A Acc/Char PHP Script
09/27/2008 - CO2 Private Server - 6 Replies
hello i was wondering if anyone have made a acc/char creation page in one yet? is so can anyone release itplease?
[Request] PHP Script
09/14/2008 - CO2 Private Server - 8 Replies
@Request #Close #Delete



All times are GMT +1. The time now is 01:40.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.