Postado Outubro 8, 2016 8 anos Estou com o seguinte erro : Referente ao sistema VIP By Mock 100%. Agradeço des de já... 049-vipsys.lua vip = { name = "VIP System"; author = "Mock"; version = "1.0.0.0"; query="ALTER TABLE `accounts` ADD `vip_time` INTEGER"; query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL" } function vip.setTable() dofile('config.lua') if sqlType == "sqlite" then db.executeQuery(vip.query) else db.executeQuery(vip.query2) end end function vip.getVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';") if ae:getID() == -1 then return 0 end local retee = ae:getDataInt("vip_time") or 0 ae:free() return retee end function vip.getVipByAcc(acc) assert(acc,'Account is nil') local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';") if a:getID() ~= -1 then return a:getDataInt("vip_time") or 0, a:free() else error('Account don\'t find.') end end function vip.setVip(cid,time) dofile("config.lua") assert(tonumber(cid),'Parameter must be a number') assert(tonumber(time),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; db.executeQuery("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';") end function vip.getVipByAccount(acc) assert(acc,'Account is nil') return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0 end function vip.hasVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) or 0 if os.time(day) < t then return TRUE else return FALSE end end function vip.hasVips(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) if os.time(day) < t then return TRUE else return FALSE end end function vip.accountHasVip(acc) assert(acc,'Account is nil') if os.time() < vip.getVipByAccount(acc) then return TRUE else return FALSE end end function vip.getDays(days) return (3600 * 24 * days) end function vip.addVipByAccount(acc,time) assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') local a = vip.getVipByAcc(acc) a = os.difftime(a,os.time()) if a < 0 then a = 0 end; a = a+time return vip.setVipByAccount(acc,a) end function vip.setVipByAccount(acc,time) dofile("config.lua") assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') db.executeQuery("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';") return TRUE end function vip.returnVipString(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == TRUE then return os.date("%d %B %Y %X ", vip.getVip(cid)) end end addvip.lua function onSay(cid, words, param) if param == "" then return doPlayerPopupFYI(cid,"Está com problemas?\nAprenda os comandos!\n---------------\nAdicionar vip:\n/vip add days player\n/vip add 30 Real\n---------------\nDeletar vip:\n/vip del player\n/vip del Real\n---------------\nVer a vip:\n/vip see player\n/vip see Real\n---------------\n") end if param:lower():find('add') == 1 and 3 then local _,_,id,name = param:lower():find('add (%d+) (.+)') name = name or "" id = tonumber(id or 1) or 1 if tonumber(id) == nil or getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Adicionar vip:\n/vip add days player\n/vip add 30 Real\n [Player: "..name.."]") end if isPlayer(getPlayerByName(name)) == TRUE then vip.addVipByAccount(getPlayerAccount(getPlayerByName(name)) ,vip.getDays(id)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Foram adicionados "..tonumber(id).." dias de vip a "..name..".") doPlayerSendTextMessage(getPlayerByName(name),MESSAGE_INFO_DESCR,"Você recebeu "..tonumber(id).." dias de vip.") else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,name.." não esta online ou não existe.") end elseif param:lower():find('del') == 1 and 3 then local _,_,name = param:lower():find('del (.+)') if getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Deletar vip:\n/vip del player\n/vip del Real\n") end vip.setVipByAccount(getPlayerAccount(getPlayerByName(name)),-os.time()) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"A vip de "..name.." foi apagada.") elseif param:lower():find('see') == 1 and 3 then local _,_,name = param:lower():find('see (.+)') name = name or "" if getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Ver a vip:\n/vip see player\n/vip see Real\n") end local ret_ = vip.getVip(getPlayerByName(name)) if ret_ == 0 then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,name.." Não tem vip, e nunca teve.") else return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A vip de "..name.." Acaba/terminou em "..os.date("%d %B %Y %X ",ret_)) end end return TRUE end Editado Outubro 8, 2016 8 anos por tiroleivi (veja o histórico de edições) Meus Conteúdos: Downloads :Distros Compilados [TFS 1.0 e 1.1]-[10.76] x86 - x64 + DLLs Baiak [8.60] + Site + Itens Donate + Cliente Próprio Global Full 8.60 + Zao, War-System, Cast System... Distros Compiladas [Linux-64x] Gesior 2012 para OldServer 7.x WebPage v1 - Para OTs SQL Blogger Para OTServ Sql Global V30 - OTX 10.99 DownloadTibia Loader! Tutoriais :Instalando Gesior ACC + TFS 1.0 Instalando ZnoteAAC 1.5 (10.x ~ 11.x)Criando Pagina de Xat Para Seu Site Gesior ! Gosta do meu trabalho? Quer me apoiar?
Postado Outubro 8, 2016 8 anos Eu acho que ainda ninguém consegue adivinhar a linha de um código, rs. Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
Postado Outubro 8, 2016 8 anos Hoje em dia ninguém usa mais isso, Vip System ? Coloca o Vip Days normal mesmo, fácil de configurar, no Shop, para adicionar em players, e etc.. Já vem em tudo que é Server, até os mais antigos tem, ninguém usa mais esses tal de Vip System não mano, não perca seu tempo com isso, insistindo nisso ae, você estará perdendo o tempo que você poderia gastar com algo mais importante. Mais é só uma opinião simples, se você gosta de usar isso ae, lhe desejo sorte em arrumar o problema. E posta o Script pois como foi dito acima, não tem como ajudarem se não olharem o que está escrito na linha do problema! xD
Postado Outubro 8, 2016 8 anos Autor 7 horas atrás, tiroleivi disse: Estou com o seguinte erro : Referente ao sistema VIP By Mock 100%. Agradeço des de já... 049-vipsys.lua vip = { name = "VIP System"; author = "Mock"; version = "1.0.0.0"; query="ALTER TABLE `accounts` ADD `vip_time` INTEGER"; query2="ALTER TABLE `accounts` ADD `vip_time` INT(15) NOT NULL" } function vip.setTable() dofile('config.lua') if sqlType == "sqlite" then db.executeQuery(vip.query) else db.executeQuery(vip.query2) end end function vip.getVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; ae = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';") if ae:getID() == -1 then return 0 end local retee = ae:getDataInt("vip_time") or 0 ae:free() return retee end function vip.getVipByAcc(acc) assert(acc,'Account is nil') local a = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';") if a:getID() ~= -1 then return a:getDataInt("vip_time") or 0, a:free() else error('Account don\'t find.') end end function vip.setVip(cid,time) dofile("config.lua") assert(tonumber(cid),'Parameter must be a number') assert(tonumber(time),'Parameter must be a number') if isPlayer(cid) == FALSE then error('Player don\'t find') end; db.executeQuery("UPDATE `"..sqlDatabase.."`.`accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='".. getPlayerAccount(cid).."';") end function vip.getVipByAccount(acc) assert(acc,'Account is nil') return db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..acc.."';"):getDataInt("vip_time") or 0 end function vip.hasVip(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) or 0 if os.time(day) < t then return TRUE else return FALSE end end function vip.hasVips(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == FALSE then return end; local t = vip.getVip(cid) if os.time(day) < t then return TRUE else return FALSE end end function vip.accountHasVip(acc) assert(acc,'Account is nil') if os.time() < vip.getVipByAccount(acc) then return TRUE else return FALSE end end function vip.getDays(days) return (3600 * 24 * days) end function vip.addVipByAccount(acc,time) assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') local a = vip.getVipByAcc(acc) a = os.difftime(a,os.time()) if a < 0 then a = 0 end; a = a+time return vip.setVipByAccount(acc,a) end function vip.setVipByAccount(acc,time) dofile("config.lua") assert(acc,'Account is nil') assert(tonumber(time),'Parameter must be a number') db.executeQuery("UPDATE `accounts` SET `vip_time` = '"..(os.time()+time).."' WHERE `accounts`.`name` ='"..acc.."';") return TRUE end function vip.returnVipString(cid) assert(tonumber(cid),'Parameter must be a number') if isPlayer(cid) == TRUE then return os.date("%d %B %Y %X ", vip.getVip(cid)) end end addvip.lua function onSay(cid, words, param) if param == "" then return doPlayerPopupFYI(cid,"Está com problemas?\nAprenda os comandos!\n---------------\nAdicionar vip:\n/vip add days player\n/vip add 30 Real\n---------------\nDeletar vip:\n/vip del player\n/vip del Real\n---------------\nVer a vip:\n/vip see player\n/vip see Real\n---------------\n") end if param:lower():find('add') == 1 and 3 then local _,_,id,name = param:lower():find('add (%d+) (.+)') name = name or "" id = tonumber(id or 1) or 1 if tonumber(id) == nil or getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Adicionar vip:\n/vip add days player\n/vip add 30 Real\n [Player: "..name.."]") end if isPlayer(getPlayerByName(name)) == TRUE then vip.addVipByAccount(getPlayerAccount(getPlayerByName(name)) ,vip.getDays(id)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Foram adicionados "..tonumber(id).." dias de vip a "..name..".") doPlayerSendTextMessage(getPlayerByName(name),MESSAGE_INFO_DESCR,"Você recebeu "..tonumber(id).." dias de vip.") else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,name.." não esta online ou não existe.") end elseif param:lower():find('del') == 1 and 3 then local _,_,name = param:lower():find('del (.+)') if getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Deletar vip:\n/vip del player\n/vip del Real\n") end vip.setVipByAccount(getPlayerAccount(getPlayerByName(name)),-os.time()) doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"A vip de "..name.." foi apagada.") elseif param:lower():find('see') == 1 and 3 then local _,_,name = param:lower():find('see (.+)') name = name or "" if getPlayerByName(name) == false then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Ver a vip:\n/vip see player\n/vip see Real\n") end local ret_ = vip.getVip(getPlayerByName(name)) if ret_ == 0 then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,name.." Não tem vip, e nunca teve.") else return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A vip de "..name.." Acaba/terminou em "..os.date("%d %B %Y %X ",ret_)) end end return TRUE end [/spoiler Meus Conteúdos: Downloads :Distros Compilados [TFS 1.0 e 1.1]-[10.76] x86 - x64 + DLLs Baiak [8.60] + Site + Itens Donate + Cliente Próprio Global Full 8.60 + Zao, War-System, Cast System... Distros Compiladas [Linux-64x] Gesior 2012 para OldServer 7.x WebPage v1 - Para OTs SQL Blogger Para OTServ Sql Global V30 - OTX 10.99 DownloadTibia Loader! Tutoriais :Instalando Gesior ACC + TFS 1.0 Instalando ZnoteAAC 1.5 (10.x ~ 11.x)Criando Pagina de Xat Para Seu Site Gesior ! Gosta do meu trabalho? Quer me apoiar?
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.