Postado Dezembro 12, 2012 12 anos Matheus tente o seu script original novamente... só que use essa tag na talkaction só pra testar ... aqui no meu servidor deu certo! <talkaction log="yes" words="!leavehouse" filter="word-spaced" event="script" value="leavehouse.lua"/> Ver se funciona espero que dê certo! Editado Dezembro 12, 2012 12 anos por IagoNp (veja o histórico de edições)
Postado Dezembro 12, 2012 12 anos Tenta ae function onSay(cid, words, param, channel) local house = getHouseFromPos(getCreaturePosition(cid)) if(not house) then doPlayerSendCancel(cid, "You are not inside a house.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end local owner = getHouseInfo(house).owner if(owner ~= getPlayerGUID(cid) and (owner ~= getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER)) then doPlayerSendCancel(cid, "You are not the owner of this house.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end setHouseOwner(house, NO_OWNER_PHRASE, true) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) return true end Retirado. Skype: joaoxtibia85.
Postado Dezembro 12, 2012 12 anos Se tu tiver as sources, veja em houses.cpp void House::clean() { for(HouseBedList::iterator bit = bedsList.begin(); bit != bedsList.end(); ++bit) { if((*bit)->getSleeper()) (*bit)->wakeUp(); } removePlayers(true); transferToDepot(); } bool House::transferToDepot() { if(!townId) return false; Player* player = NULL; if(owner) { uint32_t tmp = owner; if(isGuild() && !IOGuild::getInstance()->swapGuildIdToOwner(tmp)) tmp = 0; if(tmp) player = g_game.getPlayerByGuidEx(tmp); } Item* item = NULL; Container* tmpContainer = NULL; ItemList moveList; for(HouseTileList::iterator it = houseTiles.begin(); it != houseTiles.end(); ++it) { for(uint32_t i = 0; i < (*it)->getThingCount(); ++i) { if(!(item = (*it)->__getThing(i)->getItem())) continue; if(item->isPickupable()) moveList.push_back(item); else if((tmpContainer = item->getContainer())) { for(ItemList::const_iterator it = tmpContainer->getItems(); it != tmpContainer->getEnd(); ++it) moveList.push_back(*it); } } } if(player) { Depot* depot = player->getDepot(townId, true); for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalMoveItem(NULL, (*it)->getParent(), depot, INDEX_WHEREEVER, (*it), (*it)->getItemCount(), NULL, FLAG_NOLIMIT); if(player->isVirtual()) { IOLoginData::getInstance()->savePlayer(player); delete player; } } else { for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalRemoveItem(NULL, (*it), (*it)->getItemCount(), false, FLAG_NOLIMIT); } return true; }
Postado Dezembro 13, 2012 12 anos Algumas pessoas tentam ajudar e talz mais são meio sem noção né, manda eu botar a tag na talkactions.xml... kkkkk Bom, mas o que vale é a intenção né.... Então kimos, já vi as sources e não tem nada diferente, está tudo certo creio eu, eu creio que o problema seja a encriptação dos tiles_itens mas eu entrei em contato com um cara que eu acho que vai me ajudar, espero um solução...
Postado Dezembro 13, 2012 12 anos Seguinte galera, consegui solucionar o erro, o problema realmente era na source do servidor, olhe a solução: Vá até house.cpp e procure por: bool House::transferToDepot() { if(!townId) return false; Player* player = NULL; if(owner) { uint32_t tmp = owner; if(isGuild() && !IOGuild::getInstance()->swapGuildIdToOwner(tmp)) tmp = 0; if(tmp) player = g_game.getPlayerByGuidEx(tmp); } Item* item = NULL; Container* tmpContainer = NULL; ItemList moveList; for(HouseTileList::iterator it = houseTiles.begin(); it != houseTiles.end(); ++it) { for(uint32_t i = 0; i < (*it)->getThingCount(); ++i) { if(!(item = (*it)->__getThing(i)->getItem())) continue; if(item->isPickupable()) moveList.push_back(item); else if((tmpContainer = item->getContainer())) { for(ItemList::const_iterator it = tmpContainer->getItems(); it != tmpContainer->getEnd(); ++it) moveList.push_back(*it); } } } if(player) { for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalRemoveItem(NULL, (*it), (*it)->getItemCount(), false, FLAG_NOLIMIT); if(player->isVirtual()) { IOLoginData::getInstance()->savePlayer(player); delete player; } } else { for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalRemoveItem(NULL, (*it), (*it)->getItemCount(), false, FLAG_NOLIMIT); } return true; }[/code] Agora substitua isso tudo por: [code]bool House::transferToDepot() { if(!townId) return false; Player* player = NULL; if(owner) { uint32_t tmp = owner; if(isGuild() && !IOGuild::getInstance()->swapGuildIdToOwner(tmp)) tmp = 0; if(tmp) player = g_game.getPlayerByGuidEx(tmp); } Container* tmpContainer = NULL; TileItemVector* items = NULL; ItemList moveList; for(HouseTileList::iterator it = houseTiles.begin(); it != houseTiles.end(); ++it) { if(!(items = (*it)->getItemList())) continue; for(ItemVector::iterator iit = items->begin(); iit != items->end(); ++iit) { if((*iit)->isPickupable()) moveList.push_back(*iit); else if((tmpContainer = (*iit)->getContainer())) { for(ItemList::const_iterator cit = tmpContainer->getItems(); cit != tmpContainer->getEnd(); ++cit) moveList.push_back(*cit); } } } if(player) { Depot* depot = player->getDepot(townId, true); for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalMoveItem(NULL, (*it)->getParent(), depot, INDEX_WHEREEVER, (*it), (*it)->getItemCount(), NULL, FLAG_NOLIMIT); if(player->isVirtual()) { IOLoginData::getInstance()->savePlayer(player); delete player; } } else { for(ItemList::iterator it = moveList.begin(); it != moveList.end(); ++it) g_game.internalRemoveItem(NULL, (*it), (*it)->getItemCount(), false, FLAG_NOLIMIT); } return true; } Pronto erro solucionado! Sim kimos, era a source.. ;p
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.