Funciona assim:
Com esse comando eu posso mudar o meu nome ou o nome de qualquer char do server estando online ou não...
/rename [ADM] BBSZ, [ADM] Alemaoo
Pronto o nome do char foi mudado, você só precisa relogar e curtir suas configurações !
Passo a Passo:
1º Crie um arquivo chamado changename.lua na pasta data/talkaction/scripts/ e cole isso dentro dele:
-- By: Alemaoo
function onSay(cid, words, param, channel)
local p = string.explode(param, ',')
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
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
2º Vá no Data/talkation/talkacton.xml e adicione está tag:
<talkaction words="/rename" access="5" event="script" value="changename.lua"/>
Pronto seu script está terminado!
Test:
10:21 /rename Eno, Eno Sal De Frutas
10:21 You have changed Eno's name to Eno Sal De Frutas.
Creditos:
Equipe Pokemon Adventures
Alemaooxd
Se te ajudei da um "Rep +" Não dói não Dr.