Ir para conteúdo

Featured Replies

Postado

Tenta:

doPlayerPopupFYI(cid, "Temos "..#getOnlinePlayers().." players online")

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

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

  • Respostas 26
  • Visualizações 2.5k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vá na pasta data/creaturescripts e adicione essa tag ao arquivo creaturescripts.xml: <event type="login" name="Popup1" event="script" value="popup1.lua"/> Agora vá na pasta data/creaturescri

  • local msg = "Mensagem que vc qr" function onLogin(cid)     if getCreatureName(cid) ~= "Account Manager" then         if getPlayerStorageValue(cid, 1691) ~= 1 then             doPlayerPopupFYI(cid, msg

Postado
  • Autor

 

Tenta:

doPlayerPopupFYI(cid, "Temos "..#getOnlinePlayers().." players online")

fico legal só que ta aparecendo primeiro uma mensagem em popup falando os players online depois a mensagem tem como colocar tudo junto n ??

function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onSay(cid)
    local str = 'mensagem '..getUpTimeString()
    doPlayerPopupFYI(cid, "Temos "..#getOnlinePlayers().." players online")
    doPlayerPopupFYI(cid, str)
    return true
end

I like

Postado
function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onSay(cid)
    local str = 'mensagem '..getUpTimeString()' e no momento temos: '..#getOnlinePlayers()..' players online'
    doPlayerPopupFYI(cid, str)
    return true
end

Poste o resultado, quero ver como ficou na prática ;D

Abraços.

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado

muito bom teria como por para ver quantidades de players online tb ? embaixo do uptime.

Creaturescript:
function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onLogin(cid)
    local redlenght, blacklenght, onp = math.floor(getConfigInfo('redSkullLength') / 86400), math.floor(getConfigInfo('blackSkullLength') / 86400), #getOnlinePlayers()
    local str = 'Welcome to UnderWar Retro Tibia Server\nServer Information:\n\nExp Stage: x'..(getConfigInfo('experienceStages') == 'true' and getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) or getConfigInfo('rateExperience'))..'\nSkills rate: x'..getConfigInfo('rateSkill')..'\nLoot Rate: x'..getConfigInfo('rateLoot')..'\nMagic Rate: x'..getConfigInfo('rateMagic')..'\nSpawns Rate: x'..getConfigInfo('rateSpawn')..'\n\nWorld Type: '..(getWorldType() == 1 and 'No-PVP' or getWorldType() == 2 and 'PVP' or 'PVP-Enforced')..'\nFrags RED Skull: '..getConfigInfo('dailyFragsToRedSkull')..' por dia, '..getConfigInfo('weeklyFragsToRedSkull')..' por semana ou '..getConfigInfo('monthlyFragsToRedSkull')..' por mês. Duração: '..redlenght..' dia'..(redlenght > 1 and 's' or '')..'.\nFrags BLACK Skull: '..getConfigInfo('dailyFragsToBlackSkull')..' por dia, '..getConfigInfo('weeklyFragsToBlackSkull')..' por semana ou '..getConfigInfo('monthlyFragsToBlackSkull')..' por mês. Duração: '..blacklenght..' dia'..(blacklenght > 1 and 's' or '')..'.\n\nProtection System:\nAté o level '..getConfigInfo('protectionLevel')..', o jogador que morrer sem skull não perderá seu loot.\n\nPromotion System:\nVoce pode comprar sua promotion na Queen Eloise ou King Tibianus por 20k ou pode fazer a Desert Quest e ganhar de graça a promotion!\n\nBlessing System:\nJogadores possuem as 5 blessings, incluindo proteção aos seus itens.\nJogadores Red e Black Skull sempre perderão o loot.\n\nHouses: Pagamento semanal no DP da cidade onde está a casa.\n\n'..(getPlayerPremiumDays(cid) < 1 and 'VIP days: Torne-se VIP e ajude o servidor a continuar online.' or 'Ainda lhe restam '..getPlayerPremiumDays(cid)..' dias de VIP.')..'\n\nUptime: '..getUpTimeString()..'\n'..onp..' player'..(onp > 1 and 's' or '')..' online.'
    
    if getPlayerLastLoginSaved(cid) < 1 then
        doPlayerPopupFYI(cid, str)
    end
    
    return true
end




Talkaction:

function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onSay(cid)
    local redlenght, blacklenght = math.floor(getConfigInfo('redSkullLength') / 86400), math.floor(getConfigInfo('blackSkullLength') / 86400)
    local str = 'Welcome to UnderWar Retro Tibia Server\nServer Information:\n\nExp Stage: x'..(getConfigInfo('experienceStages') == 'true' and getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) or getConfigInfo('rateExperience'))..'\nSkills rate: x'..getConfigInfo('rateSkill')..'\nLoot Rate: x'..getConfigInfo('rateLoot')..'\nMagic Rate: x'..getConfigInfo('rateMagic')..'\nSpawns Rate: x'..getConfigInfo('rateSpawn')..'\n\nWorld Type: '..(getWorldType() == 1 and 'No-PVP' or getWorldType() == 2 and 'PVP' or 'PVP-Enforced')..'\nFrags RED Skull: '..getConfigInfo('dailyFragsToRedSkull')..' por dia, '..getConfigInfo('weeklyFragsToRedSkull')..' por semana ou '..getConfigInfo('monthlyFragsToRedSkull')..' por mês. Duração: '..redlenght..' dia'..(redlenght > 1 and 's' or '')..'.\nFrags BLACK Skull: '..getConfigInfo('dailyFragsToBlackSkull')..' por dia, '..getConfigInfo('weeklyFragsToBlackSkull')..' por semana ou '..getConfigInfo('monthlyFragsToBlackSkull')..' por mês. Duração: '..blacklenght..' dia'..(blacklenght > 1 and 's' or '')..'.\n\nProtection System:\nAté o level '..getConfigInfo('protectionLevel')..', o jogador que morrer sem skull não perderá seu loot.\n\nPromotion System:\nVoce pode comprar sua promotion na Queen Eloise ou King Tibianus por 20k ou pode fazer a Desert Quest e ganhar de graça a promotion!\n\nBlessing System:\nJogadores possuem as 5 blessings, incluindo proteção aos seus itens.\nJogadores Red e Black Skull sempre perderão o loot.\n\nHouses: Pagamento semanal no DP da cidade onde está a casa.\n\n'..(getPlayerPremiumDays(cid) < 1 and 'VIP days: Torne-se VIP e ajude o servidor a continuar online.' or 'Ainda lhe restam '..getPlayerPremiumDays(cid)..' dias de VIP.')..'\n\nUptime: '..getUpTimeString()..'\n'..onp..' player'..(onp > 1 and 's' or '')..' online.'
    
    doPlayerPopupFYI(cid, str)
    return true
end

The corrupt fear us.

The honest support us.

The heroic join us.

Postado
  • Autor
function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onSay(cid)
    local str = 'mensagem '..getUpTimeString()' e no momento temos: '..#getOnlinePlayers()..' players online'
    doPlayerPopupFYI(cid, str)
    return true
end

Poste o resultado, quero ver como ficou na prática ;D

Abraços.

 

da esse erro

 

 
[31/1/2015 18:25:11] [Error - TalkAction Interface] 
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:onSay
[31/1/2015 18:25:11] Description: 
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:14: attempt to compare number with nil
[31/1/2015 18:25:11] stack traceback:
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:14: in function <data/talkactions/scripts/serverinfo.lua:13>

Creaturescript:

function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onLogin(cid)
    local redlenght, blacklenght, onp = math.floor(getConfigInfo('redSkullLength') / 86400), math.floor(getConfigInfo('blackSkullLength') / 86400), #getOnlinePlayers()
    local str = 'Welcome to UnderWar Retro Tibia Server\nServer Information:\n\nExp Stage: x'..(getConfigInfo('experienceStages') == 'true' and getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) or getConfigInfo('rateExperience'))..'\nSkills rate: x'..getConfigInfo('rateSkill')..'\nLoot Rate: x'..getConfigInfo('rateLoot')..'\nMagic Rate: x'..getConfigInfo('rateMagic')..'\nSpawns Rate: x'..getConfigInfo('rateSpawn')..'\n\nWorld Type: '..(getWorldType() == 1 and 'No-PVP' or getWorldType() == 2 and 'PVP' or 'PVP-Enforced')..'\nFrags RED Skull: '..getConfigInfo('dailyFragsToRedSkull')..' por dia, '..getConfigInfo('weeklyFragsToRedSkull')..' por semana ou '..getConfigInfo('monthlyFragsToRedSkull')..' por mês. Duração: '..redlenght..' dia'..(redlenght > 1 and 's' or '')..'.\nFrags BLACK Skull: '..getConfigInfo('dailyFragsToBlackSkull')..' por dia, '..getConfigInfo('weeklyFragsToBlackSkull')..' por semana ou '..getConfigInfo('monthlyFragsToBlackSkull')..' por mês. Duração: '..blacklenght..' dia'..(blacklenght > 1 and 's' or '')..'.\n\nProtection System:\nAté o level '..getConfigInfo('protectionLevel')..', o jogador que morrer sem skull não perderá seu loot.\n\nPromotion System:\nVoce pode comprar sua promotion na Queen Eloise ou King Tibianus por 20k ou pode fazer a Desert Quest e ganhar de graça a promotion!\n\nBlessing System:\nJogadores possuem as 5 blessings, incluindo proteção aos seus itens.\nJogadores Red e Black Skull sempre perderão o loot.\n\nHouses: Pagamento semanal no DP da cidade onde está a casa.\n\n'..(getPlayerPremiumDays(cid) < 1 and 'VIP days: Torne-se VIP e ajude o servidor a continuar online.' or 'Ainda lhe restam '..getPlayerPremiumDays(cid)..' dias de VIP.')..'\n\nUptime: '..getUpTimeString()..'\n'..onp..' player'..(onp > 1 and 's' or '')..' online.'
    
    if getPlayerLastLoginSaved(cid) < 1 then
        doPlayerPopupFYI(cid, str)
    end
    
    return true
end

Talkaction:

function getUpTimeString()
    local wut = getWorldUpTime()
    local h, m = math.floor(wut / 3600), math.floor((wut % 3600) / 60)
    
    if m == 60 then
        m = 0
        h = h + 1
    end
    
    return h..' hour'..(h > 1 and 's' or '')..' and '..m..' minute'..(m > 1 and 's' or '')
end

function onSay(cid)
    local redlenght, blacklenght = math.floor(getConfigInfo('redSkullLength') / 86400), math.floor(getConfigInfo('blackSkullLength') / 86400)
    local str = 'Welcome to UnderWar Retro Tibia Server\nServer Information:\n\nExp Stage: x'..(getConfigInfo('experienceStages') == 'true' and getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) or getConfigInfo('rateExperience'))..'\nSkills rate: x'..getConfigInfo('rateSkill')..'\nLoot Rate: x'..getConfigInfo('rateLoot')..'\nMagic Rate: x'..getConfigInfo('rateMagic')..'\nSpawns Rate: x'..getConfigInfo('rateSpawn')..'\n\nWorld Type: '..(getWorldType() == 1 and 'No-PVP' or getWorldType() == 2 and 'PVP' or 'PVP-Enforced')..'\nFrags RED Skull: '..getConfigInfo('dailyFragsToRedSkull')..' por dia, '..getConfigInfo('weeklyFragsToRedSkull')..' por semana ou '..getConfigInfo('monthlyFragsToRedSkull')..' por mês. Duração: '..redlenght..' dia'..(redlenght > 1 and 's' or '')..'.\nFrags BLACK Skull: '..getConfigInfo('dailyFragsToBlackSkull')..' por dia, '..getConfigInfo('weeklyFragsToBlackSkull')..' por semana ou '..getConfigInfo('monthlyFragsToBlackSkull')..' por mês. Duração: '..blacklenght..' dia'..(blacklenght > 1 and 's' or '')..'.\n\nProtection System:\nAté o level '..getConfigInfo('protectionLevel')..', o jogador que morrer sem skull não perderá seu loot.\n\nPromotion System:\nVoce pode comprar sua promotion na Queen Eloise ou King Tibianus por 20k ou pode fazer a Desert Quest e ganhar de graça a promotion!\n\nBlessing System:\nJogadores possuem as 5 blessings, incluindo proteção aos seus itens.\nJogadores Red e Black Skull sempre perderão o loot.\n\nHouses: Pagamento semanal no DP da cidade onde está a casa.\n\n'..(getPlayerPremiumDays(cid) < 1 and 'VIP days: Torne-se VIP e ajude o servidor a continuar online.' or 'Ainda lhe restam '..getPlayerPremiumDays(cid)..' dias de VIP.')..'\n\nUptime: '..getUpTimeString()..'\n'..onp..' player'..(onp > 1 and 's' or '')..' online.'
    
    doPlayerPopupFYI(cid, str)
    return true
end

da esse erro

 
[31/1/2015 18:25:11] [Error - TalkAction Interface] 
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:onSay
[31/1/2015 18:25:11] Description: 
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:14: attempt to compare number with nil
[31/1/2015 18:25:11] stack traceback:
[31/1/2015 18:25:11] data/talkactions/scripts/serverinfo.lua:14: in function <data/talkactions/scripts/serverinfo.lua:13>

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

I like

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo