Styller Yourots, version 0.7.5 (Styller Yourots)
8.60
Talkactions
Nivel de experiencia: médio
Quero um script
q o player fale !mudarnome Novo Nome
e troque o nick dele..
Custaria 100k.
Obgdo..
Styller Yourots, version 0.7.5 (Styller Yourots)
8.60
Talkactions
Nivel de experiencia: médio
Quero um script
q o player fale !mudarnome Novo Nome
e troque o nick dele..
Custaria 100k.
Obgdo..
retired.
Edito depois.
Oie :D
Não pude testar.
function onSay(cid, words, param) if param == "" then doPlayerSendCancel(cid, "Param required.") doSendMagicEffect(getCreaturePosition(cid), 2) end if string.len(param) > 15 then doPlayerSendCancel(cid, "Name is too long.") doSendMagicEffect(getCreaturePosition(cid), 2) elseif string.len(param) < 5 then doPlayerSendCancel(cid, "Name is too short.") doSendMagicEffect(getCreaturePosition(cid), 2) end if playerExists(param) then doPlayerSendCancel(cid, "This player already exists.") doSendMagicEffect(getCreaturePosition(cid), 2) end if getPlayerMoney(cid) > 100000 then doPlayerRemoveMoney(cid, 100000) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = ".. param .. " WHERE `id` = ".. getPlayerGUID(cid) ..";") else doPlayerSendCancel(cid, "Você não tem dinheiro suficiente.") doSendMagicEffect(getCreaturePosition(cid), 2) end return TRUE end
__________
como ficaria o .xml dele?
<talkaction words="!mudarnome" script="NomeDoArquivo.lua"/>
Oie :D
não funciona.
Eu prefiro fazer meus próprios scripts... refiz ele e já testei, ta ai:
function onSay(cid, words, param) if param ~= "" then if string.len(param) < 15 and string.len(param) > 5 then local pid = getPlayerGUID(cid) if getPlayerMoney(cid) > 100000 then doPlayerRemoveMoney(cid, 100000) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '".. param .. "' WHERE `id` = ".. pid ..";") else doPlayerSendCancel(cid, "Você não tem dinheiro suficiente.") doSendMagicEffect(getCreaturePosition(cid), 2) end else doPlayerSendCancel(cid, "Nome invalido.") doSendMagicEffect(getCreaturePosition(cid), 2) end else doPlayerSendCancel(cid, "Parâmetro necessário.") doSendMagicEffect(getCreaturePosition(cid), 2) end return TRUE end
Eu tava testando e não é necessário a função playerExists. Tenta ai.
Oie :D