[talkactions]
Bom, o titulo já diz tudo, você muda o nome de um certo player.
/rn Nome do Player, Novo Nome, tempo para o player ser kickado(em segundos).
Exemplo :
/rn Duuh, Duuh Carvalho, 5
Simples, porem útil.
Vá em data / talkactions / scripts.
cria um arquivo lua e cola isso dentro :
function onSay(cid, words, param) if(param == '') then doPlayerSendCancel(cid, "Command param required.") return true end local t = string.explode(param, ",") newName = tostring(t[2]) time = tonumber(t[3]) local target = getPlayerByNameWildcard(t[1]) if(not target) then target = getCreatureByName(t[1]) if(not target) then doPlayerSendCancel(cid, "Creature not found.") return true end end if(isPlayerGhost(t[1]) and getPlayerGhostAccess(t[1]) > getPlayerGhostAccess(cid)) then doPlayerSendCancel(cid, "Creature not found.") return true end if (not t[2]) then return doPlayerSendCancel(cid, "New name not found") end if (not t[3]) then return doPlayerSendCancel(cid, "Time not found") end function removePlayer() if isPlayer(target) then doRemoveCreature(target) end end if isPlayer(target) then if getCreatureCondition(target, CONDITION_INFIGHT) == FALSE then db.executeQuery("UPDATE `players` SET `name` = '"..newName.."' WHERE `id` = "..getPlayerGUID(target)..";") addEvent(removePlayer, time*1000) doPlayerSendTextMessage(target, 25, "Você será kickado em "..time.." segundo(s) para que seu nome seja alterado.") doSendMagicEffect(getCreaturePosition(target), 35) doSendMagicEffect(getCreaturePosition(cid), 27) doPlayerSendTextMessage(cid, 25, "O nome do Player foi alterado com sucesso.") else doPlayerSendCancel(cid, "O player está com Battle.") doSendMagicEffect(getCreaturePosition(cid), 2) end else doPlayerSendCancel(cid, "Você só pode mudar o nome de Player's.") doSendMagicEffect(getCreaturePosition(cid), 2) end return true end
Coloque a tag em data / talkactions / talkactions.xml :
<talkaction log="yes" words="/rn" access="4" event="script" value="NomeDoArquivo.lua"/>
Simples