Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''bug''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. Então como todos sabem aquele clássico erro do pally não atacar enquanto pota.. consegui resolver de todas (eu acho) com aquele "swing=true", menos da "spear 2389".. da royal pra cima ta normal alguém sabe arrumar a porcaria da spear kkkk porque é desanimador o cara querer jogar de pally criar e ter esse bug no servidor, broxante! kkk alguem sabe?
  2. Boa noite galera, a um tempo atrás comecei a editar as extensions do meu RME, e depois de mecher, mecher e mecher, acabou acontecendo isso: Não sei o que está fazendo isso acontecer, já olhei grounds.xml e borders.xml, está tudo certo. Se alguém puder ajudar, ficarei grato.
  3. Olá pessoal, gostaria que alguém me ajudasse em uns scripts de frag, um é o de rank frags, que já usei 2 diferentes e nenhum deu certo. Um deles abre a janelinha do rank mas não aparece ninguém nela, e o outro script faz cair o server quando eu executo a talkaction pra abrir o rank. O outro é que eu tenho um script que aparece os frags do player quando dá look nele, o problema é como eu tenho um ot de war, eu gostaria que contabilizasse todas as mortes nesse contador de frags. Por exemplo, se eu pego pz em um player e eu mato ele, o frag conta. Só que se esse mesmo cara abrir PZ em mim ou se ele já tiver pego pz em outra pessoa e eu abrir "yellow" no cara e matar ele, o frag não conta. Obrigado amigos e aguardo ajuda.
  4. Olá, estava finalizando meu Map, e percebi um suposto bug, tentei resolve-lo mas não consegui. Bom, espero que vocês tenham capacidade para me ajudar. É o seguinte, quando abre um mapa novo, fica as sprites antigas, que são antes do remake(está correto pois está referente a minha spr.) Porém, quando abro um mapa qualquer, a Spr atualiza ficando com os remakes, porém não tem onde o remere's pegar essa spr, pois tal não está selecionada. Logo abaixo mostrarei print's: 1 - Mapa novo, spr velha(correta): 2 - Spr selecionada(referente ao mapa velho, já conferi 4 vezes): 3 - Mapa aberto, spr nova(errado): Preciso da Spr velha atuando, mas não está acontecendo com êxito tal necessidade. Espero que me ajudem! BUG RESOLVIDO - TÓPICO FECHADO
  5. Damgrath

    Locked doors

    Olá, galera dos scripts. Bom, como não sou nem 1% scripter, estou com um probleminha que talvez possa ser um tanto bobo, mas mesmo assim não tenho ideia de como resolver. Para explicar corretamente o meu problema, vou mostra-lo com prints: 1- A porta está trancada normalmente. 2- Após usar a chave, a porta também se destranca, normal como deve ser. 3- Porém, após entrar e fechar a porta, a mesma deveria permanecer destrancada, até que a chave seja usada novamente para trancá-la. Mas o que está acontecendo, é que quando a porta é simplesmente fechada, ela se tranca: Então, galera, como puderam ver, a porta se tranca ao ser fechada, e isso está fazendo com que os players fiquem presos dentro desse tipo de sala, pois nem todos entram com chave. O que eu queria é saber como posso reparar isso, para que a porta se abra e feche normalmente após ser destrancada, e só seja trancada novamente, caso alguém use a chave na mesma. Obrigado, galera!
  6. Olá pessoal, hoje estou aqui para pedir uma ajuda sobre o Account Manager pois em meu servidor de alguma forma alguns player conseguiram cria ele e tentaram fazer clone de itens, na verdade fizeram mas já resolvi como o ot é pequeno não teve problemas. Então a solução que encontrei foi pixa o Account Manager para minha acc de ADM, porem ficam esperando os cara novamente criaram um Account Manager kkk ( entao puxei esse Account Manager e reloguei ele num lugar inacessível para player comuns sendo assim ele fica preso lá, mas o que eu gostaria mesmo era ver se é possível deixa ele parado em apenas 1 lugar? Pois aparentemente ele pode fica caminhando no mapa, não sei como fazer ele fica fixo em 1 lugar apenas.
  7. Galera pode me ajuda pfv com esse bug ai pfv eu nem sei como isso foi apara ai
  8. Bom galera tour com um bug aqui no meu servido da OFA:Operação Forças Armadas e já botei varias script botei ate pelo mapa e nem uma delas funfo para quest você pode me ajuda pfv
  9. Boa noite, meu RME é o atual, o MAPA, "qualquer um" abre normalmente, tudo funciona , mini-map, e etc, porem a tela do MAPA pra editar ele NÃO APARECE, ele simplesmente buga a minha tela, vou colocar umas fotos pra vocês terem noção, e se pode me ajudar a corrigir isso, já tentei desinstalar, colocar outra versão e nada...
  10. Olá, estava mechendo normal quando do nada parou de funcionar os teleports, ele aparece como um item normal e não aparece mais x,y,z... Alguem sabe responder? [attachment=19425:Remeres.png]
  11. Ola, Tenho um ot 8.60, ele abre PERFEITAMENTE, não da 1 erro, mas quando eu tento abrir um server 8.70 ele simplesmente não loga, faço tudo como no 8.6 todo os procedimentos. Bom, eu baixei varios ots, nenhum funcionou, abro ele com o ip 127.0.0.1, como faço no 8.6 para testar as modificações que eu faço mas NÃO ACONTECE NADA fica "connecting" no tibia. n sai disso. ali aparece como online. enfim se tiver como ajudar dou like
  12. meu servidor é 8.6 peguei itens de 8.54 e o ficheiro items.otb e substitui pelos do 8.6 axo da erro no item otb mais preciso de utilizar os 8.54 alguém me ajude .
  13. Está com bug meu script, não consegui resolver, ele conta 1 assassinato para Frag e Death.. Sendo que era pra ser apenas 1 frag. ( no caso se vc mata alguém ele conta para os 2 e se caso vc morre não conta a morte nem nada) function getDeaths(cid) local query, d = db.getResult("SELECT `player_id` FROM `player_killers` WHERE `player_id` = " ..getPlayerGUID(cid)), 0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then return doPlayerSetSpecialDescription(thing.uid, '\n'.. '[Frags: ' .. getPlayerFrags(thing.uid) .. ' - Deaths: ' .. getDeaths(thing.uid) .. ']') elseif thing.uid == cid then local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end string = string..'\n'.. '[Frags: ' .. getPlayerFrags(cid) .. ' - Deaths: ' .. getDeaths(cid) .. ']' if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) end return 1 end
  14. brendoonh

    Bug Cassino

    Criei 2 topicos sem querer, desculpem!!! Apaguem esse por favor. Perdao pelo ocorrido!
  15. ola senhores eu peguei uma source 0.4 rev 3884 para meu servidor ela veio com cast e war system mais eu estou com um problema para add um query no sqlite ALTER TABLE `players` ADD `cast` TINYINT NOT NULL DEFAULT '0', ADD `castViewers` INT( 11 ) NOT NULL DEFAULT '0', ADD `castDescription` VARCHAR( 255 ) NOT NULL pede que eu adicione isso mais não funciona fica em vermelho, eu nunca mexi com db
  16. O npc vende o outfit até se o player estiver sem dinheiro =/ se ele estiver com dinheiro desconta normal, mas sem ele vende e não tira nada, qual o erro? local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { itemNeeded = 2160, count = 100, addonName = "Beggar", outfitId = 14, storage = 3848, } if (msgcontains(msg, config.addonName)) then if doPlayerRemoveItem(cid, config.itemNeeded, config.count) then else selfSay('Sorry, you need a '..config.count..' of '..getItemNameById(config.itemNeeded)..' for complet a my trade.', cid) end if getPlayerStorageValue(cid, config.storage) < 1 then else return selfSay('Sorry, you this have a addon of '..config.addonName..' Outfit.', cid) end selfSay("Well I give you "..config.addonName..", the more you need to give me certain items do you accept this trade? ", cid) talkState[talkUser] = 1 elseif(msgcontains(msg, "yes")) and talkState[talkUser] == 1 then selfSay("only rich people can buy my outfit.",cid) talkState[talkUser] = 0 doPlayerAddOutfit(cid,config.outfitId, config.giveAddons) setPlayerStorageValue(cid, config.storage, 1) end return true end keywordHandler:addKeyword({'outfit'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell {Beggar} Outfit for 1k.'}) keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell {Beggar} Outfit for 1k.'}) keywordHandler:addKeyword({'task'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell {Beggar} Outfit for 1k.'}) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  17. Coloque em meu server um novo ring: Blz ele tem que refletir todos os danos recebidos pelo char e acontece isso mas quando o char passa pelo fogo ou posion ou qualuer coisa que de dano no char sem ter um player ou monstro fazendo isso o server debuga e fecha alguem poderia me ajudar a resolver isso?
  18. lol08

    erro npc

    Ajuda nesse erro por favor [24/11/2015 12:08:44] [Error - Npc interface] [24/11/2015 12:08:45] data/npc/scripts/default.lua:onThink [24/11/2015 12:08:45] Description: [24/11/2015 12:08:45] data/lib/032-position.lua:48: attempt to index local 'toPosition' (a boolean value) [24/11/2015 12:08:45] stack traceback: [24/11/2015 12:08:45] data/lib/032-position.lua:48: in function 'getDistanceBetween' [24/11/2015 12:08:45] data/npc/lib/npcsystem/npchandler.lua:561: in function 'isInRange' [24/11/2015 12:08:45] data/npc/lib/npcsystem/npchandler.lua:489: in function 'onThink' [24/11/2015 12:08:45] data/npc/scripts/default.lua:8: in function <data/npc/scripts/default.lua:8>
  19. lol08

    erro npc

    Ajuda nesse erro por favor [24/11/2015 12:08:44] [Error - Npc interface] [24/11/2015 12:08:45] data/npc/scripts/default.lua:onThink [24/11/2015 12:08:45] Description: [24/11/2015 12:08:45] data/lib/032-position.lua:48: attempt to index local 'toPosition' (a boolean value) [24/11/2015 12:08:45] stack traceback: [24/11/2015 12:08:45] data/lib/032-position.lua:48: in function 'getDistanceBetween' [24/11/2015 12:08:45] data/npc/lib/npcsystem/npchandler.lua:561: in function 'isInRange' [24/11/2015 12:08:45] data/npc/lib/npcsystem/npchandler.lua:489: in function 'onThink' [24/11/2015 12:08:45] data/npc/scripts/default.lua:8: in function <data/npc/scripts/default.lua:8>
  20. Olá galera do XTibia, estou aqui para pedir ajuda a vocês, recentemente descobri um bug em meu server que está acabando totalmente com o ot, vou explicar como funciona. O player utiliza de uma hotk ey do elfbot para comprar comprar potion no npc, só que ao utilizar essa hotkey ele acaba comprando inifinitos potions e não paga por eles, os potions acabam saindo de graça. NPC Que uso para vender Potions \/
  21. Olá , galera estou com um problema em meu servidor, as skills que são upadas para algumas pessoas elas não salva, se o player relogar a skill que ele upou volta para nivel 10. Exemplo , quando voce treina skill Distance Fighting até lv 20 e se voce relogar sua skill é resetada para nivel 10. ISSO SÓ ACONTECE COM PLAYERS ANTIGOS, quem criar conta nova e personagem novo fica normal. Isso começou quando eu resetei, coloquei todos os personagem nivel 5, coloquei todos maglevel para 1 e em player_skills eu limpei tudo, nao sei mais o que fazer. Todos os players antigos que ja possuiam chares nao conseguem mais salvar suas skills ao relogar. Se alguem ajudar, fico grato !
  22. ^^ Account manager ta é doido, ele fala sozinho... alguem sabe o que seria isso? (tfs 0.3.6)
  23. fatal error call to a member function fetch_assoc() on a non-object in C:/xampp/htdocs/classes/player.php on line 36 ----------------- A linha 36 e a seguinte : public function load($search_text, $search_by = self::LOADTYPE_ID) Inteira <?php if(!defined('INITIALIZED')) exit; class Player extends ObjectData { const LOADTYPE_ID = 'id'; const LOADTYPE_NAME = 'name'; const LOADTYPE_ACCOUNT_ID = 'account_id'; public static $table = 'players'; public $data = array('name' => null, 'world_id' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'rank_id' => null, 'guildnick' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'direction' => null, 'loss_experience' => null, 'loss_mana' => null, 'loss_skills' => null, 'loss_containers' => null, 'loss_items' => null, 'premend' => null, 'online' => null, 'marriage' => null, 'promotion' => null, 'deleted' => null, 'description' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null); public static $fields = array('id', 'name', 'world_id', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'rank_id', 'guildnick', 'lastlogout', 'blessings', 'balance', 'stamina', 'direction', 'loss_experience', 'loss_mana', 'loss_skills', 'loss_containers', 'loss_items', 'premend', 'online', 'marriage', 'promotion', 'deleted', 'description', 'create_ip', 'create_date', 'comment', 'hide_char'); public static $skillFields = array('player_id', 'skillid', 'value', 'count'); public $items; public $storages; public $skills; public $account; public $rank; 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 Player search_by type.'); $fieldsArray = array(); foreach(self::$fields as $fieldName) $fieldsArray[] = $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, self::LOADTYPE_ID); } public function loadByName($name) { $this->load($name, self::LOADTYPE_NAME); } 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) $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 getItems($forceReload = false) { if(!isset($this->items) || $forceReload) $this->items = new ItemsList($this->getID()); return $this->items; } public function saveItems() { if(isset($this->items)) { // if any script changed ID of player, function should save items with new player id $this->items->setPlayerId($this->getID()); $this->items->save(); } else new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save'); } public function loadStorages() { $this->storages = array(); // load all $storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll(); foreach($storages as $storage) { $this->storages[$storage['key']] = $storage['value']; } } public function saveStorages() { if(isset($this->storages)) { $this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); foreach($this->storages as $key => $value) { //save each $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . $this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')'); } } else new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save'); } public function getStorage($key) { if(!isset($this->storages)) { $this->loadStorages(); } if(isset($this->storages[$key])) return $this->storages[$key]; else return null; } public function getStorages() { if(!isset($this->storages)) { $this->loadStorages(); } return $this->storages; } public function setStorage($key, $value) { if(!isset($this->storages)) { $this->loadStorages(); } $this->storages[$key] = $value; } public function removeStorage($key) { if(!isset($this->storages)) { $this->loadStorages(); } if(isset($this->storages[$key])) unset($this->storages[$key]); } public function loadSkills() { $fieldsArray = array(); foreach(self::$skillFields as $fieldName) $fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName); $skills = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->fieldName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetchAll(); $this->skills = array(); foreach($skills as $skill) $this->skills[$skill['skillid']] = $skill; } public function getSkills($forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); return $this->skills; } public function getSkill($id, $forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); if(isset($this->skills[$id])) return $this->skills[$id]['value']; else new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist'); } public function setSkill($id, $value) { $this->skills[$id]['value'] = $value; } public function getSkillCount($id, $forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); if(isset($this->skills[$id])) return $this->skills[$id]['count']; else new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist'); } public function setSkillCount($id, $count) { $this->skills[$id]['count'] = $count; } public function saveSkills() { if(isset($this->skills)) { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID())); if(count($this->skills) > 0) { $keys = array(); foreach(self::$skillFields as $key) $keys[] = $this->getDatabaseHandler()->fieldName($key); $query = 'INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_skills') . ' (' . implode(', ', $keys) . ') VALUES '; foreach($this->skills as $skill) { $fieldValues = array(); foreach(self::$skillFields as $key) if($key != 'player_id') $fieldValues[] = $this->getDatabaseHandler()->quote($skill[$key]); else $fieldValues[] = $this->getDatabaseHandler()->quote($this->getID()); $this->getDatabaseHandler()->query($query . '(' . implode(', ', $fieldValues) . ')'); } } } else new Error_Critic('', 'Player::saveSkills() - skills not loaded, cannot save'); } public function loadAccount() { $this->account = new Account($this->getAccountID()); } public function getAccount($forceReload = false) { if(!isset($this->account) || $forceReload) $this->loadAccount(); return $this->account; } public function setAccount($account) { $this->account = $account; $this->setAccountID($account->getID()); } public function loadRank() { $this->rank = new GuildRank($this->getRankID()); } public function getRank($forceReload = false) { if(!isset($this->rank) || $forceReload) $this->loadRank(); if($this->data['rank_id'] == 0) { return null; } return $this->rank; } public function setRank($rank = null) { if(isset($rank)) { $this->rank = $rank; $this->setRankID($rank->getID()); } else { $this->rank = new GuildRank(); $this->setRankID(0); } } public function hasGuild() { return $this->getRank()->isLoaded(); } public function removeGuildInvitations() { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID())); } public function unban() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $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 isBanned() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_BANISHMENT); $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); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam); $bans->setFilter($filter); $isBanned = false; foreach($bans as $ban) { if($ban->getExpires() <= 0 || $ban->isExpires() > time()) $isBanned = true; } return $isBanned; } public function isNamelocked() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_LOCK); $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); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam); $bans->setFilter($filter); return (count($bans) > 0); } public function delete() { $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); unset($this->data['id']); } /* * default tfs 0.3.6 fields */ public function setID($value){$this->data['id'] = $value;} public function getID(){return $this->data['id'];} public function setAccountID($value){$this->data['account_id'] = $value;} public function getAccountID(){return $this->data['account_id'];} public function setWorldID($value){$this->data['world_id'] = $value;} public function getWorldID(){return $this->data['world_id'];} public function setName($value){$this->data['name'] = $value;} public function getName(){return $this->data['name'];} public function setGroupID($value){$this->data['group_id'] = $value;} public function getGroupID(){return $this->data['group_id'];} public function setVocation($value){$this->data['vocation'] = $value;} public function getVocation(){return $this->data['vocation'];} public function setPromotion($value){$this->data['promotion'] = $value;} public function getPromotion(){return $this->data['promotion'];} public function setLevel($value){$this->data['level'] = $value;} public function getLevel(){return $this->data['level'];} public function setExperience($value){$this->data['experience'] = $value;} public function getExperience(){return $this->data['experience'];} public function setHealth($value){$this->data['health'] = $value;} public function getHealth(){return $this->data['health'];} public function setHealthMax($value){$this->data['healthmax'] = $value;} public function getHealthMax(){return $this->data['healthmax'];} public function setMana($value){$this->data['mana'] = $value;} public function getMana(){return $this->data['mana'];} public function setManaMax($value){$this->data['manamax'] = $value;} public function getManaMax(){return $this->data['manamax'];} public function setMagLevel($value){$this->data['maglevel'] = $value;} public function getMagLevel(){return $this->data['maglevel'];} public function setManaSpent($value){$this->data['manaspent'] = $value;} public function getManaSpent(){return $this->data['manaspent'];} public function setSex($value){$this->data['sex'] = $value;} public function getSex(){return $this->data['sex'];} public function setTown($value){$this->data['town_id'] = $value;} public function getTown(){return $this->data['town_id'];} public function setPosX($value){$this->data['posx'] = $value;} public function getPosX(){return $this->data['posx'];} public function setPosY($value){$this->data['posy'] = $value;} public function getPosY(){return $this->data['posy'];} public function setPosZ($value){$this->data['posz'] = $value;} public function getPosZ(){return $this->data['posz'];} public function setCapacity($value){$this->data['cap'] = $value;} public function getCapacity(){return $this->data['cap'];} public function setSoul($value){$this->data['soul'] = $value;} public function getSoul(){return $this->data['soul'];} public function setConditions($value){$this->data['conditions'] = $value;} public function getConditions(){return $this->data['conditions'];} public function setLastIP($value){$this->data['lastip'] = $value;} public function getLastIP(){return $this->data['lastip'];} public function setLastLogin($value){$this->data['lastlogin'] = $value;} public function getLastLogin(){return $this->data['lastlogin'];} public function setLastLogout($value){$this->data['lastlogout'] = $value;} public function getLastLogout(){return $this->data['lastlogout'];} public function setSkull($value){$this->data['skull'] = $value;} public function getSkull(){return $this->data['skull'];} public function setSkullTime($value){$this->data['skulltime'] = $value;} public function getSkullTime(){return $this->data['skulltime'];} public function setRankID($value){$this->data['rank_id'] = $value;} public function getRankID(){return $this->data['rank_id'];} public function setGuildNick($value){$this->data['guildnick'] = $value;} public function getGuildNick(){return $this->data['guildnick'];} public function setSave($value = 1){$this->data['save'] = (int) $value;} public function getSave(){return $this->data['save'];} public function setBlessings($value){$this->data['blessings'] = $value;} public function getBlessings(){return $this->data['blessings'];} public function setBalance($value){$this->data['balance'] = $value;} public function getBalance(){return $this->data['balance'];} public function setStamina($value){$this->data['stamina'] = $value;} public function getStamina(){return $this->data['stamina'];} public function setDirection($value){$this->data['direction'] = $value;} public function getDirection(){return $this->data['direction'];} public function setLossExperience($value){$this->data['loss_experience'] = $value;} public function getLossExperience(){return $this->data['loss_experience'];} public function setLossMana($value){$this->data['loss_mana'] = $value;} public function getLossMana(){return $this->data['loss_mana'];} public function setLossSkills($value){$this->data['loss_skills'] = $value;} public function getLossSkills(){return $this->data['loss_skills'];} public function setLossContainers($value){$this->data['loss_containers'] = $value;} public function getLossContainers(){return $this->data['loss_containers'];} public function setLossItems($value){$this->data['loss_items'] = $value;} public function getLossItems(){return $this->data['loss_items'];} public function setOnline($value){$this->data['online'] = (int) $value;} public function getOnline(){return (bool) $this->data['online'];} public function setMarriage($value){$this->data['marriage'] = $value;} public function getMarriage(){return $this->data['marriage'];} public function setDeleted($value){$this->data['deleted'] = (int) $value;} public function isDeleted(){return (bool) $this->data['deleted'];} public function setDescription($value){$this->data['description'] = $value;} public function getDescription(){return $this->data['description'];} public function setLookBody($value){$this->data['lookbody'] = $value;} public function getLookBody(){return $this->data['lookbody'];} public function setLookFeet($value){$this->data['lookfeet'] = $value;} public function getLookFeet(){return $this->data['lookfeet'];} public function setLookHead($value){$this->data['lookhead'] = $value;} public function getLookHead(){return $this->data['lookhead'];} public function setLookLegs($value){$this->data['looklegs'] = $value;} public function getLookLegs(){return $this->data['looklegs'];} public function setLookType($value){$this->data['looktype'] = $value;} public function getLookType(){return $this->data['looktype'];} public function setLookAddons($value){$this->data['lookaddons'] = $value;} public function getLookAddons(){return $this->data['lookaddons'];} /* * Custom AAC fields * create_ip , INT, default 0 * create_date , INT, default 0 * hide_char , INT, default 0 * comment , TEXT, 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 setHidden($value){$this->data['hide_char'] = (int) $value;} public function isHidden(){return (bool) $this->data['hide_char'];} public function setComment($value){$this->data['comment'] = $value;} public function getComment(){return $this->data['comment'];} /* * for compability with old scripts */ public function setGroup($value){$this->setGroupID($value);} public function getGroup(){return $this->getGroupID();} public function setWorld($value){$this->setWorldID($value);} public function getWorld(){return $this->getWorldID();} public function isOnline(){return $this->getOnline() == 1;} public function getCreated(){return $this->getCreateDate();} public function setCreated($value){$this->setCreateDate($value);} public function setCap($value){$this->setCapacity($value);} public function getCap(){return $this->getCapacity();} public function isSaveSet(){return $this->getSave();} public function unsetSave(){$this->setSave(0);} public function getTownId(){return $this->getTown();} public function getHideChar(){return $this->isHidden();} public function find($name){$this->loadByName($name);} }
  24. Blz gelera, entao meu problema e o seguinte eu contratrei um vps para rodar meu servidor tudo certinho esta em linux ubuntu 14.04 compilado certinho tfs 0.4 tudo pela ordem, quando eu abro o servidor nao aparece nenhum erro na distro ai alguem vai e cria um char knight por expl ai joga normal ai do nada o servidor trava fica tudo paralizado na tela o servidor nao cai mais tbm ngm consegue entrar ai quando eu derrubo o servidor para abir novamente o char que era knight vira druid por explo.. e ja procurei em diversos forum e nao consegui achar uma soluçao para isso adradeço desde ja a quem poder me ajudar!
×
×
  • Criar Novo...