Postado Janeiro 31, 2015 10 anos Tenta: doPlayerPopupFYI(cid, "Temos "..#getOnlinePlayers().." players online") Editado Janeiro 31, 2015 10 anos 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: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Janeiro 31, 2015 10 anos 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 Janeiro 31, 2015 10 anos 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 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: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Janeiro 31, 2015 10 anos 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 Janeiro 31, 2015 10 anos 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 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 Janeiro 31, 2015 10 anos 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.