• 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!

Trade Offline for Znote account

2057623

Member
Joined
Jan 16, 2012
Messages
97
Reaction score
12
Guys, I'm trying to add Trade offline to my server, but I can't find the .php page on the site, none of the ones I found are correct, all of them are wrong, I use ZnoteACC, if anyone has it and can give me the link with a big heart, I'd appreciate it. If you also want to transfer the file to TFS 1.4x as well, because what I found for 1.3x I haven't tested 100%.
 
try here;

Thanks for responding, well I used the code there, but on my website it looked like this


1696982047122.png

I used this
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

$cache = new Cache('engine/cache/ingmarket');
if ($cache->hasExpired()) {
$inGameAuctions = mysql_select_multi('SELECT auction_system.player, auction_system.id, auction_system.item_name, auction_system.item_id, auction_system.count, auction_system.cost, auction_system.date, players.name FROM auction_system, players WHERE players.id = auction_system.player ORDER BY auction_system.id DESC');

$cache->setContent($inGameAuctions);
$cache->save();
} else {
$inGameAuctions = $cache->load();
}
$players = 0;

if (isset($_POST)) {
if (isset($_POST['player']) && ! empty($_POST['player'])) {
$name = getValue($_POST['player']);
$player_id = user_character_exist($name);

$inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
return $player_id == $auction['player'];
});
}

if (isset($_POST['item']) && ! empty($_POST['item'])) {
$item = getValue($_POST['item']);

$inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
return strtolower($item) == strtolower($auction['item_name']);
});
}
}
?>

<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<th>
<b>Instruction<b>
</th>
</tr>
<tr>
<td align="center">
<h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br/>
<small>example: !offer add, plate armor, 500, 1</small><br/><br/>
<b>!offer buy, AuctionID</b><br/><small>example: !offer buy, 1943</small><br /><br/>
<b>!offer remove, AuctionID</b><br/><small>example: !offer remove, 1943</small><br /><br/>
<b>!offer withdraw</b><br/><small>Use this command to get money for sold items.</small>
</td>
</tr>
</table><br/>

<form action="" method="POST">
<input type="text" name="player" placeholder="Player..">
<input type="text" name="item" placeholder="Item..">
<input type="submit" value="Search">
</form>

<table width="100%" class="table table-striped table-bordered table-condensed">
<tr>
<th align="center">
AuctionID
</td>
<th class="white">
Image
</td>
<th class="white">
Item Name
</td>
<th class="white">
Player
</td>
<th class="white">
Count
</td>
<th class="white">
Price
</td>
<th class="white">
Buy Command
</td>
</tr>
<?php
if ($inGameAuctions) {
foreach($inGameAuctions as $auction) {
$players++;
if(is_int($players / 2)) {
$bgcolor = "black";
} else {
$bgcolor = "grey";
}
$cost = round($auction['cost']/1000, 2);
?>

<tr>
<td>
<?php echo $auction['id']; ?>
</td>
<td>
<img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
</td>
<td>
<?php echo $auction['item_name']; ?>
</td>
<td>
<a href='characterprofile?name=<?php echo $auction['name']; ?>'>
<?php echo $auction['name']; ?>
</a>
</td>
<td>
<?php echo $auction['count']; ?>
</td>
<td>
<?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
</td>
<td>
!offer buy, <?php echo $auction['id']; ?>
</td>
</tr>
<?php
}
} else {
echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
}
echo '</table>';
echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="vDk (https://otland.net/members/vdk.1553/)">vDk</a>. | Converted to ZnoteAAC and edited by <a href="HalfAway (https://otland.net/members/halfaway.142275/)">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>
 
some small corrections... now it's there.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header_index.php'; ?>

<?php
$cache = new Cache('engine/cache/ingmarket');
if ($cache->hasExpired()) {
    $inGameAuctions = mysql_select_multi('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC');
 
    $cache->setContent($inGameAuctions);
    $cache->save();
} else {
    $inGameAuctions = $cache->load();
}
$players = 0;

if (isset($_POST)) {
    if (isset($_POST['player']) && !empty($_POST['player'])) {
        $name = getValue($_POST['player']);
        $player_id = user_character_exist($name);

        $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
            return $player_id == $auction['player'];
        });
    }

    if (isset($_POST['item']) && !empty($_POST['item'])) {
        $item = getValue($_POST['item']);

        $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
            return strtolower($item) == strtolower($auction['item_name']);
        });
    }
}
?>

<table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr>
        <th>
            <b>Instruction</b>
        </th>
    </tr>
    <tr>
        <td align="center">
            <h2>Commands</h2>
            <b>!offer add, itemName, itemPrice, itemCount</b><br/>
            <small>example: !offer add, plate armor, 500, 1</small><br/><br/>
            <b>!offer buy, AuctionID</b><br/>
            <small>example: !offer buy, 1943</small><br /><br/>
            <b>!offer remove, AuctionID</b><br/>
            <small>example: !offer remove, 1943</small><br /><br/>
            <b>!offer withdraw</b><br/>
            <small>Use this command to get money for sold items.</small>
        </td>
    </tr>
</table><br/>

<form action="" method="POST">
    <input type="text" name="player" placeholder="Player..">
    <input type="text" name="item" placeholder="Item..">
    <input type="submit" value="Search">
</form>

<table width="100%" class="table table-striped table-bordered table-condensed">
    <tr>
        <th align="center">
            AuctionID
        </th>
        <th class="white">
            Image
        </th>
        <th class="white">
            Item Name
        </th>
        <th class="white">
            Player
        </th>
        <th class="white">
            Count
        </th>
        <th class="white">
            Price
        </th>
        <th class="white">
            Buy Command
        </th>
    </tr>
    <?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>
            <tr>
                <td>
                    <?php echo $auction['id']; ?>
                </td>
                <td>
                    <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                </td>
                <td>
                    <?php echo $auction['item_name']; ?>
                </td>
                <td>
                    <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                        <?php echo $auction['name']; ?>
                    </a>
                </td>
                <td>
                    <?php echo $auction['count']; ?>
                </td>
                <td>
                    <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                </td>
                <td>
                    !offer buy, <?php echo $auction['id']; ?>
                </td>
            </tr>
            <?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exist.</td></tr>';
    }
    ?>
</table>

<?php
echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php';
?>
 
some small corrections... now it's there.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header_index.php'; ?>

<?php
$cache = new Cache('engine/cache/ingmarket');
if ($cache->hasExpired()) {
    $inGameAuctions = mysql_select_multi('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC');
 
    $cache->setContent($inGameAuctions);
    $cache->save();
} else {
    $inGameAuctions = $cache->load();
}
$players = 0;

if (isset($_POST)) {
    if (isset($_POST['player']) && !empty($_POST['player'])) {
        $name = getValue($_POST['player']);
        $player_id = user_character_exist($name);

        $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
            return $player_id == $auction['player'];
        });
    }

    if (isset($_POST['item']) && !empty($_POST['item'])) {
        $item = getValue($_POST['item']);

        $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
            return strtolower($item) == strtolower($auction['item_name']);
        });
    }
}
?>

<table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr>
        <th>
            <b>Instruction</b>
        </th>
    </tr>
    <tr>
        <td align="center">
            <h2>Commands</h2>
            <b>!offer add, itemName, itemPrice, itemCount</b><br/>
            <small>example: !offer add, plate armor, 500, 1</small><br/><br/>
            <b>!offer buy, AuctionID</b><br/>
            <small>example: !offer buy, 1943</small><br /><br/>
            <b>!offer remove, AuctionID</b><br/>
            <small>example: !offer remove, 1943</small><br /><br/>
            <b>!offer withdraw</b><br/>
            <small>Use this command to get money for sold items.</small>
        </td>
    </tr>
</table><br/>

<form action="" method="POST">
    <input type="text" name="player" placeholder="Player..">
    <input type="text" name="item" placeholder="Item..">
    <input type="submit" value="Search">
</form>

<table width="100%" class="table table-striped table-bordered table-condensed">
    <tr>
        <th align="center">
            AuctionID
        </th>
        <th class="white">
            Image
        </th>
        <th class="white">
            Item Name
        </th>
        <th class="white">
            Player
        </th>
        <th class="white">
            Count
        </th>
        <th class="white">
            Price
        </th>
        <th class="white">
            Buy Command
        </th>
    </tr>
    <?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>
            <tr>
                <td>
                    <?php echo $auction['id']; ?>
                </td>
                <td>
                    <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                </td>
                <td>
                    <?php echo $auction['item_name']; ?>
                </td>
                <td>
                    <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                        <?php echo $auction['name']; ?>
                    </a>
                </td>
                <td>
                    <?php echo $auction['count']; ?>
                </td>
                <td>
                    <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                </td>
                <td>
                    !offer buy, <?php echo $auction['id']; ?>
                </td>
            </tr>
            <?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exist.</td></tr>';
    }
    ?>
</table>

<?php
echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php';
?>

I'm glad, thank you very much.

Look at one question, I don't know if it's part of the page or the script, when the player buys the item, the player who sold it doesn't receive the money, like the money is removed from the buyer and the seller doesn't receive it.
 
You are probably using an old system. Try this one, which is only compatible with TFS 1.3+.

Revscripts.​

Post automatically merged:

$inGameAuctions = mysql_select_multi('SELECT auction_system.player, auction_system.id, auction_system.item_name, auction_system.item_id, auction_system.count, auction_system.cost, auction_system.date, players.name FROM auction_system, players WHERE players.id = auction_system.player ORDER BY auction_system.id DESC');
If you are using the script I sent, revscript, then you should change "auction_system" to "trade_off_offers" or "trade_off_container_items". I'm not sure which is correct, just check the revscript and make the change to test and verify that the items on the page appear correctly.
 

Attachments

Last edited:
You are probably using an old system. Try this one, which is only compatible with TFS 1.3+.

Revscripts.​

Post automatically merged:


If you are using the script I sent, revscript, then you should change "auction_system" to "trade_off_offers" or "trade_off_container_items". I'm not sure which is correct, just check the revscript and make the change to test and verify that the items on the page appear correctly.
I downloaded the ravescript that you gave me, I added it, I didn't change 'auction_system' to 'trade_off_offers' and it didn't show any errors, I just replaced the code you gave me, but even so, the player who sells the item doesn't receive the money after another player buys the item.

Ah, for this query to be useful, I need to add it manually or not.
CREATE TABLE IF NOT EXISTS trade_off_offers (
id int unsigned NOT NULL AUTO_INCREMENT,
player_id int NOT NULL,
type tinyint unsigned NOT NULL DEFAULT '0',
item_id smallint unsigned NOT NULL,
item_count smallint unsigned NOT NULL DEFAULT '1',
item_charges int unsigned NOT NULL DEFAULT '0',
item_duration int unsigned NOT NULL DEFAULT '0',
item_name varchar(255) NOT NULL,
item_trade tinyint unsigned NOT NULL DEFAULT '0',
cost bigint unsigned NOT NULL DEFAULT '0',
cost_count smallint unsigned NOT NULL DEFAULT '1',
sold tinyint unsigned NOT NULL DEFAULT '0',
date bigint unsigned NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (player_id) REFERENCES players(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;
]])
 
Back
Top