Jump to content

Search the Community

Showing results for tags 'changename'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Sou

Found 2 results

  1. Olá. Eu estou precisando de um talkaction que troca o nome e pega determinado item. Eu tentei usar esse que está disponivel aqui http://www.xtibia.com/forum/topic/233204-change-name-in-game-30/ Porém quando executa o comando ele não troca o nome e acusa isso na distro: OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: near "LIMIT": syntax error (UPDATE "players" SET "name" = 'Testando Nome' WHERE "id" = 16 LIMIT 1;)
  2. É um script que eu realmente achei excelente, e ajuda muito a servidores onde esse serviço não é vendido. Segue o script Em data/talkactions/scripts adicione um arquivo com o nome de changename.lua com o seguinte script: 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 Em talkactions.xml adicione a tag: <talkaction words="!changename;/changename;!namechange;/namechange" script="changename.lua" /> Funcional em tfs 0.3.7 / 0.4.0 Credito: Ratser Espero que aproveitem esse super script
×
×
  • Create New...