CodeIn that case you have to edit the script itself aswell as classes/player.php as you wrote above.
Might have to change a couple of more things aswell, might be easier to change the store to use premium_points insted.
Let's hope that websites uses the same schemas ~ with 2.0, that would make things alot easier![]()
hey, they dont work for new gesior, and one of they "work" but with bug to gain premium points
thanks
https://otland.net/threads/character-market-for-gesior.243992/Then it's better to say what the bugs are, what you are doing when they occur and post the script you are using![]()
https://otland.net/threads/character-market-for-gesior.243992/
the others dont work
many bugs, like: If player put for sell and another buy, the player who put on sale click on "remove" the other will lose points and characters.
other bug: Player can put like "-1000" points who bought this will win 1000 points.
$main_content .= '<form style="margin-bottom:-1px" role="form" action="?subtopic=accountmanagement&action=sellchar" method="post" id="sellcharform"><input type="hidden" value="'.$account_player->getID().'" name="playerid">[<a href="#" onclick="document.getElementById(\'sellcharform\').submit();">Sell</a>]</form></td></tr>';
//########### SELL CHARACTER ##########
if($action == "sellchar")
{
$playerid = $_POST['playerid'];
$player = new Player();
$player->loadById($playerid);
if($player->isLoaded())
{
$player_account = $player->getAccount();
if($account_logged->getID() == $player_account->getID())
{
if($_POST['sellcharacter'] == 1)
{
if($account_logged->getPremiumPoints() >= 5)
{
$price = (int) $_POST['price'];
if($price >= 1)
{
if(!$player->isOnline())
{
$auction = new Notification();
$auction->setOldAccountID($account_logged->getID());
$auction->setPlayerID($player->getID());
$auction->setPrice($price);
$auction->setStatus(0);
$auction->save();
$player->setAccountID(1);
$player->save();
$account_logged->addPremiumPoints(-5);
$account_logged->save();
$main_content .= '<div class="alert alert-success">'.$player->getName().' has been put on sale, you can check it by <a href="?subtopic=characterauction">clicking here</a>.</div>';
}
else{
$main_content .= '<div class="alert alert-danger"><center><font color="red">Character must be offline.</font></center></div>';
}
}
else{
$main_content .= '<div class="alert alert-danger">Minimum price is 1 tibia coin.</div>';
}
}
else
{
$main_content .= '<div class="alert alert-danger">You need 5 tibia coins to put a character on sale.</div>';
}
}
$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 class="HintBox">
<tbody>
<tr>
<td><form class="form-horizontal" role="form" action="?subtopic=accountmanagement&action=sellchar" method="post">
<p>By placing a character on sale, it will leave your account and go to a special account.</p><p>You will be able to remove the offer later on, and the character will come back without any cost.</p><p>Upon a sale, the character is moved to the new buyers account, and the money is added to your account.</p><p>Its cost <strong>5 tibia coins</strong> to place a character in sale, these points is not recovered whatsoever.</p>
<input type="hidden" name="playerid" value="'.htmlspecialchars($player->getID()).'">
<input type="hidden" name="sellcharacter" value="1">
<p><b>'.htmlspecialchars($player->getName()).'</b></p>
<p><input type="number" name="price" placeholder="enter a value in premium points"></p>
<p>
<button type="submit">Submit</button>
<a href="?subtopic=accountmanagement">Back</a>
</p>
</form>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</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>';
}
else {
$main_content .= "<div class='alert alert-danger'>Character <b>" . htmlspecialchars($player_name) . "</b> does not belong to you.</div>";
}
}
else
{
$main_content .= "<div class='alert alert-danger'>Character could not be loaded, please contact a support.</div>";
}
}
I have one but have an little problem, If the account have 2 or more characters when player click on second char for sell, the script put the first char for sale (the char Which is on the top).
..
Script php:
Code:$main_content .= '<form style="margin-bottom:-1px" role="form" action="?subtopic=accountmanagement&action=sellchar" method="post" id="sellcharform"><input type="hidden" value="'.$account_player->getID().'" name="playerid">[<a href="#" onclick="document.getElementById(\'sellcharform\').submit();">Sell</a>]</form></td></tr>'; //########### SELL CHARACTER ########## if($action == "sellchar") { $playerid = $_POST['playerid']; $player = new Player(); $player->loadById($playerid); if($player->isLoaded()) { $player_account = $player->getAccount(); if($account_logged->getID() == $player_account->getID()) { if($_POST['sellcharacter'] == 1) { if($account_logged->getPremiumPoints() >= 5) { $price = (int) $_POST['price']; if($price >= 1) { if(!$player->isOnline()) { $auction = new Notification(); $auction->setOldAccountID($account_logged->getID()); $auction->setPlayerID($player->getID()); $auction->setPrice($price); $auction->setStatus(0); $auction->save(); $player->setAccountID(1); $player->save(); $account_logged->addPremiumPoints(-5); $account_logged->save(); $main_content .= '<div class="alert alert-success">'.$player->getName().' has been put on sale, you can check it by <a href="?subtopic=characterauction">clicking here</a>.</div>'; } else{ $main_content .= '<div class="alert alert-danger"><center><font color="red">Character must be offline.</font></center></div>'; } } else{ $main_content .= '<div class="alert alert-danger">Minimum price is 1 tibia coin.</div>'; } } else { $main_content .= '<div class="alert alert-danger">You need 5 tibia coins to put a character on sale.</div>'; } } $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 class="HintBox"> <tbody> <tr> <td><form class="form-horizontal" role="form" action="?subtopic=accountmanagement&action=sellchar" method="post"> <p>By placing a character on sale, it will leave your account and go to a special account.</p><p>You will be able to remove the offer later on, and the character will come back without any cost.</p><p>Upon a sale, the character is moved to the new buyers account, and the money is added to your account.</p><p>Its cost <strong>5 tibia coins</strong> to place a character in sale, these points is not recovered whatsoever.</p> <input type="hidden" name="playerid" value="'.htmlspecialchars($player->getID()).'"> <input type="hidden" name="sellcharacter" value="1"> <p><b>'.htmlspecialchars($player->getName()).'</b></p> <p><input type="number" name="price" placeholder="enter a value in premium points"></p> <p> <button type="submit">Submit</button> <a href="?subtopic=accountmanagement">Back</a> </p> </form> </td> </tr> <tr></tr> </tbody> </table> </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>'; } else { $main_content .= "<div class='alert alert-danger'>Character <b>" . htmlspecialchars($player_name) . "</b> does not belong to you.</div>"; } } else { $main_content .= "<div class='alert alert-danger'>Character could not be loaded, please contact a support.</div>"; } }
Not the correct script, the script should have a class named Notification.
That seems to be a cut from your acc manag.php
If that is all the code you got that explains why it isen't working xD
Gesior does not come with those systems by default, meaning you have to add everything.
Thats why I come here to request some script good![]()
not my code, i made some changes its work fine lolyour code is removed, this dont work same problem as peoples on the thread![]()