Postado Setembro 4, 2021 3 anos Autor Em 03/09/2021 em 12:10, Vodkart disse: abri meu servidor para testar e deu certo, a house foi dada ao jogador sem maiores problemas!!! ou a houses não estão configuradas de forma correta no mapa ou é a função da lib mesmo... qual servidor/distro vc usa? consegui arruma ja ta transferindo a house só q agora tem outro problema, tipo ele remove a pedra e coloca escada mas queria q quando acabar o evento removia a escada e voltava para pedra Mostrar conteúdo oculto local THRONE_POS = {x = 2561, y = 2446, z = 5} local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 15 -- in minutes local days = {"Friday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function getWinnerCastle() CastleWalls() local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local id, pid = 561, getPlayerGUID(player) setHouseOwner(id, pid) db.executeQuery("UPDATE `houses` SET `owner` = "..pid.." WHERE `id` = "..id) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function CastleWalls() local pedra = getTileItemById({ x = 2539, y = 2474, z = 7}, 1285) local escada = getTileItemById({ x = 2525, y = 2471, z = 7}, 3687) if pedra.uid > 0 then return doRemoveItem(pedra.uid) else return doCreateItem(1285, 1, { x = 2539, y = 2474, z = 7}) end if escada.uid > 0 then return doRemoveItem(escada.uid) else return doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) end end function onTimer() if isEventDay() then doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) OpenEvent() CastleWalls() addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end Editado Setembro 4, 2021 3 anos por Gatinha Pirada (veja o histórico de edições)
Postado Dezembro 29, 2021 3 anos Em 04/09/2021 em 22:09, Gatinha Pirada disse: consegui arruma ja ta transferindo a house só q agora tem outro problema, tipo ele remove a pedra e coloca escada mas queria q quando acabar o evento removia a escada e voltava para pedra Mostrar conteúdo oculto Mostrar conteúdo oculto local THRONE_POS = {x = 2561, y = 2446, z = 5} local STORAGE_EVENT = 83902 local STORAGE_PLAYER = 73289 local DUR = 15 -- in minutes local days = {"Friday", "Saturday", "Thursday"} -- coloque os dias function OpenEvent() for _, tid in ipairs(getPlayersOnline()) do setPlayerStorageValue(tid, STORAGE_PLAYER, 1) end setGlobalStorageValue(STORAGE_EVENT, 1) doBroadcastMessage("O Evento castle foi aberto e vai durar ".. DUR .." minutos.", 25) end function getWinnerCastle() CastleWalls() local player = getTopCreature(THRONE_POS).uid if getGlobalStorageValue(STORAGE_EVENT) < 0 then return true end if (isPlayer(player)) then if (getPlayerStorageValue(player, STORAGE_PLAYER) > 0) then local id, pid = 561, getPlayerGUID(player) setHouseOwner(id, pid) db.executeQuery("UPDATE `houses` SET `owner` = "..pid.." WHERE `id` = "..id) doPlayerAddPremiumDays(player, 7) for _, cid in ipairs(getPlayersOnline()) do setPlayerStorageValue(cid, STORAGE_PLAYER, 0) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end doBroadcastMessage(getCreatureName(player) .. " ganhou o evento.", 25) doTeleportThing(player, {x = 2531, y = 2460, z = 7}) doCreateItem(391, 1, {x = 2561, y = 2446, z = 5}) end else doBroadcastMessage("Ningúem ganhou o evento.", 27) for _, pid in ipairs(getPlayersOnline()) do setPlayerStorageValue(pid, STORAGE_PLAYER, 0) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) end end setGlobalStorageValue(STORAGE_EVENT, 0) return db.executeQuery("DELETE FROM `player_storage` WHERE `key` = " .. STORAGE_PLAYER) end function isEventDay() for _, dia in pairs(days) do if dia == os.date("%A") then return true end end return false end function CastleWalls() local pedra = getTileItemById({ x = 2539, y = 2474, z = 7}, 1285) local escada = getTileItemById({ x = 2525, y = 2471, z = 7}, 3687) if pedra.uid > 0 then return doRemoveItem(pedra.uid) else return doCreateItem(1285, 1, { x = 2539, y = 2474, z = 7}) end if escada.uid > 0 then return doRemoveItem(escada.uid) else return doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) end end function onTimer() if isEventDay() then doCreateItem(3687, 1, {x = 2539, y = 2474, z = 7}) OpenEvent() CastleWalls() addEvent(getWinnerCastle, DUR * 60 * 1000) end return true end tem que colocar alguma action no trono? eu fiz aq abriu evento mas quando subo no trono n acontece nada... TfS 0.5
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.