• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior ACC] Buy / sell characters

Raggaer

Godly Member
Joined
Jul 25, 2012
Messages
1,557
Solutions
8
Reaction score
957
Location
Spain
Hello, i made this some days ago, it works fine, you can sell characters, and then other people buy it, you get the points the other person payed.
*Note: if you find any bugs, report please!

- Photos -
*Selling a character!
Untitled-3.jpg

*Seeing list of character to buy!
Untitled-4.jpg

*Buying character
Untitled-5.jpg

- Install -

Download attachment, add the sellchar.php and buychar.php to your gesior folder, edit index ( wont explain, if help needed use PM ! )
Add this query to database

Code:
CREATE TABLE IF NOT EXISTS `sellchar` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NOT NULL,
  `vocation` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `status` varchar(40) NOT NULL,
  `oldid` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

We are done!
Enjoy :·3
 

Attachments

  • myacc_character_auctions_safe_version.zip
    3.3 KB · Views: 79 · VirusTotal
Last edited by a moderator:
Code:
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/sellchar.php on line 25

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /var/www/sellchar.php on line 25

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/sellchar.php on line 26

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /var/www/sellchar.php on line 26
Replace mysql_real_escape_string for stripslashes

- - - Updated - - -

Also is better to add in your account manager this feature: Add in accountmanagement.php over //### DELETE character from account ###
Code:
		$main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Sell your characters</B></CENTER></TD></TR>';
		$main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><B></B>';
		
		$players_from_logged_acc = $account_logged->getPlayersList();
							
								$players_from_logged_acc->orderBy('name');
								$main_content .= '<form action="" method="post"><select name="char">';
								foreach($players_from_logged_acc as $player)
								{
									$main_content .= '<option>'.$player->getName().'</option>';
								}
		
		$main_content .= '</select>Select a character to sell<br>';
		$main_content .= '<input type="text" name="price" maxlength="10" size="4" >Select the price of the character<br>';
		$main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>';
							$main_content .= '</form></table>';
							
							if (isset($_POST['submit'])) {
								
							$char = stripslashes($_POST['char']);
							$price = stripslashes($_POST['price']);
							
							if ($char && $price) {

								if(is_numeric(trim($_POST['price']))) {
								
										$check2 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$char'") or die(mysql_error());
								foreach ($check2 as $re) {
									$voc = $re['vocation'];
									$oid = $re['account_id'];
								}
								$check1 = $SQL->query("UPDATE `players` SET `account_id` = 1 WHERE `name` = '$char'") or die(mysql_error());
								$check3 = $SQL->query("INSERT INTO `sellchar` VALUES ('','$char','$voc','$price','1','$oid')");
								$main_content .= '<b><center>You added your character correctly, thanks!</b></center>';
								header("Location: index.php?subtopic=buychar");
								
								} else {
							
								$main_content .= '<b><center>Set a numeric price!!</b></center>';
								}
								
							} else {
									$main_content .= '<b><center>Fill out all fields!</b></center>';
							}
							
						}
							$main_content .= '<br>';
										$main_content .= '<div class="SmallBox" ><div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" >If you put your character on sale anyone can buy it, you will lose acces to that character and you wont be able to log in with that character until someone buys it, you can also delete your offer by buying your own character!<br><b>When someone buys your character you will get the price in points!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ></div></div></td></tr></form></table></div></div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
And you will have a beautiful system, also you dont need to talk to an admin to delete offer, you just buy your own character.
 
Last edited:
I'm having a problem!
Always when I run the button appearing on selling character:
*"Fill Out All fields!"

I do not know why this is happening. I asked my friend to test, but going with the same error.
I did everything I was told: Query, and site index. More continued with the problem.

Anyone know fix?
 
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\sellchar.php on line 25

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\sellchar.php on line 25

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\sellchar.php on line 26

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\sellchar.php on line 26
 
replace in sellchar.php lines 25 and 26 to
$char = stripslashes($_POST['char']);
$price = stripslashes($_POST['price']);

thanks to MxSoft he solved this problem
 
What about the price?
If i want to buy the char for 6000 points?
I got over 65000 points, and when i bought a char for 6000 points, my premium points doesnt go?
Lol it's free then?
 
Is this for 2012 gesior?
WibbenZ
 
Back
Top