PE

[Pedido/urgente] Script

Por Pexezenho, 25 de mar. de 2011 em Archived

script
7
1.1k
PexezenhoP
25 de março de 2011 às 14:04

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..

25 de março de 2011 às 14:22

retired.

 

Edito depois.

Editado Março 25 por Demonbholder

PexezenhoP
25 de março de 2011 às 14:27

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?

25 de março de 2011 às 14:32
<talkaction words="!mudarnome" script="NomeDoArquivo.lua"/>

PexezenhoP
25 de março de 2011 às 15:03

não funciona.

VodkartV
25 de março de 2011 às 23:19

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.