Postado Abril 5, 2017 8 anos Estou usando o Locker Protection do @MaXwEllDeN e estou com uns probleminhas aqui. Crio uma senha normal e quando tento troca-la não consigo, só consigo remove-la. Quando crio senhas com letras maiúsculas não da para remover ou troca-las(o mesmo acontece se colocar números na senha). Teria como fazer algum sistema de recuperação de senha ? Uso tfs 0.3.6 Rep para quem ajudar actions Spoiler --[[ Protect Locker System Author: MaXwEllDeN Version: 1.0 ]] function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, 96475) ~= getPlayerStorageValue(cid, 96474)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Seu locker está trancado. Para abrir ele, digite !locker pass(substituindo pass pela sua senha).") return true end if (getPlayerStorageValue(cid, 96474) == -1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Seu locker está desprotegido, para mais informações de como protejer seu locker digite: !locker") end end creaturescripts Spoiler --[[ Protect Locker System Author: MaXwEllDeN Version: 1.0 ]] function onLogin(cid) setPlayerStorageValue(cid, 96475, -1) return true end movements Spoiler --[[ Protect Locker System Author: MaXwEllDeN Version: 1.0 ]] function onStepOut(cid, item, pos) setPlayerStorageValue(cid, 96475, -1) return true end talkactions Spoiler --[[ Protect Locker System Author: MaXwEllDeN Version: 1.0 ]] function doFindItemInPos(ids,pos) -- By Undead Slayer local results = {} for _ = 0, 255 do local findPos = {x = pos.x, y = pos.y, z = pos.z, stackpos = _} if isInArray(ids, getThingFromPos(findPos).itemid) then table.insert(results, getThingfromPos(findPos)) end end return results end function isItemInRange(cp, range, ids) local extr1 = {x = cp.x - range, y = cp.y -range, z = cp.z} local extr2 = {x = cp.x + range, y = cp.y + range, z = cp.z} for i = 1, (extr2.y-extr1.y)+1 do for s = 1, (extr2.x-extr1.x)+1 do local f = {x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=0} local posz = doFindItemInPos(ids, f) if (#posz > 0) then return true end end end return false end function onSay(cid, words, param) local help = "Max Locker Protect System ~~\n\n* Criando uma senha: \nPara criar uma senha digite: ".. words .." pass, senha. Substituindo senha pela senha que você quer criar!\n\n*Modificando uma senha: ".. words .." passchange senhaantiga, nova. Substituindo senhaantiga pela sua senha antiga e nova pela sua nova senha.\n\n*Removendo sua senha \n Para remover sua senha digite: ".. words .. " remove, senha(substituindo senha pela sua senha atual)." local param2 = string.explode(param, ",") if not(isItemInRange(getThingPos(cid), 1, {2589, 2590, 2591, 2592})) then return doPlayerSendCancel(cid, "Você deve estar perto de um locker para poder usar o sistema.") end if not(param2[1]) then elseif (param2[1] == "pass") then if (getPlayerStorageValue(cid, 96474) ~= -1) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você já estabeleceu uma senha para seu locker!") end if not(param2[1]) then return doShowTextDialog(cid, 2591, help) end setPlayerStorageValue(cid, 96474, tostring(param2[2])) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha é: ".. tostring(param2[2])) elseif (param2[1]:lower() == tostring(getPlayerStorageValue(cid, 96474))) then local tile = getThingPos(cid) tile.stackpos = 0 local tile = getThingFromPos(tile) doItemSetAttribute(tile.uid, "aid", 96475) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Seu locker está aberto.") return setPlayerStorageValue(cid, 96475, param) elseif (param2[1]:lower() == "passchange") then if not (param2[3]) then return doShowTextDialog(cid, 2591, help) end if (getPlayerStorageValue(cid, 96474) ~= -1) and (param2[2] ~= tostring(getPlayerStorageValue(cid, 96474))) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Digite a sua senha atual corretamente!") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha foi mudada de ".. getPlayerStorageValue(cid, 96474) .." para ".. param2[3] ..".") return setPlayerStorageValue(cid, 96474, tostring(param2[3])) elseif (param2[1]:lower() == "remove") then if (getPlayerStorageValue(cid, 96474) == -1) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você não tem senha para remover!") end if not (param2[2]) then return doShowTextDialog(cid, 2591, help) end if (getPlayerStorageValue(cid, 96474) ~= -1) and (param2[2] ~= getPlayerStorageValue(cid, 96474)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Digite a sua senha atual corretamente!") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha foi removida!") return setPlayerStorageValue(cid, 96474, -1) end return doShowTextDialog(cid, 2591, help) end @xWhiteWolf @Adriano SwaTT Ajudinha? please Meus tópicos Se ajudei você deixe seu Rep! para fortalecer a amizade Vamos ajudar o fórum a crescer mais. Mengão porra! . . ----- NPC que vende informação ----- -----Baú Que dá Outfit se tiver Level ----- ----- [Npc] Que vende Stones (itens) por diamonds -----
Postado Abril 10, 2017 8 anos Autor Up! ? .-. Meus tópicos Se ajudei você deixe seu Rep! para fortalecer a amizade Vamos ajudar o fórum a crescer mais. Mengão porra! . . ----- NPC que vende informação ----- -----Baú Que dá Outfit se tiver Level ----- ----- [Npc] Que vende Stones (itens) por diamonds -----
Postado Abril 10, 2017 8 anos Estou em dívida pra ver pra você esse cod.. Só que foi uma correria esses últimos dias, peço perdão, hoje mesmo só cheguei agora em casa, minha noiva está muito ruim e foi para o Hospital, etc.. Hoje não durmo aqui, então provavelmente não terei tempo de ver pra você. Mas caso, até quarta-feira, alguém não tenha feito ainda, dou uma olhada. Boa sorte. Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
Postado Abril 11, 2017 8 anos Autor @Adriano SwaTT Boa noite amigo agradeço a atenção e melhoras pr sua noiva mano, Deus vai ajudar vcs E sim posso aguardar tranquilamente, espero por boas noticias na próxima que Deus abençoe! abraço. Meus tópicos Se ajudei você deixe seu Rep! para fortalecer a amizade Vamos ajudar o fórum a crescer mais. Mengão porra! . . ----- NPC que vende informação ----- -----Baú Que dá Outfit se tiver Level ----- ----- [Npc] Que vende Stones (itens) por diamonds -----
Postado Abril 18, 2017 8 anos Spoiler --[[ Protect Locker System Author: MaXwEllDeN Version: 1.0 ]] function doFindItemInPos(ids,pos) -- By Undead Slayer local results = {} for _ = 0, 255 do local findPos = {x = pos.x, y = pos.y, z = pos.z, stackpos = _} if isInArray(ids, getThingFromPos(findPos).itemid) then table.insert(results, getThingfromPos(findPos)) end end return results end function isItemInRange(cp, range, ids) local extr1 = {x = cp.x - range, y = cp.y -range, z = cp.z} local extr2 = {x = cp.x + range, y = cp.y + range, z = cp.z} for i = 1, (extr2.y-extr1.y)+1 do for s = 1, (extr2.x-extr1.x)+1 do local f = {x=extr1.x+s-1, y=extr1.y+i-1, z=extr1.z, stackpos=0} local posz = doFindItemInPos(ids, f) if (#posz > 0) then return true end end end return false end function onSay(cid, words, param) local help = "Max Locker Protect System ~~\n\n* Criando uma senha: \nPara criar uma senha digite: ".. words .." pass, senha. Substituindo senha pela senha que você quer criar!\n\n*Modificando uma senha: ".. words .." passchange senhaantiga, nova. Substituindo senhaantiga pela sua senha antiga e nova pela sua nova senha.\n\n*Removendo sua senha \n Para remover sua senha digite: ".. words .. " remove, senha(substituindo senha pela sua senha atual)." local param2 = string.explode(param, ",") if not(isItemInRange(getThingPos(cid), 1, {2589, 2590, 2591, 2592})) then return doPlayerSendCancel(cid, "Você deve estar perto de um locker para poder usar o sistema.") end if not(param2[1]) then elseif (param2[1] == "pass") then -- CRIANDO SENHA if (getPlayerStorageValue(cid, 96474) ~= -1) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você já estabeleceu uma senha para seu locker!") end if not(param2[1]) then return doShowTextDialog(cid, 2591, help) end setPlayerStorageValue(cid, 96474, tostring(param2[2])) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha é: ".. tostring(param2[2])) elseif (param2[1]:lower() == tostring(getPlayerStorageValue(cid, 96474))) then local tile = getThingPos(cid) tile.stackpos = 0 local tile = getThingFromPos(tile) doItemSetAttribute(tile.uid, "aid", 96475) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Seu locker está aberto.") return setPlayerStorageValue(cid, 96475, param) elseif (param2[1]:lower() == "passchange") then -- MUDANDO SUA SENHA if not (param2[3]) then return doShowTextDialog(cid, 2591, help) end if (getPlayerStorageValue(cid, 96474) ~= -1) and (tostring(param2[2]) ~= tostring(getPlayerStorageValue(cid, 96474))) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Digite a sua senha atual corretamente!") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha foi alterada de ".. getPlayerStorageValue(cid, 96474) .." para ".. param2[3] ..".") return setPlayerStorageValue(cid, 96474, tostring(param2[3])) elseif (param2[1]:lower() == "remove") then -- REMOVENDO SUA SENHA if (getPlayerStorageValue(cid, 96474) == -1) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você não tem senha para remover!") end if not (param2[2]) then return doShowTextDialog(cid, 2591, help) end if (getPlayerStorageValue(cid, 96474) ~= -1) and (param2[2] ~= getPlayerStorageValue(cid, 96474)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Digite a sua senha atual corretamente!") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sua senha foi removida!") return setPlayerStorageValue(cid, 96474, -1) end return doShowTextDialog(cid, 2591, help) end Teste assim Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
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.