Ir para conteúdo

Absolute

Héroi
  • Registro em

  • Última visita

Tudo que Absolute postou

  1. Conforme o pedido do ViitinG lindo e do absoftfgn: function onLogin(cid) local storage = 2522 if getPlayerStorageValue(cid, storage) == -1 then doPlayerSendTextMessage(cid, 22, "Hello "..getPlayerName(cid).." this is your first visit to YOURSERVNAME. go kill some rotworms until level 20 then go to cyclops!") setPlayerStorageValue(cid, storage, 1) else doPlayerPopupFYI(cid, "Welcome back "..getPlayerName(cid).."!") end return true end Irá abrir como mensagem pop-up na tela, clicando para fechar =P
  2. Signed @Topic, quer que eu faça com o pedido do Viitin?
  3. Deletar todas as contas menos os samples: DELETE FROM `players` WHERE `id`=1; Quanto ao resto, limpe todas as colunas.
  4. Absolute postou uma resposta no tópico em Suporte Tibia OTServer
    Vá no seu phpmyadmin, clique onde executa querys lá, e coloque o seguinte: ALTER TABLE `players` ADD `cast` TINYINT NOT NULL DEFAULT '0'; ALTER TABLE `players` ADD `castViewers` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `players` ADD `castDescription` VARCHAR( 255 ) NOT NULL; Pronto, o erro não irá persistir.
  5. Basta adicionar os atributos no items.xml e cria-los nos movements.
  6. Absolute postou uma resposta no tópico em Playground (Off-topic)
    Relatar umas ligações mal atendidas aí '-'
  7. Pronto, olha aí Sr Samuel, doei tudo que tinha pro Sesso!
  8. voseaeeê naunnmM<nnmN eeeaehhah obrigasada do entaubean vfazi o qjsbuae Sofri para entender o título, agora você que tente entender o meu. 2bjs
  9. Absolute postou uma resposta no tópico em Playground (Off-topic)
    sem delongas, me manda seu canal no yt por gentileza?
  10. Absolute postou uma resposta no tópico em Suporte Tibia OTServer
    Adiciona no seu global.lua: -- Vip system lib function getPlayerAccount(cid) return getAccountNumberByPlayerName(getPlayerName(cid)) end function setVipTable() db.query("ALTER TABLE `accounts` ADD `vip_time` INT( 15 ) NOT NULL;") end function getPlayerVip(cid) local resultId = db.storeQuery("SELECT `id`, `vip_time` FROM `accounts` WHERE `id` = '".. getPlayerAccount(cid) .."';") if resultId ~= false then return result.getDataInt(resultId, "vip_time") else error('Account not found.') end end function getVipByAcc(acc) local a = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '"..acc.."';") if a ~= false then return result.getDataInt(a, "vip_time") else error('Account not found.') end end function setPlayerVip(cid,secs) -- seconds if isPlayer(cid) then db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+secs).."' WHERE `id` ='".. getPlayerAccount(cid) .."' LIMIT 1 ;") else error('Player not found.') end end getVipByAccount = getVipByAcc function hasVip(cid) if isPlayer(cid) then if os.time(day) < getPlayerVip(cid) then return true else return false end else error('Player not found.') end end function accountHasVip(acc) if os.time() < getVipByAccount(acc) then return true else return false end end function setVipByAccount(acc,secs) -- seconds local a = getVipByAcc(acc) if a ~= false then if tonumber(secs) ~= nil then db.query("UPDATE `accounts` SET `vip_time` = '"..(os.time()+secs).."' WHERE `id` ='"..acc.."' LIMIT 1 ;") return true else error('Time must be defined as number.') end else error('Account not found.') end return false end function getPlayerVipTime(cid) if getPlayerVip(cid)-os.time() > 0 then return getPlayerVip(cid)-os.time() else return 0 end end function getAccountVipTime(acc) if getVipByAcc(acc)-os.time() > 0 then return getVipByAcc(acc)-os.time() else return 0 end end function addVipByAccount(acc,secs) -- seconds local a = getVipByAcc(acc) if a ~= false then if tonumber(secs) ~= nil then db.query("UPDATE `accounts` SET `vip_time` = '"..os.time()+(getAccountVipTime(acc)+secs).."' WHERE `id` ='"..acc.."' LIMIT 1 ;") return true else error('Time must be defined as number.') end else error('Account not found.') end return false end function doPlayerAddVip(cid,secs) -- seconds local a = getPlayerVip(cid) if a ~= false then if tonumber(secs) ~= nil then return setPlayerVip(cid,(getPlayerVipTime(cid) + secs)) else error('Time must be defined as number.') end else error('Player not found.') end end function returnVipString(cid) if isPlayer(cid) == true then return os.date("%d %B %Y %X", getPlayerVip(cid)) else error('Player not found.') end end function returnVipCountdown(num) local d = (tonumber(string.format("%.0f", os.date("%j",num))) - 1) local h = (tonumber(string.format("%.0f", os.date("%H",num))) - 1) local m = (tonumber(string.format("%.0f", os.date("%M",num)))) local s = (tonumber(string.format("%.0f", os.date("%S",num)))) local tvar, tnames, text = {d, h, m, s}, {"day", "hour", "minute", "second"}, "" local nvar, nnames = {}, {} for i = 1, #tvar do local s = "" table.insert(nvar, tvar) if tvar > 1 then s = "s" end table.insert(nnames, tnames..s) if i == 1 then if tvar > 0 then text = text..nvar.." "..nnames else text = text end else if tvar > 0 then if text == "" then text = nvar.." "..nnames else if tvar[i+1] ~= nil and tvar[i+1] > 0 then text = text..", "..nvar.." "..nnames else text = text.." and "..nvar.." "..nnames end end else text = text end end end if text == "" then return "no more vip time" else return text.." of vip time" end end -- end of vip system lib[/lua] talkactions.xml: [xml]<talkaction words="/vip" script="vip.lua"/> <talkaction words="!vip" script="vip.lua"/>[/xml] vip.lua: [lua]function onSay(cid, words, param) vipsystem_info = { name = "Vipsystem for TFS 1.0 by Zbizu(inspired by Mock's creation)", author = "Zbizu", version = "1.0", } vip_config = { log_opearations = true, -- logs date, IP integer and player name to make sure explainations of its user are truth if something go wrong, ignores players commands log_file = "vip_log.txt" } local daycounter = (math.floor((getVipByAccount(getPlayerAccount(cid))-os.time())/86400, 0) + 1) if getPlayerAccess(cid) > 0 then adm_info = "\nYou have special access which allows you to manage players viptime.\n\nAvailable params: see, add, reset\nsee - views player's viptime\nadd - adds player's viptime\nreset - makes player's viptime expired immediately\n\nUsage: "..words.." \"param, playername, time, reason" else adm_info = "" end if param == "" or getPlayerAccess(cid) == 0 then if (daycounter)*(-1) == 1 then s = "" else s = "s" end local ret_ = getPlayerVip(cid) if ret_ == 0 then doPlayerPopupFYI(cid,"You don't have any vip time."..adm_info) return false else if getPlayerVipTime(cid) == 0 then if (daycounter)*(-1) == 0 then doPlayerPopupFYI(cid, "You don't have any vip time.\nYour vip expired in " .. os.date("%d %B %Y %X ",ret_) .. "(today)."..adm_info) return false else doPlayerPopupFYI(cid, "You don't have any vip time.\nYour vip expired in " .. os.date("%d %B %Y %X ",ret_) .. "(" .. (daycounter)*(-1) .. " day".. s .." ago)."..adm_info) return false end else doPlayerPopupFYI(cid, "Your vip status ends in " .. os.date("%d %B %Y %X",ret_) .. ".\nYou have: " .. returnVipCountdown(getPlayerVipTime(cid)) .. " left."..adm_info) return false end end else if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("[%x %X]", os.time()).."[IP: "..getPlayerIp(cid).."]["..getPlayerName(cid).."]: ".. words .." \"".. param .."\n") file:close() end local t = string.explode(param, ", ", 4) local actions = {["see"] = 1, ["add"] = 2, ["reset"] = 3} local gen = {[0] = "She", [1] = "He", [2] = "This user"} if actions[t[1]] == nil then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Incorrect action specified.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") return false else local pid = getPlayerByName(t[2]) reason_text = t[4] if reason_text ~= nil then if(t[5] ~= nil) then for j = 5, #t do reason_text = reason_text .. ", " .. t[j] end end else reason_text = "" end if reason_text == "" then vip_comment = "" else vip_comment = "Reason: "..reason_text end if pid then if actions[t[1]] == 1 then if getPlayerVip(pid) == 0 then doPlayerPopupFYI(cid, getPlayerName(pid).."'s account never had any vip time.") else doPlayerPopupFYI(cid, getPlayerName(pid).."'s vip time expiration date:\n" .. os.date("%d %B %Y %X",getPlayerVip(pid)) .. "\n".. gen[getPlayerSex(pid)] .. " has ".. returnVipCountdown(getPlayerVipTime(pid)) .. " left.") end return false elseif actions[t[1]] == 2 then if tonumber(t[3]) ~= nil then if tonumber(t[3]) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerName(pid).."'s vip time wasn't changed.") return false else if tonumber(t[3]) > 0 then vip_action = "added to" vip_formula = tonumber(t[3]) else vip_action = "removed from" vip_formula = tonumber(t[3]*(-1)) end if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("Player had "..returnVipCountdown(getPlayerVipTime(pid)).." left\n")) file:close() end doPlayerAddVip(pid,tonumber(t[3])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, returnVipCountdown(vip_formula).." "..vip_action.." "..getPlayerName(pid).."'s account.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, gen[getPlayerSex(pid)] .. " has ".. returnVipCountdown(getPlayerVipTime(pid)) .. " now.") if vip_comment ~= "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, returnVipCountdown(vip_formula).." "..vip_action.." your account.") doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You have ".. returnVipCountdown(getPlayerVipTime(pid)) .. " now.") if vip_comment ~= "" then doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Time must be a number.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") end return false elseif actions[t[1]] == 3 then if vip_config.log_opearations then file = io.open(vip_config.log_file, "a+") file:write(os.date("Player had "..returnVipCountdown(getPlayerVipTime(pid)).." left\n")) file:close() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPlayerName(pid).."'s vip status removed. ".. gen[getPlayerSex(pid)] .. " had "..returnVipCountdown(getPlayerVipTime(pid)).." left.") if vip_comment ~= "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vip status has been removed.") if vip_comment ~= "" then doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, vip_comment) end setPlayerVip(pid,0) return false end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "To see usage manual type "..words.." without params.") return false end end end return true end
  11. Absolute postou uma resposta no tópico em Playground (Off-topic)
    To esperando o me relatar isso U.U
  12. Que isso não tem erro, estamos aí para isto. @Topic, Excelente, bem explicativo creio que não haverá dúvidas, continue assim, reputado!
  13. Achei show, se possível você como mapper faça uma área de explicação onde o player colocar as positions, faça uma arena com uma área indicando onde colocar: local exp_area ={ {from = {x=1014,y=1016,z=7},to = {x=1017,y=1019,z=7}, exp = 0.5}, {from = {x=1008,y=1018,z=7},to = {x=1011,y=1021,z=7}, exp = 0.25} Apenas uma sugestão, facilitará a vida de muitos hehe! Obrigado por contribuir, reputado.
  14. Olá Galera do TK, venho hoje rapidamente trazer um sistema muito útil e pedido em meu tópico do !eject system: http://www.tibiaking.com/forum/topic/35060-eject-system-expulsar-player-inativo-da-house/ Explicação: Sabe aqueles players chatos que compram as melhores casas e não logam no servidor e enche a desgrama da casa de item só para os novos players não comprar? Pois é, isto não existirá mais! =D Este script é apenas um arquivo que você colocará em sua pasta mods e ele executará toda vez que o servidor for reiniciado, ou seja: Quando o servidor ligar ele irá verificar os players que não logam a X dias (configurável) e então expulsa-los da casa movendo seus items para o depot deixando a casa sem dono. Vamos ao que interessa; Na pasta principal do servidor, onde fica a distro que roda o servidor e tudo mais, entre na pasta MODS e crie um arquivo com o nome de cleanhouses.xml e dentro coloque o seguinte: <?xml version="1.0" encoding="UTF-8"?> <mod name="Cleanhouses" version="1.03" author="nsanee" contact="tibiaking.com" enabled="yes"> <description> v.1.03 - Added 'onlyNonPremium' configurable. Removed modlib, since the script is run once anyway we don't need it loaded at all times. It shouldn't now stop execution when a house is nameless. v.1.02 - now uses only one sql query, removed multiworld configurable since it's not needed anymore v.1.01 - small fixes, optimized query + multiworld support. This mod will clean houses of inactive players and move their items to the depot. config explained: days - If the player hasn't logged in for this number of days his house will be freed. log - true/false, whether to enable logging of which houses have been cleaned. file - path to the log file, where logs will be stored. Ignored if 'log' set to false onlyNonPremium - if set to 'true', the script will clean only the houses of players who don't have any pacc days left. other notes: DO NOT remove doSaveServer() at the end, otherwise if your server happens to crash before the nearest server save you will regret it =) </description> <globalevent name="cleanhouses" type="start" event="buffer"><![CDATA[ local config = { days = 3, log = true, file = getDataDir() .. "/logs/cleanhouses.txt", onlyNonPremium = true } local ns_query =[[ SELECT houses.owner, houses.id as hid, houses.name as house_name ,players.name FROM houses LEFT JOIN players ON players.id=houses.owner LEFT JOIN accounts ON players.account_id=accounts.id WHERE players.lastlogin < (UNIX_TIMESTAMP() - ]] ..config.days.. [[*24*60*60) ]] ..(config.onlyNonPremium and ' AND accounts.premdays=0 ' or '')..[[ AND players.world_id =]] .. getConfigValue("worldId") local house = db.getResult(ns_query) local logs = " :: Houses cleaned:\n\n" if house:getID() ~= -1 then repeat logs = logs .. house:getDataString('house_name') ..", owned by " .. house:getDataString('name') .. "\n" setHouseOwner(house:getDataInt('hid'), 0) until not house:next() house:free() else logs = logs .. "There were no houses to clean." end if config.log then doWriteLogFile(config.file, logs) end addEvent(doSaveServer, 1000) ]]></globalevent> </mod> Pronto, salve e feche. Toda vez que o servidor iniciar irá expulsar os players que não logam aos dias configuráveis. Como configurar: days = 3 * É o número em DIAS que o player terá que ficar sem logar para perder a casa. Configure apenas isto, o resto aconselho não mexer, caso queira aprimorar o sistema aconselho ser avançado na área para não causar erros no mesmo. O Mesmo foi testado hoje por mim e está em funcionalidade a todas as versões de TFS. Créditos: Absolute nsanee (otland) Demais dúvidas deixe-me saber! Até o próximo
  15. Absolute postou uma resposta no tópico em Playground (Off-topic)
    Pergunta se ele paga a conta '-'
  16. O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Suporte OTServ → Suporte de Programação" Para: "OTServ → Suporte OTServ → Suporte de OTServ Geral"
  17. Está dando erro ao tentar conectar com o seu banco de dados, o mysql está ligado? Está certo no config.lua?
  18. HAHAHHA, você vai além das idéias né Killua, muito show, achei legal e eficiente, Obrigado por trazer ao TK.
  19. O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Aprendizagem → Outros Tutoriais" Para: "OTServ → Clients OTServ → Tutoriais de Clients"
  20. Não é na source, creio eu que é no client, que da a permissão da tecla ctrl+Y para group acess 2.
  21. O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Suporte OTServ → Suporte de Scripts" Para: "OTServ → Suporte OTServ → Suporte de Servidores Derivados"
  22. Absolute postou uma resposta no tópico em Suporte Tibia OTServer
    Se você não tenho conhecimento base em Linux aconselho não usar, Linux não contém uma área de trabalho igual windows, é tudo via ssh (comandos) "prompt de comando" digamos assim, Linux A é diferente de a. Caso tenha conhecimento, aconselho usar o Ubuntu 10.04 64Bits ou Debian 6 64 bits
  23. Absolute postou uma resposta no tópico em Suporte Tibia OTServer
    O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "Bots para Tibia → Bots Geral" Para: "OTServ → Suporte OTServ → Suporte de Servidores Derivados"

Informação Importante

Confirmação de Termo