Postado Outubro 6, 2017 7 anos Autor 56 minutos atrás, yanloco70 disse: @Noninhouh Fucei Fucei e n consegui...... Bom Ele consome O item mais nao muda nick.... Uso Mysql @yanloco70 Esse aqui funciona em MySql: local config = { item = { Id = 1111, count = 0, }, maxTextLenght = 15, blacklistParam = {"account manager", "god", "cm", "gm", "tutor", "tester"}, minWordLenght = 3, delay = 2 } function onSay(cid, words, param, channel) local textCancel, t = config.text, string.explode(param, ",") if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") elseif((getPlayerGUIDByName(t[1]) ~= nil) and (not getBooleanFromString(t[2]))) then textCancel = "That name is already in use." elseif(getPlayerItemCount(cid, config.item.Id) < config.item.count) then textCancel = "You do not fulfill the requirements." elseif(not getTilePzInfo(getCreaturePosition(cid))) then textCancel = "You must be inside a protection zone to use this command." elseif(string.len(tostring(t[1])) >= config.maxTextLenght) then textCancel = "You can only use a maximum of " .. config.maxTextLenght .. " characters." elseif(string.find(t[1]:lower(), "[^%l%s]") ~= nil) then textCancel = "You cannot use symbols." else for blacklist = 1, table.maxn(config.blacklistParam) do if(string.find(t[1]:lower(), config.blacklistParam[blacklist]) ~= nil) then textCancel = "Invalid name entry." break end end end if(config.text ~= textCancel) then doPlayerSendCancel(cid, textCancel) return true end local paramTemp, space, oldName = '', '', getCreatureName(cid) for word in string.gmatch(t[1], "%a+") do if(string.len(word) < config.minWordLenght) then doPlayerSendCancel(cid, "Each word must have a minimum of " .. config.minWordLenght .. " characters.") return true end paramTemp = "" .. paramTemp .. "" .. space .. "" .. word .. "" if(space == '') then space = " " end end local guid = getPlayerGUID(cid) t[1] = paramTemp doPlayerRemoveItem(cid, config.item.Id, config.item.count) if(pcall(doPlayerChangeName, guid, oldName, t[1]) == false) then db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. db.escapeString(t[1]) .. ", " .. os.time() .. ");") db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(t[1]) .. " WHERE `id` = " .. guid .. " LIMIT 1;") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your name has been changed successfully. You will be kicked in " .. config.delay .. " seconds.") addEvent(function(cid, forceLogout) if(isPlayer(cid)) then doRemoveCreature(cid, forceLogout) end end, config.delay * 1000, cid, false) return true end Créditos - Ratser Editado Outubro 6, 2017 7 anos por dimmebag (veja o histórico de edições)
Postado Outubro 6, 2017 7 anos 23 minutos atrás, dimmebag disse: @yanloco70 Esse aqui funciona em MySql: local config = { item = { Id = 1111, count = 0, }, maxTextLenght = 15, blacklistParam = {"account manager", "god", "cm", "gm", "tutor", "tester"}, minWordLenght = 3, delay = 2 } function onSay(cid, words, param, channel) local textCancel, t = config.text, string.explode(param, ",") if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") elseif((getPlayerGUIDByName(t[1]) ~= nil) and (not getBooleanFromString(t[2]))) then textCancel = "That name is already in use." elseif(getPlayerItemCount(cid, config.item.Id) < config.item.count) then textCancel = "You do not fulfill the requirements." elseif(not getTilePzInfo(getCreaturePosition(cid))) then textCancel = "You must be inside a protection zone to use this command." elseif(string.len(tostring(t[1])) >= config.maxTextLenght) then textCancel = "You can only use a maximum of " .. config.maxTextLenght .. " characters." elseif(string.find(t[1]:lower(), "[^%l%s]") ~= nil) then textCancel = "You cannot use symbols." else for blacklist = 1, table.maxn(config.blacklistParam) do if(string.find(t[1]:lower(), config.blacklistParam[blacklist]) ~= nil) then textCancel = "Invalid name entry." break end end end if(config.text ~= textCancel) then doPlayerSendCancel(cid, textCancel) return true end local paramTemp, space, oldName = '', '', getCreatureName(cid) for word in string.gmatch(t[1], "%a+") do if(string.len(word) < config.minWordLenght) then doPlayerSendCancel(cid, "Each word must have a minimum of " .. config.minWordLenght .. " characters.") return true end paramTemp = "" .. paramTemp .. "" .. space .. "" .. word .. "" if(space == '') then space = " " end end local guid = getPlayerGUID(cid) t[1] = paramTemp doPlayerRemoveItem(cid, config.item.Id, config.item.count) if(pcall(doPlayerChangeName, guid, oldName, t[1]) == false) then db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. db.escapeString(t[1]) .. ", " .. os.time() .. ");") db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(t[1]) .. " WHERE `id` = " .. guid .. " LIMIT 1;") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your name has been changed successfully. You will be kicked in " .. config.delay .. " seconds.") addEvent(function(cid, forceLogout) if(isPlayer(cid)) then doRemoveCreature(cid, forceLogout) end end, config.delay * 1000, cid, false) return true end Créditos - Ratser Vo Testa count = 0, --- Deixa 1 ??para consumir o item Print que mandei anterior kkk todo errado esse erro certo... Da o mesmo erro que deu no outro Ja Mudei db.executeQuery para db.Query Tbm n pego Desde cedo a mãe da gente fala assim: “Filho, por você jogar Tibia, você tem que ser duas vezes melhor.” Aí passado alguns anos eu pensei: Como fazer 2 vezes melhor, se você tá pelo menos 100 vezes atrasado pelos Nubs, pela história, pelos Items, pelas Guilds, pelos Reds… Por tudo que aconteceu? Duas vezes melhor como ? Ou melhora ou ser o melhor ou o pior de uma vez. E sempre foi assim. Você vai escolher o que tiver mais perto de você, o que tiver dentro da sua realidade. Você vai ser duas vezes melhor como? Quem inventou isso aí? Quem foi o pilantra que inventou isso aí ? Acorda pra vida rapaz. YanLoco Projetos: https://www.facebook.com/Dbo-Here-524519644549602/ 70%
Postado Outubro 6, 2017 7 anos Autor 2 horas atrás, yanloco70 disse: Vo Testa count = 0, --- Deixa 1 ??para consumir o item Print que mandei anterior kkk todo errado esse erro certo... Da o mesmo erro que deu no outro Ja Mudei db.executeQuery para db.Query Tbm n pego Usa db.getResult então, no meu server esses dois tb n pegam pq n tem source, ai tem que ser na gambiarra. Eu tenho q colocar tudo db.getResult pra funcionar ;P
Postado Outubro 6, 2017 7 anos Deu Certo Troco Nick tudo Legal soque deu esse erro... Troquei nick do Char Godd Para Lifer Deu isso ai Desde cedo a mãe da gente fala assim: “Filho, por você jogar Tibia, você tem que ser duas vezes melhor.” Aí passado alguns anos eu pensei: Como fazer 2 vezes melhor, se você tá pelo menos 100 vezes atrasado pelos Nubs, pela história, pelos Items, pelas Guilds, pelos Reds… Por tudo que aconteceu? Duas vezes melhor como ? Ou melhora ou ser o melhor ou o pior de uma vez. E sempre foi assim. Você vai escolher o que tiver mais perto de você, o que tiver dentro da sua realidade. Você vai ser duas vezes melhor como? Quem inventou isso aí? Quem foi o pilantra que inventou isso aí ? Acorda pra vida rapaz. YanLoco Projetos: https://www.facebook.com/Dbo-Here-524519644549602/ 70%
Postado Outubro 6, 2017 7 anos Autor 31 minutos atrás, yanloco70 disse: Deu Certo Troco Nick tudo Legal soque deu esse erro... Troquei nick do Char Godd Para Lifer Deu isso ai Tenta usar db.storeQuery
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.