toma testa ae.
function onSay(cid, words, param, channel)
local p = string.explode(param, ',')
local item_id = 2145
local item_count = 1 --Mude aqui a qnt de diamonds q vai remover do player.
local proibido = {"[", "{", "]", "}", "tutor", "gm", "cm", "god", "mapper", "scripter", "programador", "spriter", "account manager", "character"} -- simbolos proibidos
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if getPlayerItemCount(cid, item_id) <= 4 then
return doPlayerSendCancel(cid, "vc precisa de 5 diamonds.")
end
if(string.find(param:lower(), "[^%l%s]") ~= nil) then
doPlayerSendCancel(cid, 20, "Voce nao pode usar simbolos no nome.")
return TRUE
end
if getPlayerGroupId(p[1]) >= 3 then
return doPlayerSendCancel(cid, "Você não pode alterar o nick de tutores, GMs, Subs e GODs.")
end
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
doPlayerRemoveItem(cid, item_id, item_count)
db.executeQuery("UPDATE `players` SET `name` = '" .. p[2] .. "' WHERE name = '" .. p[1] .. "';")
doPlayerSendTextMessage(cid, 20, "You have changed " .. p[1] .. "'s name to " .. p[2] .. " You will be logged out in 5 seconds.")
addEvent(doRemoveCreature, 5*1000, cid, true)
return true
end






info
Grupo: Artesão
Registrado: 18/03/13
Posts: 149
Reputação: +19
Gênero: Masculino
Char no Tibia: Cachero
Queria que bloqueasse para pessoa por tipo:
[Tutor] Teste bloquea sinais e nomes que seriam da "staff"