Ai mano Pdc to gostando de ver esse trabalho de voces tá muito bom continue assim PDC !
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Mudar Nome Apenas Para P.A Ou Vip
AD
talkaction
Mudar Nome Apenas Para P.A Ou Vip
Por AdilsonHacker, 02 de jun. de 2013 em Actions e Talkactions
mudar nome para vips
otserv
tibia
script
3
1.2k
info
Grupo: Campones
Registrado: 04/06/13
Posts: 2
Reputação: 0
Char no Tibia: Brenolim

04 de junho de 2013 às 13:57
Editado Junho 12 por brenomapper1251
info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino

05 de junho de 2013 às 09:50
Obrigado Pelos elogios!


info
Grupo: Visconde
Registrado: 24/11/12
Posts: 474
Reputação: +98
Gênero: Masculino
Olá galera do xtibia , venho trazer para vocês um sistema que muito simples mais também pode ser muito útil para pessoas que tem seu servidor sem site é gostaria de por um sistema desse no seu servidor !
Bom vamos lá este script e o seguinte através do script você poderá configurar a quantidade de dias de premium ou vip será necessário para a mudança de nome , quando o player usar o comando exempo : !mudarnome Xtibia , o player será kikado ao relogar já não irar ta mais os dias de vip que ele usou para trocar o nome !
Testado em TFS 0.3.6 , TFS 0.4 , Versões 8.54 , 8.6
Bom vamos ao script :
vá em talkactions/script crie um arquivo lua chamado "mudarnome" é cole isso dentro :
Lembrando Este e para premium Account :
local config = {
maxTextLenght = 15, -- Maximum Text Length
blacklistParam = {"character", "account manager", "god", "cm", "gm", "tutor", "tester", "testing", "target dummy"}, -- Black listed content
minWordLenght = 3, -- Minimum of 3 letters per word
newMethod = false, -- TRUE only if you are using new 0.3.7+
delay = 1 -- Delay to get kicked
}
function onSay(cid, words, param, channel)
local textCancel = config.text
if(param == '') then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve botar um nome.")
elseif(getPlayerGUIDByName(param) ~= nil) then
textCancel = "Esse nome já está sendo usado."
elseif(getPlayerPremiumDays(cid) < 6) then
textCancel = "Você não tem os dias de VIP necessários."
elseif(not getTilePzInfo(getCreaturePosition(cid))) then
textCancel = "Você deve estar em uma área PZ para mudar o nome."
elseif(string.len(tostring(param)) >= config.maxTextLenght) then
textCancel = "Você pode usar no máximo " .. config.maxTextLenght .. " caracteres."
elseif(string.find(param:lower(), "[^%l%s]") ~= nil) then
textCancel = "Você não pode usar símbolos."
else
for blacklist = 1, table.maxn(config.blacklistParam) do
if(string.find(param:lower(), config.blacklistParam[blacklist]) ~= nil) then
textCancel = "Nome inválido."
break
end
end
end
if(config.text ~= textCancel) then
doPlayerSendCancel(cid, textCancel)
return true
end
local paramTemp, space, oldName = '', '', getCreatureName(cid)
for word in string.gmatch(param, "%a+") do
if(string.len(word) < config.minWordLenght) then
doPlayerSendCancel(cid, "Nome inválido.")
return true
end
paramTemp, space = "" .. paramTemp .. "" .. space .. "" .. word .. "", " "
end
local guid = getPlayerGUID(cid)
param = paramTemp
doPlayerRemovePremiumDays(cid, 6)
if(config.newMethod == true) then
doPlayerChangeName(guid, oldName, param)
else
db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(param) .. " WHERE `id` = " .. guid .. ";")
end
doPlayerSendTextMessage(cid, 25, " Você será kikado em " .. config.delay .. " segundos.")
addEvent(function(cid, forceLogout)
if(isPlayer(cid)) then
doRemoveCreature(cid, forceLogout)
end
end, config.delay * 1000, cid, false)
return true
end
Este é para servidores que possui o sistema de vip normal, não através de premium account :
local config = {
maxTextLenght = 15, -- Maximum Text Length
blacklistParam = {"character", "account manager", "god", "cm", "gm", "tutor", "tester", "testing", "target dummy"}, -- Black listed content
minWordLenght = 3, -- Minimum of 3 letters per word
newMethod = false, -- TRUE only if you are using new 0.3.7+
delay = 1 -- Delay to get kicked
}
function onSay(cid, words, param, channel)
local textCancel = config.text
if(param == '') then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve botar um nome.")
elseif(getPlayerGUIDByName(param) ~= nil) then
textCancel = "Esse nome já está sendo usado."
elseif(getPlayerVipDays(cid) < 6) then
textCancel = "Você não tem os dias de VIP necessários."
elseif(not getTilePzInfo(getCreaturePosition(cid))) then
textCancel = "Você deve estar em uma área PZ para mudar o nome."
elseif(string.len(tostring(param)) >= config.maxTextLenght) then
textCancel = "Você pode usar no máximo " .. config.maxTextLenght .. " caracteres."
elseif(string.find(param:lower(), "[^%l%s]") ~= nil) then
textCancel = "Você não pode usar símbolos."
else
for blacklist = 1, table.maxn(config.blacklistParam) do
if(string.find(param:lower(), config.blacklistParam[blacklist]) ~= nil) then
textCancel = "Nome inválido."
break
end
end
end
if(config.text ~= textCancel) then
doPlayerSendCancel(cid, textCancel)
return true
end
local paramTemp, space, oldName = '', '', getCreatureName(cid)
for word in string.gmatch(param, "%a+") do
if(string.len(word) < config.minWordLenght) then
doPlayerSendCancel(cid, "Nome inválido.")
return true
end
paramTemp, space = "" .. paramTemp .. "" .. space .. "" .. word .. "", " "
end
local guid = getPlayerGUID(cid)
param = paramTemp
doPlayerRemoveVipDays(cid, 6)
if(config.newMethod == true) then
doPlayerChangeName(guid, oldName, param)
else
db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(param) .. " WHERE `id` = " .. guid .. ";")
end
doPlayerSendTextMessage(cid, 25, " Você será kikado em " .. config.delay .. " segundos.")
addEvent(function(cid, forceLogout)
if(isPlayer(cid)) then
doRemoveCreature(cid, forceLogout)
end
end, config.delay * 1000, cid, false)
return true
end
Agora Vá em talkactions.xml é adicione essa tag :
Local Onde você configura os dias de vip que vai custar para mudar !
Creditos : 80% Desconhecido
20% AdilsonHacker ( eu por editar algumas coisas )
Espero Ter Ajudado !
Abraços
@up
Editado Junho 2 por AdilsonHacker