function onSay(cid, words, param, channel)
local money = 10000
if(not(param)) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You did not specify a param.")
return false
end
if(getPlayerMoney(cid) < money) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You don't have enought money.")
return false
end
if(getCreatureCondition(cid, CONDITION_INFIGHT)) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You can't do this while you're in combat.")
return false
end
doPlayerRemoveMoney(cid, money)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `name` = " .. param .. " WHERE `id` = " .. getPlayerGUID(cid) .. "")
return true
end