Postado Maio 1, 2016 9 anos Fala Galera vim trazer hoje o comando '' /rename '' Ele Server Para Muda Nickname de Player Sem isso até o Editor de Account! Vá até data\data\talkactions\scripts Crie um arquivo Chamado changename.lua Cole Isso: Spoiler function onSay(cid, words, param, channel) local p = string.explode(param, ',') if(param == "") then doPlayerSendCancel(cid, "Command requires param.") return true end if(words == "/pass") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") end return db.executeQuery("UPDATE `accounts` SET `password` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account password to " .. p[2] .. ".") end if(words == "/acc") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") elseif(db.getResult("SELECT `id` FROM `accounts` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then return doPlayerSendCancel(cid, "Sorry, but account [" .. p[2] .. "] already exists.") end return db.executeQuery("UPDATE `accounts` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account number to " .. p[2] .. ".") end if(words == "/rename") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.") elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.") end return db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s name to " .. p[2] .. ".") end end Agora vá em talkactions.xml e Adicione Essa tag: Spoiler <talkaction words="/rename" access="4" event="script" value="changename.lua"/> Ajudei? Rep+ Creditos: Pikeno Walker Por Criar o Script ! Eu Por trazer ao tibiaking. VERSÃO TESTADA: 1.0 [TFS] Editado Maio 1, 2016 9 anos por Arysoooon Falta de Informações. (veja o histórico de edições)
Postado Maio 1, 2016 9 anos Parabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP. Spoiler Congratulations, your content has been approved! Thank you for your contribution, we of Tibia King we are grateful. Your content will help many other users, you received +1 REP. Ps. Deixei ser aprovado mas por favor adicione a versão em que você testou, faça as funções /pass e /acc serem úteis (visto que elas também estão no código) e adicione os devidos créditos. Você tem 48 horas.
Postado Maio 1, 2016 9 anos Diretor 11 horas atrás, Arysoooon disse: Fala Galera vim trazer hoje o comando '' /rename '' Ele Server Para Muda Nickname de Player Sem isso até o Editor de Account! Vá até data\data\talkactions\scripts Crie um arquivo Chamado changename.lua Cole Isso: Mostrar conteúdo oculto function onSay(cid, words, param, channel) local p = string.explode(param, ',') if(param == "") then doPlayerSendCancel(cid, "Command requires param.") return true end if(words == "/pass") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") end return db.executeQuery("UPDATE `accounts` SET `password` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account password to " .. p[2] .. ".") end if(words == "/acc") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") elseif(db.getResult("SELECT `id` FROM `accounts` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then return doPlayerSendCancel(cid, "Sorry, but account [" .. p[2] .. "] already exists.") end return db.executeQuery("UPDATE `accounts` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s account number to " .. p[2] .. ".") end if(words == "/rename") then if(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[1]) .. ";"):getID() == -1) then return doPlayerSendCancel(cid, "Sorry, but player [" .. p[1] .. "] does not exist.") elseif(isPlayerBanished(p[1], PLAYERBAN_LOCK)) then return doPlayerSendCancel(cid, "Sorry, but " .. p[1] .. " is name locked.") elseif(db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(p[2]) .. ";"):getID() == 1) then return doPlayerSendCancel(cid, "Sorry, but the name [" .. p[2] .. "] already exists.") end return db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';") and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed " .. p[1] .. "'s name to " .. p[2] .. ".") end end Agora vá em talkactions.xml e Adicione Essa tag: Mostrar conteúdo oculto <talkaction words="/rename" access="4" event="script" value="changename.lua"/> Ajudei? Rep+ isso ja tem na cipsoft eh um script padrão... mais obg por compartilhar
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.