Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
When i sell character in website,
auto add in account 1/1, in Account Manager and All chara add in game
can all use it.
how i can fixit
Like ThatV is chara seller
When i sell character in website,
auto add in account 1/1, in Account Manager and All chara add in game
can all use it.
how i can fixit
Like ThatV is chara seller
if is znoteacc, if I can remember, you need to set an account id to hold characters that are in auction, look at the config.php from your web and change the account id to an account that nobody's gonna use
i`m use myacc
Sellchara
you can give me script? to can add in config?
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?PHP
if($logged) {
$main_content .= '<center><b>Aqui voce pode vender seu personagem, NAO EH EM DINHEIRO PELO JOGO E SIM EM " POINTS "</center></b><br>';
$main_content .= 'Se voce colocar o seu personagem a venda qualquer pessoa pode compra-lo, voce vai perder acesso desse personagem e voce nao sera capaz de entrar com esse personagem, ate alguem compra-lo, voce tambem pode excluir a sua oferta falando com um administrador. <br> <b> quando alguem compra o seu personagem, voce vai ter o valor em pontos na sua account!</b>';
$main_content .= '<br>';
$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>';
$main_content .= '</select>Escolha o character a ser vendido<br>';
$main_content .= '<input type="text" name="price" maxlength="10" size="4" >Escolha quanto voce quer pelo character ( POINTS )<br>';
$main_content .= '<input type="submit" name="submit" value="Sell character"></TD></TR>';
$main_content .= '</form></table>';
$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>';
}
$check1 = $SQL->query("UPDATE players SET account_id = 1 WHERE name = '$char'") or die(mysql_error());
change where is 1 to the account id that is gonna hold the character while they are in auction.
Just create an account that you and nobody is gonna use, with a harder password that you don't even need to know, only for secure and use that account to hold.
i`m create account 333/pass 333
just for test
and add
$check1 = $SQL->query("UPDATE players SET account_id = 333 WHERE name = '$char'") or die(mysql_error());
i`m create account 333/pass 333
just for test
and add
$check1 = $SQL->query("UPDATE players SET account_id = 333 WHERE name = '$char'") or die(mysql_error());
i change script Like Gosier But Fatal error: Call to undefined method OTS_Player::getAccountId() in C:\xampp\htdocs\sellchar.php on line 39
every time add account id > ^ Get that in
$player->setAccountId(2); < i change it but still no work
<?php
if ($logged) {
$main_content .= '<center><b>Here you can put your character on sale!</center></b><br>';
$main_content .= '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 talking to an admin!<br><b>when someone buys your character you will get the price in points!</b>';
$main_content .= '<br>';
$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->orderBy('name');
$main_content .= '<form action="" method="post"><select name="player_id">';
// w option w 'value' ustawiam ID gracza, rozwiazuje to wiele problemow z nickiami gracza i ich szukaniem w bazie
foreach ($players_from_logged_acc as $player) {
$main_content .= '<option value="' . $player->getId() . '">' . $player->getName() . '</option>';
}
$main_content .= '</select>Select a character to sell<br>';
$main_content .= '<input type="text" name="price" maxlength="5" 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'])) {
// zmieniam zmienne w int, jesli ktos wpisal jakis tekst, to zamieni sie w liczbe 0
$player_id = (int)$_POST['player_id'];
$price = (int)$_POST['price'];
// to znaczy, ze $player_id i $price nie są zerami
if ($player_id && $price) {
// cena musi byc dodatnia, inaczej ktos moze wystawic za -50 pkt, ktos to kupi i system da komus pkt. za darmo
if ($price > 0) {
$player = new OTS_Player();
$player->load($player_id);
// sprawdzamy czy gracz sie zaladowal = czy istnieje w bazie danych
if ($player->isLoaded()) {
// sprawdzamy czy id konta gracza jest takie samo jak id konta zalogowanego
if ($player->getAccountId() == $account_logged->getId()) {
// sprawdzamy czy gracz nie jest online
if (!$player->isOnline()) {
$offer_info = $SQL->query("SELECT price, oldid FROM sellchar WHERE name = " . $player_id)->fetch();
if (!$offer_info) {
$vocation = $player->getVocation();
$old_id = $player->getAccountId();
$player->setAccountId(1);
$player->save();
// wszystkie zmienne sa 'int', wiec na pewno sa bezpieczne dla MySQL,
// nie trzeba uzywac $SQL->quote, zeby zabezpieczyc sie przez SQL Injection
$SQL->query(
"INSERT INTO sellchar VALUES (NULL,'$player_id','$vocation','$price','1','$old_id')"
);
$main_content .= '<b><center>You added your character correctly, thanks!</b></center>';
header("Location: index.php?subtopic=buychar");
} else {
$main_content .= '<b><center>There is already sell offer for this character.</b></center>';
}
} else {
$main_content .= '<b><center>This character online! Logout first.</b></center>';
}
} else {
$main_content .= '<b><center>This character is not on your account!</b></center>';
}
} else {
$main_content .= '<b><center>Character does not exist!</b></center>';
}
} else {
$main_content .= '<b><center>Price must be higher than 0!</b></center>';
}
} else {
$main_content .= '<b><center>Fill out all fields!</b></center>';
}
}
} else {
$main_content .= '<b><center>Please log in first!</b></center>';
}