Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Qual o motivo deste tópico? 

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

Eu estou com um erro nos sistema de loteria que estou tentando colocar e ambos dão o erro com nome getPlayersOnline

 

Você tem o código disponível? Se tiver publique-o aqui: 

 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

error.png

Link para o post
Compartilhar em outros sites
5 horas atrás, megatibiano disse:

Você tem o código disponível? Se tiver publique-o aqui: 

O fórum é tão auto explicativo e as pessoas não conseguem entender, pqp

Como você imagina que alguém vai te ajudar sem o código cara? mano do céu 

Link para o post
Compartilhar em outros sites

Opa mano, e esse ai a baixo só peço uma coisa se esta mal humorado, e vem conversar com os outros assim peço que nem me responda prefiro ficar sem o script msm.

 

  

Em 22/06/2022 em 01:00, luanluciano93 disse:

O fórum é tão auto explicativo e as pessoas não conseguem entender, pqp

Como você imagina que alguém vai te ajudar sem o código cara? mano do céu 

local config = {
        lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message)
        rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria
        crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160).
        website = "yes", -- Only if you have php scripts and table `lottery` in your database!
        days = {
                "Monday-08:00",
                "Monday-13:00",
                "Monday-19:30",

                "Tuesday-08:00",
                "Tuesday-13:00",
                "Tuesday-19:30",

                "Wednesday-08:00",
                "Wednesday-13:00",
                "Wednesday-19:30",

                "Thursday-08:00",
                "Thursday-13:00",
                "Thursday-19:30",

                "Friday-01:22",
                "Friday-13:00",
                "Friday-19:30",

                "Saturday-21:27",
                "Saturday-21:28",
                "Saturday-21:29",

                "Sunday-08:00",
                "Sunday-13:00",
                "Sunday-19:30"
                }
        }
local function getPlayerWorldId(cid)
    if not(isPlayer(cid)) then
        return false
    end
    local pid = getPlayerGUID(cid)
    local worldPlayer = 0
    local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";")
    if(result_plr:getID() ~= -1) then
        worldPlayer = tonumber(result_plr:getDataInt("world_id"))
        result_plr:free()
        return worldPlayer
    end
    return false
end

local function getOnlineParticipants()
    local players = {}
    for _, pid in pairs(getPlayersOnline()) do
        if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then
            table.insert(players, pid)
        end
    end
    if #players > 0 then
        return players
    end
    return false
end
     
function onThink(cid, interval)
    if table.find(config.days, os.date("%A-%H:%M")) then
        if(getWorldCreatures(o) <= 0)then
            return true
        end

        local query = db.query or db.executeQuery
        local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
        local item_name = getItemNameById(random_item)  
        local data = os.date("%d/%m/%Y - %H:%M:%S")
        local online = getOnlineParticipants()
       
        if online then
            local winner = online[math.random(1, #online)]
            local world = tonumber(getPlayerWorldId(winner))
           
            if(random_item == 2160) then
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doPlayerAddItem(winner, random_item, config.crystal_counts)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
            else
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
                doPlayerAddItem(winner, random_item, 1)
            end
            if(config.website == "yes") then
                query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');")
            end
        else
            print("Ninguem OnLine pra ganhar na loteria")
        end
    end
    return true
end
Link para o post
Compartilhar em outros sites
  • 3 weeks later...
  • Moderador
Em 23/06/2022 em 23:14, megatibiano disse:

Opa mano, e esse ai a baixo só peço uma coisa se esta mal humorado, e vem conversar com os outros assim peço que nem me responda prefiro ficar sem o script msm.

 

  


local config = {
        lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message)
        rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria
        crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160).
        website = "yes", -- Only if you have php scripts and table `lottery` in your database!
        days = {
                "Monday-08:00",
                "Monday-13:00",
                "Monday-19:30",

                "Tuesday-08:00",
                "Tuesday-13:00",
                "Tuesday-19:30",

                "Wednesday-08:00",
                "Wednesday-13:00",
                "Wednesday-19:30",

                "Thursday-08:00",
                "Thursday-13:00",
                "Thursday-19:30",

                "Friday-01:22",
                "Friday-13:00",
                "Friday-19:30",

                "Saturday-21:27",
                "Saturday-21:28",
                "Saturday-21:29",

                "Sunday-08:00",
                "Sunday-13:00",
                "Sunday-19:30"
                }
        }
local function getPlayerWorldId(cid)
    if not(isPlayer(cid)) then
        return false
    end
    local pid = getPlayerGUID(cid)
    local worldPlayer = 0
    local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";")
    if(result_plr:getID() ~= -1) then
        worldPlayer = tonumber(result_plr:getDataInt("world_id"))
        result_plr:free()
        return worldPlayer
    end
    return false
end

local function getOnlineParticipants()
    local players = {}
    for _, pid in pairs(getPlayersOnline()) do
        if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then
            table.insert(players, pid)
        end
    end
    if #players > 0 then
        return players
    end
    return false
end
     
function onThink(cid, interval)
    if table.find(config.days, os.date("%A-%H:%M")) then
        if(getWorldCreatures(o) <= 0)then
            return true
        end

        local query = db.query or db.executeQuery
        local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
        local item_name = getItemNameById(random_item)  
        local data = os.date("%d/%m/%Y - %H:%M:%S")
        local online = getOnlineParticipants()
       
        if online then
            local winner = online[math.random(1, #online)]
            local world = tonumber(getPlayerWorldId(winner))
           
            if(random_item == 2160) then
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doPlayerAddItem(winner, random_item, config.crystal_counts)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
            else
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
                doPlayerAddItem(winner, random_item, 1)
            end
            if(config.website == "yes") then
                query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');")
            end
        else
            print("Ninguem OnLine pra ganhar na loteria")
        end
    end
    return true
end

 

 

local config = {
        lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message)
        rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria
        crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160).
        website = "yes", -- Only if you have php scripts and table `lottery` in your database!
        days = {
                "Monday-08:00",
                "Monday-13:00",
                "Monday-19:30",

                "Tuesday-08:00",
                "Tuesday-13:00",
                "Tuesday-19:30",

                "Wednesday-08:00",
                "Wednesday-13:00",
                "Wednesday-19:30",

                "Thursday-08:00",
                "Thursday-13:00",
                "Thursday-19:30",

                "Friday-01:22",
                "Friday-13:00",
                "Friday-19:30",

                "Saturday-21:27",
                "Saturday-21:28",
                "Saturday-21:29",

                "Sunday-08:00",
                "Sunday-13:00",
                "Sunday-19:30"
                }
        }
local function getPlayerWorldId(cid)
    if not(isPlayer(cid)) then
        return false
    end
    local pid = getPlayerGUID(cid)
    local worldPlayer = 0
    local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";")
    if(result_plr:getID() ~= -1) then
        worldPlayer = tonumber(result_plr:getDataInt("world_id"))
        result_plr:free()
        return worldPlayer
    end
    return false
end

local function getOnlineParticipants()

    local players = {}
    players[i] = pid
    for i, pid in pairs(getPlayersOnline()) do
        if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then
            table.insert(players, pid)
        end
    end
    
    
    if #players > 0 then
        return players
    end
    return false
end
     
function onThink(cid, interval)
    if table.find(config.days, os.date("%A-%H:%M")) then
        if(getWorldCreatures(o) <= 0)then
            return true
        end

        local query = db.query or db.executeQuery
        local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
        local item_name = getItemNameById(random_item)  
        local data = os.date("%d/%m/%Y - %H:%M:%S")
        local online = getOnlineParticipants()
       
        if online then
            local winner = online[math.random(1, #online)]
            local world = tonumber(getPlayerWorldId(winner))
           
            if(random_item == 2160) then
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doPlayerAddItem(winner, random_item, config.crystal_counts)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
            else
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
                doPlayerAddItem(winner, random_item, 1)
            end
            if(config.website == "yes") then
                query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');")
            end
        else
            print("Ninguem OnLine pra ganhar na loteria")
        end
    end
    return true
end

 

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

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites
Em 10/07/2022 em 00:08, L3K0T disse:

 


local config = {
        lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message)
        rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria
        crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160).
        website = "yes", -- Only if you have php scripts and table `lottery` in your database!
        days = {
                "Monday-08:00",
                "Monday-13:00",
                "Monday-19:30",

                "Tuesday-08:00",
                "Tuesday-13:00",
                "Tuesday-19:30",

                "Wednesday-08:00",
                "Wednesday-13:00",
                "Wednesday-19:30",

                "Thursday-08:00",
                "Thursday-13:00",
                "Thursday-19:30",

                "Friday-01:22",
                "Friday-13:00",
                "Friday-19:30",

                "Saturday-21:27",
                "Saturday-21:28",
                "Saturday-21:29",

                "Sunday-08:00",
                "Sunday-13:00",
                "Sunday-19:30"
                }
        }
local function getPlayerWorldId(cid)
    if not(isPlayer(cid)) then
        return false
    end
    local pid = getPlayerGUID(cid)
    local worldPlayer = 0
    local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";")
    if(result_plr:getID() ~= -1) then
        worldPlayer = tonumber(result_plr:getDataInt("world_id"))
        result_plr:free()
        return worldPlayer
    end
    return false
end

local function getOnlineParticipants()

    local players = {}
    players[i] = pid
    for i, pid in pairs(getPlayersOnline()) do
        if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then
            table.insert(players, pid)
        end
    end
    
    
    if #players > 0 then
        return players
    end
    return false
end
     
function onThink(cid, interval)
    if table.find(config.days, os.date("%A-%H:%M")) then
        if(getWorldCreatures(o) <= 0)then
            return true
        end

        local query = db.query or db.executeQuery
        local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
        local item_name = getItemNameById(random_item)  
        local data = os.date("%d/%m/%Y - %H:%M:%S")
        local online = getOnlineParticipants()
       
        if online then
            local winner = online[math.random(1, #online)]
            local world = tonumber(getPlayerWorldId(winner))
           
            if(random_item == 2160) then
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doPlayerAddItem(winner, random_item, config.crystal_counts)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
            else
                doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24)
                doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")")
                doPlayerAddItem(winner, random_item, 1)
            end
            if(config.website == "yes") then
                query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');")
            end
        else
            print("Ninguem OnLine pra ganhar na loteria")
        end
    end
    return true
end

 

Deu isso aqui image.thumb.png.f4ea0547d2d706174cc7833f5035c8ed.png

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 braianlomas
      Como faço para corrigir esse problema para meu cliente, eu uso o tfs 0.3.6  
      Quero resolver esse problema que tenho no meu cliente, como e onde posso resolver?  
      Eu uso o tfs 0.3.6, não tenho as fontes do cliente, se você puder me dar eu vou amá-las para sempre  
       

       
    • Por A.Mokk
      Ola pessoal, estou tentando compilar o TFS 1.5 Downgrade para 8.60 atraves do MSVC 2022, ao tentar compilar da o seguinte erro:
       
       
      Fiz o download do MSVC, GitDash, TFS-SDK-3.2, e de varios boosts que tentei, ao fazer o seguinte procedimento no GitDash:
       
      Ao chegar em ./bootstrap-vcpkg.bat o GitDash nao consegue realizar o procedimento corretamente, alguem poderia me ajudar ?

      Tentei de diversas formas mas o mesmo erro sempre persiste, atualmente meu servidor utiliza TFS 0.4, consigo compilar sem nenhum problema no MSVC 2010, porem, as limitações do TFS 0.4 estão me fazendo precisar atualizar, se alguem souber como corrigir esses erros eu agradeço !

      Tutoriais utilizados :
      Compiling on Windows (vcpkg) · otland/forgottenserver Wiki · GitHub
      Compiling on Windows · otland/forgottenserver Wiki · GitHub
      Compilando TFS 1.3 com vídeo-aula - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
      Compilar TFS 1.3 Vcpkg - Tutoriais Infraestrutura & Proteção - Tibia King - Tudo sobre Tibia, OTServ e Bots!
       
      O que acontece no Powershell:
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary 2.3.6
      Qual o motivo deste tópico? 
      Queria fazer com que os players não pudessem mexer no aleta sio, pois, agora os mesmos estão conseguindo mexer nos itens
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      canary para o cliente 13.16
      Qual o motivo deste tópico? 
      Não consigo encontrar onde ajusta
      to com o problema no 13.16  o exausted, por exemplo os kinas era pra combar exori, erori gran e exori min, porém não ta indo ta dando exausted o char ta soltando magia ou runa e não consegue usar as potions
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Andersontatuador
      Olá galera da TK, me chamo Anderson estou procurando alguém profissional em otservs e site.
      Já tenho um servidor o site e o cliente preciso só de uma pessoal competente, que esteja empenhado a trabalhar,
      não quero nada de graça, pois nessa onda fui mais roubado do quer eu pagar um profissional.
      caso alguém se interesse entrar em contato comigo através do whatsapp
      82 9 9304-9462
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo