- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- Talkaction Que Exclui Players E Acc Inativas
FE
Talkaction Que Exclui Players E Acc Inativas
Por fegal, 26 de jan. de 2012 em Archived
me dêem uma ajudinha
por favor
otserv
tibia
script
1
632
Por fegal, 26 de jan. de 2012 em Archived
info
Grupo: Campones
Registrado: 17/08/08
Posts: 10
Reputação: 0
Gênero: Feminino
Bom pessoal eu gostaria da ajuda de vocês em uma coisa...
Eu gostaria de apagar os players e accounts inativos há mais de 90 dias.
Uso servidor sqlite, já tentei deletar com algumas querys que encontrei aqui no Xtibia porém nenhuma funcionou.
Estive pensando e talvez vocês congigam me ajudar aqui...
Tenho uma talkaction que "limpa" as casas de que não loga há 90 dias, então talvez vcs saibam como adaptar esse scipt para que "limpe" também os players e accounts...
O script é o seguinte:
local safelist = {1,2,6,9,10,11} function onSay(cid, words, param) if getPlayerGroupId(cid) > 2 then pdelete = "Inactive Players With Houses:\n\n" days = 90*3600*24 t=os.date('*t') local house = db.getResult("SELECT `owner`,`id` FROM `houses`") if(house:getID() ~= -1) then while (true) do local owner = house:getDataInt("owner") local hid = house:getDataInt("id") local player = db.getResult("SELECT `id`,`name`,`lastlogin` FROM `players` WHERE `id` = '"..owner.."' ") if(player:getID() ~= -1) then local lastlogin = player:getDataInt("lastlogin") local pid = player:getDataInt("id") local name = player:getDataString("name") time=os.time(t) - lastlogin offline = time - days if offline >= 0 then pdelete = pdelete.."House #"..hid.." owned by "..name.."\n" if isInArray(safelist,hid) == FALSE then setHouseOwner(hid, 0) end end player:free() end if not(house:next()) then break end end house:free() doShowTextDialog(cid, 5958, pdelete) else doPlayerSendCancel(cid, "Error.") end end return TRUE endFicarei muito grato se me ajudarem.