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

AAC Enter a row with resets time.

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
550
Solutions
1
Reaction score
59
Location
Lo Mochis, Sinaloa
I already try this...

edit.png

in htdocs\system\libs\pot\OTS_Player

change
private $data = array('sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hidden' => 0);


to

private $data = array('sex' => 0, 'vocation' => 0, 'experience' => 0, 'level' => 1, 'maglevel' => 0, 'health' => 100, 'healthmax' => 100, 'mana' => 100, 'manamax' => 100, 'manaspent' => 0, 'soul' => 0, 'lookbody' => 10, 'lookfeet' => 10, 'lookhead' => 10, 'looklegs' => 10, 'looktype' => 136, 'lookaddons' => 0, 'posx' => 0, 'posy' => 0, 'posz' => 0, 'cap' => 0, 'lastlogin' => 0, 'lastip' => 0, 'save' => true, 'skulltime' => 0, 'skull' => 0, 'balance' => 0, 'lastlogout' => 0, 'blessings' => 0, 'stamina' => 0, 'online' => 0, 'comment' => '', 'created' => 0, 'hidden' => 0, 'resets' => 0);

and

// SELECT query on database
$this->data = $this->db->query('SELECT id, name, account_id, group_id, sex, vocation, experience, level, maglevel, health, healthmax, mana, manamax, manaspent, soul, lookbody, lookfeet, lookhead, looklegs, looktype' . ($this->db->hasColumn('players', 'lookaddons') ? ', lookaddons' : '') . ', posx, posy, posz, cap, lastlogin, lastlogout, lastip, save, conditions, ' . $__load['skull_time'] . ' as skulltime, ' . $__load['skull_type'] . ' as skull' . $__load['guild_info'] . ', town_id' . $__load['loss_experience'] . $__load['loss_items'] . ', balance' . ($__load['blessings'] ? ', blessings' : '') . ($__load['direction'] ? ', direction' : '') . ($__load['stamina'] ? ', stamina' : '') . ($__load['world_id'] ? ', world_id' : '') . ($__load['online'] ? ', online' : '') . ', ' . ($__load['deletion'] ? 'deletion' : 'deleted') . '' . ($__load['promotion'] ? ', promotion' : '') . ($__load['marriage'] ? ', marriage' : '') . ', comment, created, hidden FROM players WHERE id = ' . (int)$id)->fetch();


to

// SELECT query on database
$this->data = $this->db->query('SELECT id, name, account_id, group_id, sex, vocation, experience, level, maglevel, health, healthmax, mana, manamax, manaspent, soul, lookbody, lookfeet, lookhead, looklegs, looktype' . ($this->db->hasColumn('players', 'lookaddons') ? ', lookaddons' : '') . ', posx, posy, posz, cap, lastlogin, lastlogout, lastip, save, conditions, ' . $__load['skull_time'] . ' as skulltime, ' . $__load['skull_type'] . ' as skull' . $__load['guild_info'] . ', town_id' . $__load['loss_experience'] . $__load['loss_items'] . ', balance' . ($__load['blessings'] ? ', blessings' : '') . ($__load['direction'] ? ', direction' : '') . ($__load['stamina'] ? ', stamina' : '') . ($__load['world_id'] ? ', world_id' : '') . ($__load['online'] ? ', online' : '') . ', ' . ($__load['deletion'] ? 'deletion' : 'deleted') . '' . ($__load['promotion'] ? ', promotion' : '') . ($__load['marriage'] ? ', marriage' : '') . ', comment, created, hidden, resets FROM players WHERE id = ' . (int)$id)->fetch();

and add this function
public function getResets()
{
return $this->data['resets'];
}

in
htdocs\system\templates\characters.html

change (Add the bold text below Residence)

{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td>Residence:</td>
<td>{{ town }}</td>
</tr>

to

{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td>Residence:</td>
<td>{{ town }}</td>
</tr>

{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td>Resets:</td>
<td>{{ player.getResets() }}</td>
</tr>

I do all this and is not working for me, somebody can help me?
 
Debug your SQL first and see if it's even successfully pulling that resets value from the table. If it is, then the issue is the function, if not, then the issue is the DB or query.

Sanitize that query and try running it manually to see if it works.
 
Ignore all changes in OTS_Player and just add this into twig template:

{{ player.getCustomField('resets') }}
If you mean like this:

HTML:
            {% set rows = rows + 1 %}
            <tr bgcolor="{{ getStyle(rows) }}">
                <td>Resets:</td>
                <td>{{ player.getCustomField('resets') }}</td>
            </tr>

It didn't work


right.png
As you can see, I use the name of 'resets' in my database
 
Back
Top