affz o meu os player n ta conseguindo comprar oque eu faço?
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- [Talkaction] Buy House
5
6.2k
1 ano depois...
info
Grupo: Campones
Registrado: 22/12/12
Posts: 3
Reputação: 0
Char no Tibia: Mage'oz

23 de dezembro de 2012 às 15:21
6 meses depois...
info
Grupo: Campones
Registrado: 25/07/12
Posts: 23
Reputação: 0
Char no Tibia: Nenhum

16 de junho de 2013 às 18:58
aqui nao funcionou nao, 8.6 distro 0.4.
6 meses depois...
11 de dezembro de 2013 às 13:48
eu coloco as scripts em que lugar ??
2 meses depois...
info
Grupo: Campones
Registrado: 29/12/13
Posts: 86
Reputação: +17
Char no Tibia: [ADM] Wolf

23 de fevereiro de 2014 às 01:07
Vão ao config.lua do seu server, procurem por Houses e troque o false por true, e assim seus players poderao compras as houses normalmente


info
Grupo: Campones
Registrado: 11/01/11
Posts: 59
Reputação: +56
Eai pessoal, há alguns dias eu fiz o Buy House totalmente em lua, e hoje então resolvi postar o script:
O que ele faz: Compra a house quando o player estiver olhando na porta da house.
Script:
local function getBoolean(x) local e = false if type(x) == "boolean" then e = x else e = getBooleanFromString(x) end return e end function onSay(cid, words, param, channel) if not isPlayer(cid) or getBoolean(getConfigValue('buyableAndSellableHouses')) == false then return true end local pos = getPlayerLookPos(cid) local tile = getTileInfo(pos) if not tile then doPlayerSendCancel(cid, "You have to be looking at door of flat you would like to purchase.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local house = getHouseFromPos(pos) if not house then doPlayerSendCancel(cid, "You have to be looking at door of flat you would like to purchase.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local doorPos = getThingFromPos({ x=pos.x, y=pos.y, z=pos.z, stackpos=1}).itemid if not isItemDoor(doorPos) then doPlayerSendCancel(cid, "You have to be looking at door of flat you would like to purchase.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local houseInfo = getHouseInfo(house) local guild = houseInfo.guildHall local guid = getPlayerGUID(cid) if guild == false then if getHouseByPlayerGUID(guid) then doTeleportThing(cid,getHouseEntry(getHouseByPlayerGUID(guid))) doPlayerSendCancel(cid, "You already rent another house.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local accountHouses = tonumber(getConfigValue('housesPerAccount')) local account = getPlayerAccountId(cid) local housesInAccountsql = db.getResult("SELECT `p`.`account_id` FROM `houses` h LEFT JOIN `players` p ON `h`.`owner` = `p`.`id` WHERE `p`.`account_id` = " .. account .. " AND `guild` = 0;") local housesInAccount = housesInAccountsql:getID() == -1 and 0 or housesInAccountsql:getRows(free) housesInAccountsql:free() if accountHouses > 0 and housesInAccount >= accountHouses then doPlayerSendCancel(cid, "You may own only " .. accountHouses .. " house\'s per account.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end if getBoolean(getConfigValue('houseNeedPremium')) == true and not isPremium(cid) then doPlayerSendCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local levelToBuyHouse = tonumber(getConfigValue('levelToBuyHouse')) if getPlayerLevel(cid) < levelToBuyHouse then doPlayerSendCancel(cid, "You have to be at least Level " .. levelToBuyHouse .. " to purchase a house.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end else if not getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER then doPlayerSendCancel(cid, "You have to be at least a guild leader to purchase a hall.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end local guildHouses = getPlayerGuildId(cid) local housesInGuildsql = db.getResult("SELECT `owner` FROM `houses` WHERE `owner` = " .. guildHouses .. " AND `guild` = 1;"):getRows(free) local housesInGuild = housesInGuildsql:getID() == -1 and 0 or housesInGuildsql:getRows(free) housesInGuildsql:free() if housesInGuild ~= 0 then doPlayerSendCancel(cid, "Your guild rents already another hall.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end end if getHouseOwner(house) ~= 0 then doPlayerSendCancel(cid, "This flat is already owned by someone else.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end if getPlayerMoney(cid) < getHousePrice(house) or not doPlayerRemoveMoney(cid, getHousePrice(house)) then doPlayerSendCancel(cid, "You do not have enough money.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return true end setHouseOwner(house, guid, true) local ret = "You have successfully bought this " if guild == true then ret = ret .. "hall" else ret = ret .. "house" end ret = ret .. ", remember to leave money at " if guild == true then ret = ret .. "guild owner " end if getBoolean(getConfigValue('bankSystem')) then ret = ret .. "bank or " end ret = ret .. "depot of this town for rent." doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ret) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) return true endTag XML:
Como Funciona:
O player fica em frente a porta da house, fala o comando, se estiver tudo certo ele compra a house.
Bom é isso xP
Editado Outubro 26 por Digaao