Ir para conteúdo
  • Cadastre-se

(Resolvido)[GESIOR] ME AJUDEM É URGENTE !


Ir para solução Resolvido por vankk,

Posts Recomendados

Estou tentando criar um website para meu OT, estou usando o XAMPP 1.7.3, o Gesior é compatível com o otserv, porém está surgindo um erro no STEP 4

 

STEP 5 -->  Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\account.php on line 30

 

Ja fui em Index.php e alterei está linha:

 // DATABASE
include_once('./system/load.database.php');
if(DEBUG_DATABASE)
    Website::getDBHandle()->setPrintQueries(true);
// DATABASE END

 

O ''true'' estava false, pesquisei em outras perguntas e o pessoal diz para alterar de false para true, porém meu problema não foi resolvido.

 

Meu OT é TFS 0.4

 

Por favor pessoal, tentem me ajudar, estou com um trabalho realmente muito legal, mas esse problema está atrapalhando muito, e não acho sua solução.

 

ESTAREI DANDO REP+ PARA AQUELE QUE AO MINIMO TENTAR ME AJUDAR.

 

 

EE

minions gif.gif

Editado por Werner
Errei o Step. (veja o histórico de edições)

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Posta a linha 30 do account.php

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
22 minutos atrás, vankk disse:

Posta a linha 30 do account.php

        Linha 30:

      $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
 

 

-> acho que tem alguma coisa a ver com o comando ->query, que acho que significa que tenta se conectar ao banco de dados.

 

*Errei o step no post, ja arrumei, esse erro da no STEP 5 quando tento definir o email da conta admin do site.

Editado por Werner (veja o histórico de edições)

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Posta todo o account.php, está precisando de algumas lines para eu checar o problema.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
1 minuto atrás, vankk disse:

Posta todo o account.php, está precisando de algumas lines para eu checar o problema.

Citar

<?php
if(!defined('INITIALIZED'))
    exit;
class Account extends ObjectData
{
    const LOADTYPE_ID = 'id';
    const LOADTYPE_NAME = 'name';
    const LOADTYPE_MAIL = 'email';
    public static $table = 'accounts';
    public $data = array('name' => null, 'password' => null, 'premdays' => null, 'lastday' => null, 'email' => null, 'key' => null, 'group_id' => null, 'create_ip' => null, 'create_date' => null, 'premium_points' => null, 'page_access' => null, 'location' => null, 'rlname' => null, 'email_new' => null, 'email_new_time' => null, 'email_code' => null, 'next_email' => null, 'last_post' => null, 'flag' => null);
    public static $fields = array('id', 'name', 'password', 'premdays', 'lastday', 'email', 'key', 'group_id', 'create_ip', 'create_date', 'premium_points', 'page_access', 'location', 'rlname', 'email_new', 'email_new_time', 'email_code', 'next_email', 'last_post', 'flag');
    public $players;
    public $playerRanks;
    public $guildAccess;
    public $bans;
    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
        if($search_text != null)
            $this->load($search_text, $search_by);
    }
    public function load($search_text, $search_by = self::LOADTYPE_ID)
    {
        if(in_array($search_by, self::$fields))
            $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
        else
            new Error_Critic('', 'Wrong Account search_by type.');
        $fieldsArray = array();
        foreach(self::$fields as $fieldName)
            $fieldsArray[$fieldName] = $this->getDatabaseHandler()->fieldName($fieldName);
        $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
    }
    public function loadById($id)
    {
        $this->load($id, 'id');
    }
    public function loadByName($name)
    {
        $this->load($name, 'name');
    }
    public function loadByEmail($mail)
    {
        $this->load($mail, 'email');
    }
    public function save($forceInsert = false)
    {
        if(!isset($this->data['id']) || $forceInsert)
        {
            $keys = array();
            $values = array();
            foreach(self::$fields as $key)
                if($key != 'id')
                {
                    $keys[] = $this->getDatabaseHandler()->fieldName($key);
                    $values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
                }
            $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
            $this->setID($this->getDatabaseHandler()->lastInsertId());
        }
        else
        {
            $updates = array();
            foreach(self::$fields as $key)
                if($key != 'id')
                    $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
            $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
        }
    }
    public function getPlayers($forceReload = false)
    {
        if(!isset($this->players) || $forceReload)
        {
            $this->players = new DatabaseList('Player');
            $this->players->setFilter(new SQL_Filter(new SQL_Field('account_id'), SQL_Filter::EQUAL, $this->getID()));
            $this->players->addOrder(new SQL_Order(new SQL_Field('name')));
        }
        return $this->players;
    }
    public function getGuildRanks($forceReload = false)
    {
        if(!isset($this->playerRanks) || $forceReload)
        {
            $this->playerRanks = new DatabaseList('AccountGuildRank');
            $filterAccount = new SQL_Filter(new SQL_Field('account_id', 'players'), SQL_Filter::EQUAL, $this->getID());
            $filterPlayer = new SQL_Filter(new SQL_Field('rank_id', 'players'), SQL_Filter::EQUAL, new SQL_Field('id', 'guild_ranks'));
            $filterGuild = new SQL_Filter(new SQL_Field('guild_id', 'guild_ranks'), SQL_Filter::EQUAL, new SQL_Field('id', 'guilds'));
            $filter = new SQL_Filter($filterAccount, SQL_Filter::CRITERIUM_AND, $filterPlayer);
            $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterGuild);
            $this->playerRanks->setFilter($filter);
        }
        return $this->playerRanks;
    }
    public function loadGuildAccess($forceReload = false)
    {
        if(!isset($this->guildAccess) || $forceReload)
        {
            $this->guildAccess = array();
            foreach($this->getGuildRanks($forceReload) as $rank)
                if($rank->getOwnerID() == $rank->getPlayerID())
                    $this->guildAccess[$rank->getGuildID()] = Guild::LEVEL_OWNER;
                elseif(!isset($this->guildAccess[$rank->getGuildID()]) || $rank->getLevel() > $this->guildAccess[$rank->getGuildID()])
                    $this->guildAccess[$rank->getGuildID()] = $rank->getLevel();
        }
    }
    public function isInGuild($guildId, $forceReload = false)
    {
        $this->loadGuildAccess($forceReload);
        return isset($this->guildAccess[$guildId]);
    }
    public function getGuildLevel($guildId, $forceReload = false)
    {
        $this->loadGuildAccess($forceReload);
        if(isset($this->guildAccess[$guildId]))
            return $this->guildAccess[$guildId];
        else
            return 0;
    }
    public function unban()
    {
        $bans = new DatabaseList('Ban');
        $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_ACCOUNT);
        $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
        $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
        $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
        $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
        $bans->setFilter($filter);
        foreach($bans as $ban)
        {
            $ban->setActive(0);
            $ban->save();
        }
    }
    public function loadBans($forceReload = false)
    {
        if(!isset($this->bans) || $forceReload)
        {
            $this->bans = new DatabaseList('Ban');
            $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_ACCOUNT);
            $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
            $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
            $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
            $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
            $this->bans->setFilter($filter);
        }
    }
    public function isBanned($forceReload = false)
    {
        $this->loadBans($forceReload);
        $isBanned = false;
        foreach($this->bans as $ban)
        {
            if($ban->getExpires() <= 0 || $ban->getExpires() > time())
                $isBanned = true;
        }
        return $isBanned;
    }
    public function getBanTime($forceReload = false)
    {
        $this->loadBans($forceReload);
        $lastExpires = 0;
        foreach($bans as $ban)
        {
            if($ban->getExpires() <= 0)
            {
                $lastExpires = 0;
                break;
            }
            if($ban->getExpires() > time() && $ban->getExpires() > $lastExpires)
                $lastExpires = $ban->getExpires();
        }
        return $lastExpires;
    }
    public function delete()
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
        unset($this->data['id']);
    }
    public function setID($value){$this->data['id'] = $value;}
    public function getID(){return $this->data['id'];}
    public function setName($value){$this->data['name'] = $value;}
    public function getName(){return $this->data['name'];}
    public function setPassword($value)
    {
        $this->data['password'] = Website::encryptPassword($value, $this);
    }
    public function getPassword(){return $this->data['password'];}
    public function setPremDays($value){$this->data['premdays'] = $value;}
    public function getPremDays(){return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));}
    public function setLastDay($value){$this->data['lastday'] = $value;}
    public function getLastDay(){return $this->data['lastday'];}
    public function setMail($value){$this->data['email'] = $value;}
    public function getMail(){return $this->data['email'];}
    public function setKey($value){$this->data['key'] = $value;}
    public function getKey(){return $this->data['key'];}
    public function setGroupID($value){$this->data['group_id'] = $value;}
    public function getGroupID(){return $this->data['group_id'];}
/*
 * Custom AAC fields
 * create_ip , INT, default 0
 * create_date , INT, default 0
 * premium_points , INT, default 0
 * page_access, INT, default 0
 * location, VARCHAR(255), default ''
 * rlname, VARCHAR(255), default ''
*/
    public function setCreateIP($value){$this->data['create_ip'] = $value;}
    public function getCreateIP(){return $this->data['create_ip'];}
    public function setCreateDate($value){$this->data['create_date'] = $value;}
    public function getCreateDate(){return $this->data['create_date'];}
    public function setPremiumPoints($value){$this->data['premium_points'] = $value;}
    public function getPremiumPoints(){return $this->data['premium_points'];}
    public function setPageAccess($value){$this->data['page_access'] = $value;}
    public function getPageAccess(){return $this->data['page_access'];}
    
    public function setLocation($value){$this->data['location'] = $value;}
    public function getLocation(){return $this->data['location'];}
    public function setRLName($value){$this->data['rlname'] = $value;}
    public function getRLName(){return $this->data['rlname'];}
    public function setFlag($value){$this->data['flag'] = $value;}
    public function getFlag(){return $this->data['flag'];}
/*
 * for compability with old scripts
*/
    public function getGroup(){return $this->getGroupID();}
    public function setGroup($value){$this->setGroupID($value);}
    public function getEMail(){return $this->getMail();}
    public function setEMail($value){$this->setMail($value);}
    public function getPlayersList(){return $this->getPlayers();}
    public function getGuildAccess($guildID){return $this->getGuildLevel($guildID);}
    public function isValidPassword($password)
    {
        return ($this->data['password'] == Website::encryptPassword($password, $this));
    }
    public function find($name){$this->loadByName($name);}
    public function findByEmail($email){$this->loadByEmail($email);}
    public function isPremium(){return ($this->getPremDays() > 0);}
    public function getLastLogin(){return $this->getLastDay();}
}

 

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Confere no phpmyadmin na estrutura de accounts se existe todas as tabelas que possui na linha 11. Se faltar alguma, comenta logo abaixo.

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
2 minutos atrás, vankk disse:

Confere no phpmyadmin na estrutura de accounts se existe todas as tabelas que possui na linha 11. Se faltar alguma, comenta logo abaixo.

Ainda sou iniciante, não sei se sou tão burro, mas não estou encontrando a table accounts. veja a imagem e ve se ela foi adicionada.

 

phpadmin.png

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Está faltando as tabelas do TFS, você só instalou as do Gesior :p

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
1 minuto atrás, vankk disse:

Está faltando as tabelas do TFS, você só instalou as do Gesior :p

Sei que não pedi isso no tópico, mas ainda sou muito noob, você poderia me dizer como eu instalo as tabelas do TFS ?

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Você tem que pegar o schema.sql para o seu servidor utilizar 0.4 ou 1.x, dependendo da versão, você simplesmente importa a schema.sql na sua database.

 

Se você utilizar 0.4 você pode utilizar a schema do server do @Sekk

https://raw.githubusercontent.com/s3kk/Heromassa/master/schemas/war_cast_mysql.sql

 

Só lembre de limpar as tabelas.

 

*edit

@Sekk

Limpa as tabelas :p

Editado por vankk (veja o histórico de edições)

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
7 minutos atrás, vankk disse:

Você tem que pegar o schema.sql para o seu servidor utilizar 0.4 ou 1.x, dependendo da versão, você simplesmente importa a schema.sql na sua database.

 

Se você utilizar 0.4 você pode utilizar a schema do server do @Sekk

https://raw.githubusercontent.com/s3kk/Heromassa/master/schemas/war_cast_mysql.sql

 

Só lembre de limpar as tabelas.

 

*edit

@Sekk

Limpa as tabelas :p

 

 

 

o meu servidoré 0.4, abri o link que me mandou, devo copia-lo e salvalo como schema.sql e importar la na minha databse ? se não o que devo fazer ?

 

EDIT: CONSEGUI ADICIONAR LA CERTINHO, E AGORA QUAL O PROXIMO PASSO ?

Editado por Werner (veja o histórico de edições)

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites
7 minutos atrás, vankk disse:

você simplesmente importa a schema.sql na sua database.

 

 

Acho que isso responde sua pergunta :p

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
1 minuto atrás, vankk disse:

 

Acho que isso responde sua pergunta :p

Consegui, mas não sei se você consegue me ajudar com só mais uma coisa: no STEP 4 aparece isso:

AAC installation is disabled. To enable it make file install.php in main AAC directory and put there your IP.

 

Eu consegui colocar a senha mas o site não abre quando tento abrir acontece isso:

Citar
Query: SELECT `id`, `name`, `password`, `premdays`, `lastday`, `email`, `key`, `group_id`, `create_ip`, `create_date`, `premium_points`, `page_access`, `location`, `rlname`, `email_new`, `email_new_time`, `email_code`, `next_email`, `last_post`, `flag` FROM `accounts` WHERE `name` = '1'
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4;
SQLSTATE: 42S22
Driver code: 1054
Error message: Unknown column 'g.logo_gfx_name' in 'field list'


Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\pages\latestnews.php on line 32

 

Query: SELECT
SQLSTATE: 42000
Driver code: 1064
Error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: SELECT `date` FROM `z_news_tickers` WHERE `hide_ticker` = '0'
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 5;
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT * FROM z_featured_article ORDER BY id DESC LIMIT 1
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `players`.`id`, `players`.`name`, `players`.`world_id`, `players`.`group_id`, `players`.`account_id`, `players`.`level`, `players`.`vocation`, `players`.`health`, `players`.`healthmax`, `players`.`experience`, `players`.`lookbody`, `players`.`lookfeet`, `players`.`lookhead`, `players`.`looklegs`, `players`.`looktype`, `players`.`lookaddons`, `players`.`maglevel`, `players`.`mana`, `players`.`manamax`, `players`.`manaspent`, `players`.`soul`, `players`.`town_id`, `players`.`posx`, `players`.`posy`, `players`.`posz`, `players`.`conditions`, `players`.`cap`, `players`.`sex`, `players`.`lastlogin`, `players`.`lastip`, `players`.`save`, `players`.`skull`, `players`.`skulltime`, `players`.`rank_id`, `players`.`guildnick`, `players`.`lastlogout`, `players`.`blessings`, `players`.`balance`, `players`.`stamina`, `players`.`direction`, `players`.`loss_experience`, `players`.`loss_mana`, `players`.`loss_skills`, `players`.`loss_containers`, `players`.`loss_items`, `players`.`premend`, `players`.`online`, `players`.`marriage`, `players`.`promotion`, `players`.`deleted`, `players`.`description`, `players`.`create_ip`, `players`.`create_date`, `players`.`comment`, `players`.`hide_char`, `players`.`signature` FROM `players` WHERE `account_id` = '1' ORDER BY `name` ASC
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `players`.`name`, `z_forum`.`post_text`, `z_forum`.`post_topic`, `z_forum`.`icon_id`, `z_forum`.`post_smile`, `z_forum`.`id`, `z_forum`.`replies`, `z_forum`.`post_date` FROM `players`, `z_forum` WHERE `players`.`id` = `z_forum`.`author_guid` AND `z_forum`.`section` = 1 AND `z_forum`.`first_post` = `z_forum`.`id` ORDER BY `z_forum`.`last_post` DESC LIMIT 6
SQLSTATE: 42S22
Driver code: 1054
Error message: Unknown column 'z_forum.icon_id' in 'field list'


Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\pages\latestnews.php on line 512

 

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

Leia o erro do install, que você conseguirá.

 AAC installation is disabled. To enable it make file install.php in main AAC directory and put there your IP.

 

E utilize esses comandos no SQL

ALTER TABLE `guilds` ADD `logo_gfx_name` varchar(255) NOT NULL DEFAULT '';
CREATE TABLE IF NOT EXISTS `z_forum` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sticky` tinyint(1) NOT NULL DEFAULT '0',
`closed` tinyint(1) NOT NULL DEFAULT '0',
`first_post` int(11) NOT NULL DEFAULT '0',
`last_post` int(11) NOT NULL DEFAULT '0',
`section` int(3) NOT NULL DEFAULT '0',
`replies` int(20) NOT NULL DEFAULT '0',
`views` int(20) NOT NULL DEFAULT '0',
`author_aid` int(20) NOT NULL DEFAULT '0',
`author_guid` int(20) NOT NULL DEFAULT '0',
`post_text` text NOT NULL,
`post_topic` varchar(255) NOT NULL,
`post_smile` tinyint(1) NOT NULL DEFAULT '0',
`post_date` int(20) NOT NULL DEFAULT '0',
`last_edit_aid` int(20) NOT NULL DEFAULT '0',
`edit_date` int(20) NOT NULL DEFAULT '0',
`post_ip` varchar(32) NOT NULL DEFAULT '0.0.0.0',
PRIMARY KEY (`id`),
KEY `section` (`section`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
1 minuto atrás, vankk disse:

Leia o erro do install, que você conseguirá.

 AAC installation is disabled. To enable it make file install.php in main AAC directory and put there your IP.

 

E utilize esses comandos no SQL


ALTER TABLE `guilds` ADD `logo_gfx_name` varchar(255) NOT NULL DEFAULT '';

CREATE TABLE IF NOT EXISTS `z_forum` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sticky` tinyint(1) NOT NULL DEFAULT '0',
`closed` tinyint(1) NOT NULL DEFAULT '0',
`first_post` int(11) NOT NULL DEFAULT '0',
`last_post` int(11) NOT NULL DEFAULT '0',
`section` int(3) NOT NULL DEFAULT '0',
`replies` int(20) NOT NULL DEFAULT '0',
`views` int(20) NOT NULL DEFAULT '0',
`author_aid` int(20) NOT NULL DEFAULT '0',
`author_guid` int(20) NOT NULL DEFAULT '0',
`post_text` text NOT NULL,
`post_topic` varchar(255) NOT NULL,
`post_smile` tinyint(1) NOT NULL DEFAULT '0',
`post_date` int(20) NOT NULL DEFAULT '0',
`last_edit_aid` int(20) NOT NULL DEFAULT '0',
`edit_date` int(20) NOT NULL DEFAULT '0',
`post_ip` varchar(32) NOT NULL DEFAULT '0.0.0.0',
PRIMARY KEY (`id`),
KEY `section` (`section`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

Onde é esse AAC Directory ? "desculpa sou noob d+"

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites
  • Solução

A pasta htdocs do xampp? xddd

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites
3 minutos atrás, vankk disse:

A pasta htdocs do xampp? xddd

Quando abro a pasta htdocs vejo o install.php, mas não sei onde devo colocar esses códigos que você me enviou. vou colocar meu install.php aqui,se você pudesse fazer isso para mim agradeceria muito !!

Citar

<?PHP
define('INITIALIZED', true);
define('ONLY_PAGE', false);
if(!file_exists('install.txt'))
{
    echo('AAC installation is disabled. To enable it make file <b>install.php</b> in main AAC directory and put there your IP.');
    exit;
}
$installIP = trim(file_get_contents('install.txt'));
if($installIP != $_SERVER['REMOTE_ADDR'])
{
    echo('In file <b>install.txt</b> must be your IP!<br />In file is:<br /><b>' . $installIP . '</b><br />Your IP is:<br /><b>' . $_SERVER['REMOTE_ADDR'] . '</b>');
    exit;
}

$time_start = microtime(true);
session_start();

function autoLoadClass($className)
{
    if(!class_exists($className))
        if(file_exists('./classes/' . strtolower($className) . '.php'))
            include_once('./classes/' . strtolower($className) . '.php');
        else
            new Error_Critic('#E-7', 'Cannot load class <b>' . $className . '</b>, file <b>./classes/class.' . strtolower($className) . '.php</b> doesn\'t exist');
}
spl_autoload_register('autoLoadClass');

//load acc. maker config to $config['site']
$config = array();
include('./config/config.php');
if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while(list($key, $val) = each($process))
    {
        foreach ($val as $k => $v)
        {
            unset($process[$key][$k]);
            if(is_array($v))
            {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            }
            else
                $process[$key][stripslashes($k)] = stripslashes($v);
        }
    }
    unset($process);
}

$page = '';
if(isset($_REQUEST['page']))
    $page = $_REQUEST['page'];
$step = 'start';
if(isset($_REQUEST['step']))
    $step = $_REQUEST['step'];
// load server path
function getServerPath()
{
    $config = array();
    include('./config/config.php');
    return $config['site']['serverPath'];
}
// save server path
function setServerPath($newPath)
{
    $file = fopen("./config/config.php", "r");
    $lines = array();
    while (!feof($file)) {
        $lines[] = fgets($file);
    }
    fclose($file);

    $newConfig = array();
    foreach ($lines as $i => $line)
    {
        if(substr($line, 0, strlen('$config[\'site\'][\'serverPath\']')) == '$config[\'site\'][\'serverPath\']')
            $newConfig[] = '$config[\'site\'][\'serverPath\'] = "' . str_replace('"', '\"' , $newPath) . '";' . PHP_EOL; // do something with each line from text file here
        else
            $newConfig[] = $line;
    }
    Website::putFileContents("./config/config.php", implode('', $newConfig));
}
if($page == '')
{
    echo '<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
        <title>Installation of account maker</title>
    </head>
    <frameset cols="230,*">
        <frame name="menu" src="install.php?page=menu" />
        <frame name="step" src="install.php?page=step&step=start" />
        <noframes><body>Frames don\'t work. Install Firefox :P</body></noframes>
    </frameset>
    </html>';
}
elseif($page == 'menu')
{
    echo '<h2>MENU</h2><br>
    <b>IF NOT INSTALLED:</b><br>
    <a href="install.php?page=step&step=start" target="step">0. Informations</a><br>
    <a href="install.php?page=step&step=1" target="step">1. Set server path</a><br>
    <a href="install.php?page=step&step=2" target="step">2. Check DataBase connection</a><br>
    <a href="install.php?page=step&step=3" target="step">3. Add tables and columns to DB</a><br>
    <a href="install.php?page=step&step=4" target="step">4. Add samples to DB</a><br>
    <a href="install.php?page=step&step=5" target="step">5. Set Admin Account</a><br>
    <b>Author:</b><br>
    Gesior<br>
    Compatible with TFS 0.3.6 and TFS 0.4 up to revision 3702</a>';
}
elseif($page == 'step')
{
    if($step >= 2 && $step <= 5)
    {
        //load server config $config['server']
        if(Website::getWebsiteConfig()->getValue('useServerConfigCache'))
        {
            // use cache to make website load faster
            if(Website::fileExists('./config/server.config.php'))
            {
                $tmp_php_config = new ConfigPHP('./config/server.config.php');
                $config['server'] = $tmp_php_config->getConfig();
            }
            else
            {
                // if file isn't cache we should load .lua file and make .php cache
                $tmp_lua_config = new ConfigLUA(Website::getWebsiteConfig()->getValue('serverPath') . 'config.lua');
                $config['server'] = $tmp_lua_config->getConfig();
                $tmp_php_config = new ConfigPHP();
                $tmp_php_config->setConfig($tmp_lua_config->getConfig());
                $tmp_php_config->saveToFile('./config/server.config.php');
            }
        }
        else
        {
            $tmp_lua_config = new ConfigLUA(Website::getWebsiteConfig()->getValue('serverPath') . 'config.lua');
            $config['server'] = $tmp_lua_config->getConfig();
        }
        if(Website::getServerConfig()->isSetKey('mysqlHost'))
        {
            define('SERVERCONFIG_SQL_TYPE', 'sqlType');
            define('SERVERCONFIG_SQL_HOST', 'mysqlHost');
            define('SERVERCONFIG_SQL_PORT', 'mysqlPort');
            define('SERVERCONFIG_SQL_USER', 'mysqlUser');
            define('SERVERCONFIG_SQL_PASS', 'mysqlPass');
            define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase');
            define('SERVERCONFIG_SQLITE_FILE', 'sqlFile');
        }
        elseif(Website::getServerConfig()->isSetKey('sqlHost'))
        {
            define('SERVERCONFIG_SQL_TYPE', 'sqlType');
            define('SERVERCONFIG_SQL_HOST', 'sqlHost');
            define('SERVERCONFIG_SQL_PORT', 'sqlPort');
            define('SERVERCONFIG_SQL_USER', 'sqlUser');
            define('SERVERCONFIG_SQL_PASS', 'sqlPass');
            define('SERVERCONFIG_SQL_DATABASE', 'sqlDatabase');
            define('SERVERCONFIG_SQLITE_FILE', 'sqlFile');
        }
        else
            new Error_Critic('#E-3', 'There is no key <b>sqlHost</b> or <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>')));
        if(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_TYPE) == 'mysql')
        {
            Website::setDatabaseDriver(Database::DB_MYSQL);
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST))
                Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT))
                Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE))
                Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER))
                Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS))
                Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
        }
        elseif(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_TYPE) == 'sqlite')
        {
            Website::setDatabaseDriver(Database::DB_SQLITE);
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQLITE_FILE))
                Website::getDBHandle()->setDatabaseFile(Website::getServerConfig()->getValue(SERVERCONFIG_SQLITE_FILE));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQLITE_FILE . '</b> in server config file.');
        }
        elseif(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_TYPE) == 'pgsql')
        {
            // does pgsql use 'port' parameter? I don't know
            Website::setDatabaseDriver(Database::DB_PGSQL);
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST))
                Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE))
                Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER))
                Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
            if(Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS))
                Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
            else
                new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
        }
        else
            new Error_Critic('#E-6', 'Database error. Unknown database type in <b>server config</b> . Must be equal to: "<b>mysql</b>", "<b>sqlite</b>" or "<b>pgsql</b>" . Now is: "<b>' . Website::getServerConfig()->getValue(SERVERCONFIG_SQL_TYPE) . '</b>"');
        Website::setPasswordsEncryption(Website::getServerConfig()->getValue('encryptionType'));
        $SQL = Website::getDBHandle();
    }

    if($step == 'start')
    {
        echo '<h1>STEP '.$step.'</h1>Informations<br>';
        echo 'Welcome to Gesior Account Maker installer. <b>After 5 simple steps account maker will be ready to use!</b><br />';
        // check access to write files
        $writeable = array('config/config.php', 'cache', 'cache/flags', 'cache/DONT_EDIT_usercounter.txt', 'cache/DONT_EDIT_serverstatus.txt', 'custom_scripts', 'install.txt');
        foreach($writeable as $fileToWrite)
        {
            if(is_writable($fileToWrite))
                echo '<span style="color:green">CAN WRITE TO FILE: <b>' . $fileToWrite . '</b></span><br />';
            else
                echo '<span style="color:red">CANNOT WRITE TO FILE: <b>' . $fileToWrite . '</b> - edit file access for PHP [on linux: chmod]</span><br />';
        }
    }
    elseif($step == 1)
    {
        if(isset($_REQUEST['server_path']))
        {
            echo '<h1>STEP '.$step.'</h1>Check server configuration<br>';
            $path = $_REQUEST['server_path'];
            $path = trim($path)."\\";
            $path = str_replace("\\\\", "/", $path);
            $path = str_replace("\\", "/", $path);
            $path = str_replace("//", "/", $path);
            setServerPath($path);
            $tmp_lua_config = new ConfigLUA($path . 'config.lua');
            $config['server'] = $tmp_lua_config->getConfig();
            if(isset($config['server']['sqlType']))
            {
                echo 'File <b>config.lua</b> loaded from <font color="red"><i>'.$path.'config.lua</i></font>. It looks like fine server config file. Now you can check database('.$config['server']['sqlType'].') connection: <a href="install.php?page=step&step=2">STEP 2 - check database connection</a>';
            }
            else
            {
                echo 'File <b>config.lua</b> loaded from <font color="red"><i>'.$path.'config.lua</i></font> and it\'s not valid TFS config.lua file. <a href="install.php?page=step&step=1">Go to STEP 1 - select other directory.</a> If it\'s your config.lua file from TFS contact with acc. maker author.';
            }
        }
        else
        {
            echo 'Please write you TFS directory below. Like: <i>C:\Documents and Settings\Gesior\Desktop\TFS 0.2.9\</i><form action="install.php">
            <input type="text" name="server_path" size="90" value="'.htmlspecialchars(getServerPath()).'" /><input type="hidden" name="page" value="step" /><input type="hidden" name="step" value="1" /><input type="submit" value="Set server path" />
            </form>';
        }
    }
    elseif($step == 2)
    {
        echo '<h1>STEP '.$step.'</h1>Check database connection<br>';
        echo 'If you don\'t see any errors press <a href="install.php?page=step&step=3">link to STEP 3 - Add tables and columns to DB</a>. If you see some errors it mean server has wrong configuration. Check FAQ or ask author of acc. maker.<br />';
        $SQL->connect(); // show errors if can't connect
    }
    elseif($step == 3)
    {
        echo '<h1>STEP '.$step.'</h1>Add tables and columns to DB<br>';
        echo 'Installer try to add new tables and columns to database.<br>';
        $columns = array();
        //$columns[] = array('table', 'name_of_column', 'type', 'length', 'default');
        $columns[] = array('accounts', 'key', 'VARCHAR', '20', '0');
        $columns[] = array('accounts', 'email_new', 'VARCHAR', '255', '');
        $columns[] = array('accounts', 'email_new_time', 'INT', '11', '0');
        $columns[] = array('accounts', 'rlname', 'VARCHAR', '255', '');
        $columns[] = array('accounts', 'location', 'VARCHAR', '255', '');
        $columns[] = array('accounts', 'page_access', 'INT', '11', '0');
        $columns[] = array('accounts', 'email_code', 'VARCHAR', '255', '');
        $columns[] = array('accounts', 'next_email', 'INT', '11', '0');
        $columns[] = array('accounts', 'premium_points', 'INT', '11', '0');
        $columns[] = array('accounts', 'create_date', 'INT', '11', '0');
        $columns[] = array('accounts', 'create_ip', 'INT', '11', '0');
        $columns[] = array('accounts', 'last_post', 'INT', '11', '0');
        $columns[] = array('accounts', 'flag', 'VARCHAR', '80', '');
        $columns[] = array('accounts', 'guild_points', 'INT', '11', '0');
        $columns[] = array('accounts', 'vip_time', 'INT', '15', '0');

        $columns[] = array('guilds', 'description', 'TEXT', '', '');
        $columns[] = array('guilds', 'guild_logo', 'MEDIUMBLOB', '', NULL);
        $columns[] = array('guilds', 'create_ip', 'INT', '11', '0');
        $columns[] = array('guilds', 'balance', 'BIGINT UNSIGNED', '', '0');
        $columns[] = array('killers', 'war', 'INT', '11', '0');

        $columns[] = array('players', 'deleted', 'TINYINT', '1', '0');
        $columns[] = array('players', 'description', 'VARCHAR', '255', '');
        $columns[] = array('players', 'comment', 'TEXT', '', '');
        $columns[] = array('players', 'create_ip', 'INT', '11', '0');
        $columns[] = array('players', 'create_date', 'INT', '11', '0');
        $columns[] = array('players', 'hide_char', 'INT', '11', '0');
        $columns[] = array('players', 'signature', 'TEXT', '', '');

        $tables = array();
        // mysql tables
        $tables[Database::DB_MYSQL]['z_ots_comunication'] = "CREATE TABLE `z_ots_comunication` (
                              `id` int(11) NOT NULL auto_increment,
                              `name` varchar(255) NOT NULL,
                              `type` varchar(255) NOT NULL,
                              `action` varchar(255) NOT NULL,
                              `param1` varchar(255) NOT NULL,
                              `param2` varchar(255) NOT NULL,
                              `param3` varchar(255) NOT NULL,
                              `param4` varchar(255) NOT NULL,
                              `param5` varchar(255) NOT NULL,
                              `param6` varchar(255) NOT NULL,
                              `param7` varchar(255) NOT NULL,
                              `delete_it` int(2) NOT NULL default '1',
                               PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_ots_guildcomunication'] = "CREATE TABLE `z_ots_guildcomunication` (
                              `id` int(11) NOT NULL auto_increment,
                              `name` varchar(255) NOT NULL,
                              `type` varchar(255) NOT NULL,
                              `action` varchar(255) NOT NULL,
                              `param1` varchar(255) NOT NULL,
                              `param2` varchar(255) NOT NULL,
                              `param3` varchar(255) NOT NULL,
                              `param4` varchar(255) NOT NULL,
                              `param5` varchar(255) NOT NULL,
                              `param6` varchar(255) NOT NULL,
                              `param7` varchar(255) NOT NULL,
                              `delete_it` int(2) NOT NULL default '1',
                               PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_polls'] = "CREATE TABLE `z_polls` (
                              `id` int(11) NOT NULL AUTO_INCREMENT,
                                `question` varchar(255) NOT NULL,
                              `end` int(11) NOT NULL,
                                `start` int(11) NOT NULL,
                                `answers` int(11) NOT NULL,
                                `votes_all` int(11) NOT NULL,
                                 PRIMARY KEY (`id`)
                             ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
        $tables[Database::DB_MYSQL]['accounts'] = "ALTER TABLE `accounts` ADD `vote` INT( 11 ) NOT NULL ;";
        $tables[Database::DB_MYSQL]['z_polls_answers'] = "CREATE TABLE `z_polls_answers` (
                              `poll_id` int(11) NOT NULL,
                              `answer_id` int(11) NOT NULL,
                              `answer` varchar(255) NOT NULL,
                              `votes` int(11) NOT NULL
                            ) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_network_box'] = "CREATE TABLE `z_network_box` (
                             `id` int(11) NOT NULL AUTO_INCREMENT,
                               `network_name` varchar(10) NOT NULL,
                               `network_link` varchar(50) NOT NULL,
                                PRIMARY KEY (`id`)
                             ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
        $tables[Database::DB_MYSQL]['z_shop_offer'] = "CREATE TABLE `z_shop_offer` (
                              `id` int(11) NOT NULL auto_increment,
                              `points` int(11) NOT NULL default '0',
                              `itemid1` int(11) NOT NULL default '0',
                              `count1` int(11) NOT NULL default '0',
                              `itemid2` int(11) NOT NULL default '0',
                              `count2` int(11) NOT NULL default '0',
                              `offer_type` varchar(255) default NULL,
                              `offer_description` text NOT NULL,
                              `offer_name` varchar(255) NOT NULL,
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_shop_history_pacc'] = "CREATE TABLE `z_shop_history_pacc` (
                              `id` int(11) NOT NULL auto_increment,
                              `to_name` varchar(255) NOT NULL default '0',
                              `to_account` int(11) NOT NULL default '0',
                              `from_nick` varchar(255) NOT NULL,
                              `from_account` int(11) NOT NULL default '0',
                              `price` int(11) NOT NULL default '0',
                              `pacc_days` int(11) NOT NULL default '0',
                              `trans_state` varchar(255) NOT NULL,
                              `trans_start` int(11) NOT NULL default '0',
                              `trans_real` int(11) NOT NULL default '0',
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_shop_history_item'] = "CREATE TABLE `z_shop_history_item` (
                              `id` int(11) NOT NULL auto_increment,
                              `to_name` varchar(255) NOT NULL default '0',
                              `to_account` int(11) NOT NULL default '0',
                              `from_nick` varchar(255) NOT NULL,
                              `from_account` int(11) NOT NULL default '0',
                              `price` int(11) NOT NULL default '0',
                              `offer_id` varchar(255) NOT NULL default '',
                              `trans_state` varchar(255) NOT NULL,
                              `trans_start` int(11) NOT NULL default '0',
                              `trans_real` int(11) NOT NULL default '0',
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_shopguild_offer'] = "CREATE TABLE `z_shopguild_offer` (
                              `id` int(11) NOT NULL auto_increment,
                              `points` int(11) NOT NULL default '0',
                              `itemid1` int(11) NOT NULL default '0',
                              `count1` int(11) NOT NULL default '0',
                              `itemid2` int(11) NOT NULL default '0',
                              `count2` int(11) NOT NULL default '0',
                              `offer_type` varchar(255) default NULL,
                              `offer_description` text NOT NULL,
                              `offer_name` varchar(255) NOT NULL,
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_shopguild_history_pacc'] = "CREATE TABLE `z_shopguild_history_pacc` (
                              `id` int(11) NOT NULL auto_increment,
                              `to_name` varchar(255) NOT NULL default '0',
                              `to_account` int(11) NOT NULL default '0',
                              `from_nick` varchar(255) NOT NULL,
                              `from_account` int(11) NOT NULL default '0',
                              `price` int(11) NOT NULL default '0',
                              `pacc_days` int(11) NOT NULL default '0',
                              `trans_state` varchar(255) NOT NULL,
                              `trans_start` int(11) NOT NULL default '0',
                              `trans_real` int(11) NOT NULL default '0',
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_shop_historyguild_item'] = "CREATE TABLE `z_shopguild_history_item` (
                              `id` int(11) NOT NULL auto_increment,
                              `to_name` varchar(255) NOT NULL default '0',
                              `to_account` int(11) NOT NULL default '0',
                              `from_nick` varchar(255) NOT NULL,
                              `from_account` int(11) NOT NULL default '0',
                              `price` int(11) NOT NULL default '0',
                              `offer_id` varchar(255) NOT NULL default '',
                              `trans_state` varchar(255) NOT NULL,
                              `trans_start` int(11) NOT NULL default '0',
                              `trans_real` int(11) NOT NULL default '0',
                              PRIMARY KEY  (`id`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_featured_article'] = "CREATE TABLE `z_featured_article` (
                              `id` int(11) NOT NULL AUTO_INCREMENT,
                              `title` varchar(50) NOT NULL,
                              `text` varchar(255) NOT NULL,
                              `date` varchar(30) NOT NULL,
                              `author` varchar(50) NOT NULL,
                              `read_more` varchar(100) NOT NULL,
                              PRIMARY KEY (`id`)
                            ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
        $tables[Database::DB_MYSQL]['z_forum'] = "CREATE TABLE `z_forum` (
                              `id` int(11) NOT NULL auto_increment,
                              `first_post` int(11) NOT NULL default '0',
                              `last_post` int(11) NOT NULL default '0',
                              `section` int(3) NOT NULL default '0',
                              `replies` int(20) NOT NULL default '0',
                              `views` int(20) NOT NULL default '0',
                              `author_aid` int(20) NOT NULL default '0',
                              `author_guid` int(20) NOT NULL default '0',
                              `post_text` text NOT NULL,
                              `post_topic` varchar(255) NOT NULL,
                              `post_smile` tinyint(1) NOT NULL default '0',
                              `post_date` int(20) NOT NULL default '0',
                              `last_edit_aid` int(20) NOT NULL default '0',
                              `edit_date` int(20) NOT NULL default '0',
                              `post_ip` varchar(15) NOT NULL default '0.0.0.0',
                              `icon_id` tinyint(4) NOT NULL DEFAULT '1',
                              `post_icon_id` tinyint(10) NOT NULL,
                              PRIMARY KEY  (`id`),
                              KEY `section` (`section`)
                            ) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['z_news_tickers'] = "CREATE TABLE `z_news_tickers` (
                             `date` int(11) NOT NULL DEFAULT '1',
                                `author` int(11) NOT NULL,
                               `image_id` int(3) NOT NULL DEFAULT '0',
                             `text` text NOT NULL,
                             `hide_ticker` tinyint(1) NOT NULL
                           ) ENGINE=MyISAM DEFAULT CHARSET=latin1;";
        $tables[Database::DB_MYSQL]['guild_wars'] = "CREATE TABLE `guild_wars` (
                              `id` INT NOT NULL AUTO_INCREMENT,
                              `guild_id` INT NOT NULL,
                              `enemy_id` INT NOT NULL,
                              `begin` BIGINT NOT NULL DEFAULT '0',
                              `end` BIGINT NOT NULL DEFAULT '0',
                              `frags` INT UNSIGNED NOT NULL DEFAULT '0',
                              `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0',
                              `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0',
                              `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0',
                              `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
                              PRIMARY KEY (`id`),
                              KEY `status` (`status`),
                              KEY `guild_id` (`guild_id`),
                              KEY `enemy_id` (`enemy_id`)
                            ) ENGINE=InnoDB;";
        $tables[Database::DB_MYSQL]['guild_wars_table_references'] = "ALTER TABLE `guild_wars`
                                  ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE,
                                  ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;";
        $tables[Database::DB_MYSQL]['guild_kills'] = "CREATE TABLE `guild_kills` (
                              `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
                              `guild_id` INT NOT NULL,
                              `war_id` INT NOT NULL,
                              `death_id` INT NOT NULL
                            ) ENGINE = InnoDB;";
        $tables[Database::DB_MYSQL]['guild_kills_table_references'] = "ALTER TABLE `guild_kills`
                              ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE,
                              ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE,
                              ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;";
        // sqlite tables
        $tables[Database::DB_SQLITE]['z_ots_comunication'] = 'CREATE TABLE "z_ots_comunication" (
                              "id" INTEGER PRIMARY KEY AUTOINCREMENT,
                              "name" varchar(255) NOT NULL,
                              "type" varchar(255) NOT NULL,
                              "action" varchar(255) NOT NULL,
                              "param1" varchar(255) NOT NULL,
                              "param2" varchar(255) NOT NULL,
                              "param3" varchar(255) NOT NULL,
                              "param4" varchar(255) NOT NULL,
                              "param5" varchar(255) NOT NULL,
                              "param6" varchar(255) NOT NULL,
                              "param7" varchar(255) NOT NULL,
                              "delete_it" int(2) NOT NULL default 1);';
        $tables[Database::DB_SQLITE]['z_shop_offer'] = 'CREATE TABLE "z_shop_offer" (
                              "id" INTEGER PRIMARY KEY AUTOINCREMENT,
                              "points" int(11) NOT NULL default 0,
                              "itemid1" int(11) NOT NULL default 0,
                              "count1" int(11) NOT NULL default 0,
                              "itemid2" int(11) NOT NULL default 0,
                              "count2" int(11) NOT NULL default 0,
                              "offer_type" varchar(255) default NULL,
                              "offer_description" text NOT NULL,
                              "offer_name" varchar(255) NOT NULL);';
        $tables[Database::DB_SQLITE]['z_shop_history_item'] = 'CREATE TABLE "z_shop_history_item" (
                              "id" INTEGER PRIMARY KEY AUTOINCREMENT,
                              "to_name" varchar(255) NOT NULL default 0,
                              "to_account" int(11) NOT NULL default 0,
                              "from_nick" varchar(255) NOT NULL,
                              "from_account" int(11) NOT NULL default 0,
                              "price" int(11) NOT NULL default 0,
                              "offer_id" varchar(255) NOT NULL default "",
                              "trans_state" varchar(255) NOT NULL,
                              "trans_start" int(11) NOT NULL default 0,
                              "trans_real" int(11) NOT NULL default 0);';
        $tables[Database::DB_SQLITE]['z_forum'] = 'CREATE TABLE "z_forum" (
                                "id" INTEGER PRIMARY KEY AUTOINCREMENT,
                                "first_post" int(11) NOT NULL default 0,
                                "last_post" int(11) NOT NULL default 0,
                                "section" int(3) NOT NULL default 0,
                                "replies" int(20) NOT NULL default 0,
                                "views" int(20) NOT NULL default 0,
                                "author_aid" int(20) NOT NULL default 0,
                                "author_guid" int(20) NOT NULL default 0,
                                "post_text" text NOT NULL,
                                "post_topic" varchar(255) NOT NULL,
                                "post_smile" tinyint(1) NOT NULL default 0,
                                "post_date" int(20) NOT NULL default 0,
                                "last_edit_aid" int(20) NOT NULL default 0,
                                "edit_date" int(20) NOT NULL default 0,
                                "post_ip" varchar(15) NOT NULL default "0.0.0.0,");';
        foreach($columns as $column)
        {
            if($column[4] === NULL && $SQL->query('ALTER TABLE ' . $SQL->tableName($column[0]) . ' ADD ' . $SQL->fieldName($column[1]) . ' ' . $column[2] . '  NULL DEFAULT NULL') !== false)
                echo "<span style=\"color:green\">Column <b>" . $column[1] . "</b> added to table <b>" . $column[0] . "</b>.</span><br />";
            elseif($SQL->query('ALTER TABLE ' . $SQL->tableName($column[0]) . ' ADD ' . $SQL->fieldName($column[1]) . ' ' . $column[2] . '' . (($column[3] == '') ? '' : '(' . $column[3] . ')') . ' NOT NULL DEFAULT \'' . $column[4] . '\'') !== false)
                echo "<span style=\"color:green\">Column <b>" . $column[1] . "</b> added to table <b>" . $column[0] . "</b>.</span><br />";
            else
                echo "Could not add column <b>" . $column[1] . "</b> to table <b>" . $column[0] . "</b>. Already exist?<br />";
        }
        foreach($tables[$SQL->getDatabaseDriver()] as $tableName => $tableQuery)
        {
            if($SQL->query($tableQuery) !== false)
                echo "<span style=\"color:green\">Table <b>" . $tableName . "</b> created.</span><br />";
            else
                echo "Could not create table <b>" . $tableName . "</b>. Already exist?<br />";
        }
        echo 'Tables and columns added to database.<br>Go to <a href="install.php?page=step&step=4">STEP 4 - Add samples</a>';
    }
    elseif($step == 4)
    {
        echo '<h1>STEP '.$step.'</h1>Add samples to DB:<br>';

        $samplePlayers = array();
        $samplePlayers[0] = 'Rook Sample';
        $samplePlayers[1] = 'Sorcerer Sample';
        $samplePlayers[2] = 'Druid Sample';
        $samplePlayers[3] = 'Paladin Sample';
        $samplePlayers[4] = 'Knight Sample';
        $newPlayer = new Player('Account Manager', Player::LOADTYPE_NAME);
        if($newPlayer->isLoaded())
        {
            foreach($samplePlayers as $vocationID => $name)
            {
                $samplePlayer = new Player($name, Player::LOADTYPE_NAME);
                if(!$samplePlayer->isLoaded())
                {
                    $samplePlayer = new Player('Account Manager', Player::LOADTYPE_NAME);
                    $samplePlayer->setID(null); // save as new player, not edited
                    $samplePlayer->setName($name);
                    $samplePlayer->setVocation($vocationID);
                    $samplePlayer->setGroupID(1);
                    $samplePlayer->setLookType(128);
                    $samplePlayer->save();
                    echo '<span style="color:green">Added sample character: </span><span style="color:green;font-weight:bold">' . $name . '</span><br/>';
                }
                else
                    echo 'Sample character: <span style="font-weight:bold">' . $name . '</span> already exist in database<br/>';
            }
        }
        else
            new Error_Critic('', 'Character <i>Account Manager</i> does not exist. Cannot install sample characters!');
    }
    elseif($step == 5)
    {
        echo '<h1>STEP '.$step.'</h1>Set Admin Account<br>';
        if(empty($_REQUEST['saveaccpassword']))
        {
            echo 'Admin account login is: <b>1</b><br/>Set new password to this account.<br>';
            echo 'New password: <form action="install.php" method=POST><input type="text" name="newpass" size="35">(Don\'t give it password to anyone!)';
            echo '<input type="hidden" name="saveaccpassword" value="yes"><input type="hidden" name="page" value="step"><input type="hidden" name="step" value="5"><input type="submit" value="SET"></form><br>If account with login 1 doesn\'t exist installator will create it and set your password.';
        }
        else
        {
            include_once('./system/load.compat.php');
            $newpass = trim($_POST['newpass']);
            if(!check_password($newpass))
                echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5">GO BACK</a> and write other password.';
            else
            {
                //create / set pass to admin account
                $account = new Account(1, Account::LOADTYPE_NAME);
                if($account->isLoaded())
                {
                    $account->setPassword($newpass); // setPassword encrypt it to ots encryption
                    $account->setPageAccess(3);
                    $account->setFlag('unknown');
                    $account->save();
                }
                else
                {
                    $newAccount = new Account();
                    $newAccount->setName(1);
                    $newAccount->setPassword($newpass); // setPassword encrypt it to ots encryption
                    $newAccount->setMail(rand(0,999999) . '@gmail.com');
                    $newAccount->setPageAccess(3);
                    $newAccount->setGroupID(1);
                    $newAccount->setFlag('unknown');
                    $newAccount->setCreateIP(Visitor::getIP());
                    $newAccount->setCreateDate(time());
                }
                $_SESSION['account'] = 1;
                $_SESSION['password'] = $newpass;
                $logged = TRUE;
                echo '<h1>Admin account login: 1<br>Admin account password: '.$newpass.'</h1><br/><h3>It\'s end of installation. Installation is blocked!</h3>'; 
                if(!unlink('install.txt'))
                    new Error_Critic('', 'Cannot remove file <i>install.txt</i>. You must remove it to disable installer. I recommend you to go to step <i>0</i> and check if any other file got problems with WRITE permission.');
            }
        }
    }
}

 

49 minutos atrás, vankk disse:

Leia o erro do install, que você conseguirá.

 AAC installation is disabled. To enable it make file install.php in main AAC directory and put there your IP.

 

E utilize esses comandos no SQL


ALTER TABLE `guilds` ADD `logo_gfx_name` varchar(255) NOT NULL DEFAULT '';

CREATE TABLE IF NOT EXISTS `z_forum` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sticky` tinyint(1) NOT NULL DEFAULT '0',
`closed` tinyint(1) NOT NULL DEFAULT '0',
`first_post` int(11) NOT NULL DEFAULT '0',
`last_post` int(11) NOT NULL DEFAULT '0',
`section` int(3) NOT NULL DEFAULT '0',
`replies` int(20) NOT NULL DEFAULT '0',
`views` int(20) NOT NULL DEFAULT '0',
`author_aid` int(20) NOT NULL DEFAULT '0',
`author_guid` int(20) NOT NULL DEFAULT '0',
`post_text` text NOT NULL,
`post_topic` varchar(255) NOT NULL,
`post_smile` tinyint(1) NOT NULL DEFAULT '0',
`post_date` int(20) NOT NULL DEFAULT '0',
`last_edit_aid` int(20) NOT NULL DEFAULT '0',
`edit_date` int(20) NOT NULL DEFAULT '0',
`post_ip` varchar(32) NOT NULL DEFAULT '0.0.0.0',
PRIMARY KEY (`id`),
KEY `section` (`section`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

Adicionei no phpmyadmin os codigos que você enviou, porém os erros continuam:

AAC installation is disabled. To enable it make file install.php in main AAC directory and put there your IP.

Erro de quando tento abrir o site:

Citar
Query: SELECT `id`, `name`, `password`, `premdays`, `lastday`, `email`, `key`, `group_id`, `create_ip`, `create_date`, `premium_points`, `page_access`, `location`, `rlname`, `email_new`, `email_new_time`, `email_code`, `next_email`, `last_post`, `flag` FROM `accounts` WHERE `name` = '1'
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4;
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT
SQLSTATE: 42000
Driver code: 1064
Error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: SELECT `date` FROM `z_news_tickers` WHERE `hide_ticker` = '0'
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 5;
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT * FROM z_featured_article ORDER BY id DESC LIMIT 1
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `players`.`id`, `players`.`name`, `players`.`world_id`, `players`.`group_id`, `players`.`account_id`, `players`.`level`, `players`.`vocation`, `players`.`health`, `players`.`healthmax`, `players`.`experience`, `players`.`lookbody`, `players`.`lookfeet`, `players`.`lookhead`, `players`.`looklegs`, `players`.`looktype`, `players`.`lookaddons`, `players`.`maglevel`, `players`.`mana`, `players`.`manamax`, `players`.`manaspent`, `players`.`soul`, `players`.`town_id`, `players`.`posx`, `players`.`posy`, `players`.`posz`, `players`.`conditions`, `players`.`cap`, `players`.`sex`, `players`.`lastlogin`, `players`.`lastip`, `players`.`save`, `players`.`skull`, `players`.`skulltime`, `players`.`rank_id`, `players`.`guildnick`, `players`.`lastlogout`, `players`.`blessings`, `players`.`balance`, `players`.`stamina`, `players`.`direction`, `players`.`loss_experience`, `players`.`loss_mana`, `players`.`loss_skills`, `players`.`loss_containers`, `players`.`loss_items`, `players`.`premend`, `players`.`online`, `players`.`marriage`, `players`.`promotion`, `players`.`deleted`, `players`.`description`, `players`.`create_ip`, `players`.`create_date`, `players`.`comment`, `players`.`hide_char`, `players`.`signature` FROM `players` WHERE `account_id` = '1' ORDER BY `name` ASC
SQLSTATE: 00000
Driver code:  
Error message:  
Query: SELECT `players`.`name`, `z_forum`.`post_text`, `z_forum`.`post_topic`, `z_forum`.`icon_id`, `z_forum`.`post_smile`, `z_forum`.`id`, `z_forum`.`replies`, `z_forum`.`post_date` FROM `players`, `z_forum` WHERE `players`.`id` = `z_forum`.`author_guid` AND `z_forum`.`section` = 1 AND `z_forum`.`first_post` = `z_forum`.`id` ORDER BY `z_forum`.`last_post` DESC LIMIT 6
SQLSTATE: 42S22
Driver code: 1054
Error message: Unknown column 'z_forum.icon_id' in 'field list'


Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\pages\latestnews.php on line 512

 

Editado por Werner (veja o histórico de edições)

Talvez você queira ver:

BestBaiak

[FAQ]Remere's Map Editor - Dúvidas e soluções de bugs 

 

Contato:

1.png.dadb3fc3ee6ffd08292705b6a71e3d88.png Discord:

Link para o post
Compartilhar em outros sites

@Sekk não, da uma olhada e atualiza lá :p

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por L3K0T
      TUTORIAL BY L3K0T PT~EN
       
      Olá pessoal, trago a vocês uma atualização que fiz no sistema, contendo 3 novas funcionalidades de movimentação de itens e uma proteção contra Elf Bot. Estas adições foram cuidadosamente implementadas para aperfeiçoar a experiência de jogo e manter a integridade do seu servidor.
      As novas funcionalidades têm a função vital de impedir que jogadores deixem itens indesejados em locais inapropriados, como na entrada de sua casa, em cima de seus depósitos ou em teleportes. Agora, apenas proprietários, subproprietários e convidados têm permissão para manipular itens nesses locais.
      Este pacote de atualização foi meticulosamente revisado para evitar abusos por parte de jogadores mal-intencionados e garantir um ambiente de jogo justo e equilibrado para todos os usuários.
       
       
       
      Iniciando o Tutorial
      1Abra o arquivo "creatureevents.cpp" com o editor de sua preferência. Eu pessoalmente recomendo o Notepad++. 
       
       
      Em creatureevents.cpp:
      return "onPrepareDeath"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "onMoveItem"; case CREATURE_EVENT_MOVEITEM2: return "onMoveItem2";  
      Em:
      return "cid, deathList"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "moveItem, frompos, topos, cid"; case CREATURE_EVENT_MOVEITEM2: return "cid, item, count, toContainer, fromContainer, fromPos, toPos";  
      Em:
      m_type = CREATURE_EVENT_PREPAREDEATH; Adicione abaixo:
      else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2;  
      Procure por:
      bool CreatureEvents::playerLogout(Player* player, bool forceLogout) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGOUT && (*it)->isLoaded() && !(*it)->executeLogout(player, forceLogout) && result) result = false; } return result; } Adicione abaixo:
      uint32_t CreatureEvents::executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos) { // fire global event if is registered for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_MOVEITEM) { if(!(*it)->executeMoveItem(actor, item, frompos, pos)) return 0; } } return 1; }  
      Em:
      bool CreatureEvents::playerLogin(Player* player) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGIN && (*it)->isLoaded() && !(*it)->executeLogin(player) && result) result = false; } if (result) { for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { CreatureEvent* event = *it; if(event->isLoaded() && ( event->getRegister() == "player" || event->getRegister() == "all") ) player->registerCreatureEvent(event->getName()); } } return result; } Adicione Abaixo:
      uint32_t CreatureEvent::executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos) { //onMoveItem(moveItem, frompos, position, cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(pos); std::stringstream scriptstream; env->streamThing(scriptstream, "moveItem", item, env->addThing(item)); env->streamPosition(scriptstream, "position", frompos, 0); env->streamPosition(scriptstream, "position", pos, 0); scriptstream << "local cid = " << env->addThing(actor) << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(pos); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); LuaInterface::pushThing(L, item, env->addThing(item)); LuaInterface::pushPosition(L, frompos, 0); LuaInterface::pushPosition(L, pos, 0); lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(4); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } uint32_t CreatureEvent::executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); //lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } }  
       
       
      Agora em em creatureevents.h:
      CREATURE_EVENT_PREPAREDEATH, Adicione abaixo:
      CREATURE_EVENT_MOVEITEM, CREATURE_EVENT_MOVEITEM2  
      Em:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo:
      uint32_t executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
      Em:
      bool playerLogout(Player* player, bool forceLogout); Abaixo adicone também
      uint32_t executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
       
      Agora em em game.cpp:
      if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if(ret == RET_NOERROR) return true; player->sendCancelMessage(ret); return false; } Altere para:
      if (!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM2); for (CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if (!(*it)->executeMoveItem2(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if (!success) return false; if (g_config.getBool(ConfigManager::ANTI_PUSH)) { std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS); IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ",")); if (tmpVec[0] != 0) { for (IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it) { if (item->getID() == uint32_t(*it) && player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "Please wait a few seconds to move this item."); return false; } } } } int32_t delay = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY); if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, delay, 0, false, 1)) player->addCondition(condition); if (!g_creatureEvents->executeMoveItems(player, item, mapFromPos, mapToPos)) return false; ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if (ret != RET_NOERROR) { player->sendCancelMessage(ret); return false; } player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::ACTIONS_DELAY_INTERVAL) - 10); return true; }  
      Agora em configmanager.h
      ADMIN_ENCRYPTION_DATA Adicione abaixo:
      ANTI_PUSH_ITEMS,  
      em:
      STAMINA_DESTROY_LOOT, Adicione abaixo:
      ANTI_PUSH_DELAY,  
      em:
      ADDONS_PREMIUM, Adicione abaixo:
      ANTI_PUSH  
      Agora você pode compilar a Source.
       
       
      Configurando no servidor:
       
      Abra seu config.lua do servidor e adicione isso dentro qualquer lugar:
      -- Anti-Push useAntiPush = true antiPushItems = "2148,2152,2160,3976" antiPushDelay = 500  
       
      Navegue até o diretório 'creaturescripts' e localize o arquivo 'login.lua'.
      em resgistros de eventos adicione:
      login.lua
      registerCreatureEvent(cid, "MoveItem") registerCreatureEvent(cid, "MoveItem2")  
      Agora abra o aquivo creaturescript .xml
      <event type="moveitem" name="MoveItem" event="script" value="houseprotecao.lua"/> <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/>  
      Crie um novo arquivo lua em scripts com o nome houseprotecao.lua e adicione isso:
      function onMoveItem(moveItem, frompos, position, cid) if position.x == CONTAINER_POSITION then return true end local house = getHouseFromPos(frompos) or getHouseFromPos(position) --correção 100% if type(house) == "number" then local owner = getHouseOwner(house) if owner == 0 then return false, doPlayerSendCancel(cid, "Isso não é Possível.") end if owner ~= getPlayerGUID(cid) then local sub = getHouseAccessList(house, 0x101):explode("\n") local guest = getHouseAccessList(house, 0x100):explode("\n") local isInvited = false if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then isInvited = true end if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then isInvited = true end if not isInvited then return false, doPlayerSendCancel(cid, "Desculpe, você não está invitado.") end end end return true end  
      Crie um novo arquivo lua em scripts com o nome moveitem2.lua e adicione isso abaixo:
      local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 3 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInArea(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue item ai!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end  
      ajudei?? REP+
      CRÉDITOS:
      @L3K0T
      Fir3element
      Summ
      Wise
      GOD Wille
      Yan Lima
       
       
       
       
    • Por L3K0T
      Não jogar itens pelo teleportes C++
       

       

       
       
      Bom.. o nome já diz, qualquer um que jogar itens nos teleportes do seu otserv, o mesmo será removido, como aquelas lixeiras, porem esse sistema é pela source, descartando scripts .LUA.
       
       
      Em teleporte.cpp ache:
       
      void Teleport::__addThing(Creature* actor, int32_t, Thing* thing) { if(!thing || thing->isRemoved()) return; Tile* destTile = g_game.getTile(destination); if(!destTile) return; if(Creature* creature = thing->getCreature()) { g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); creature->getTile()->moveCreature(actor, creature, destTile); g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); } else if(Item* item = thing->getItem()) { g_game.addMagicEffect(item->getPosition(), MAGIC_EFFECT_TELEPORT); g_game.internalMoveItem(actor, item->getTile(), destTile, INDEX_WHEREEVER, item, item->getItemCount(), NULL); g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT); } }  
      Altere ele todo para:
       
      void Teleport::__addThing(Creature* actor, int32_t, Thing* thing) { if (!thing || thing->isRemoved()) return; Tile* destTile = g_game.getTile(destination); if (!destTile) return; if (Creature* creature = thing->getCreature()) { g_game.addMagicEffect(creature->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); creature->getTile()->moveCreature(actor, creature, destTile); g_game.addMagicEffect(destTile->getPosition(), MAGIC_EFFECT_TELEPORT, creature->isGhost()); } else { Player* player = dynamic_cast<Player*>(actor); if (player) { player->sendTextMessage(MSG_STATUS_SMALL, "You cannot teleport items."); // Remover o item Item* item = dynamic_cast<Item*>(thing); if (item) { g_game.internalRemoveItem(actor, item); } } return; } } agora é só compilar no modo Rebuilder e ligar o servidor, créditos a mim L3K0T pela alterações.
    • Por Imperius
      Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
       
      É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
       
      Como funciona?
       
      O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
       
      O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
       
      Para entender melhor o seu funcionamento, segue o GIF abaixo:
       

       
       
      em data > actions > actions.xml
       
       
      em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
       
       
      no banco de dados do servidor, adicione o seguinte código em "SQL":
       
       
       

      Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
       

       
       
      Espero ter ajudado de alguma forma! : )
       
      treasure_chest.php
    • Por ILex WilL
      Olá, Alguém poderia me ajudar com uns Scripts? nem que seja cobrando, dependendo eu pago para me ajudar...
    • Por Thony D. Serv
      tfs 0.4 (não testei em outras apenas na 0.4)
      Esse script eu fiz pois, meu servidor sempre que reiniciava todos os players voltavam sem bless, então para sanar isso eu fiz um check de bless pela database para poder sempre que cair o servidor os players não morressem sem bless e dropassem os itens
      vamos lá!

      Primeiro Execute Este Comando Em Sua Db:
       

      Va No Fim E Adicione
      050-function.lua 
       

      Agora vá no seu comando de Bless ou Npc e ponha cada um no seu devido lugar
       
       
      Agora Em Creaturescript/scripts Crie Uma Pasta Chamada Bless E Ponha La Dentro:

      blessingdeath.lua
       

      blessinglogin.lua
       

      Adicione Ambas No Login.lua
       
       
      Creaturescript.xml
       

      -- Creditos A Mim Mesmo hahaha. Espero Ajudar Vocês ?
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo