Ir para conteúdo
  • Cadastre-se

(Resolvido)Sistema de [VIP] no nome (Ajuda!)


Ir para solução Resolvido por xADMx,

Posts Recomendados

Então pessoal queria ajuda de vocês por que, eu vi vários topicos ai, mais muitos e de (!BUYVIP) e outros e por BAU mas apenas o de (!BUYVIP Sai o Tag VIP do nome.)

 

Bom e o seguinte no meu servidor tem uma Area Donate... (Clicando em certo item ganha 30 dias vip.) e eu queria que quando o player clicasse no item ele fosse Deslogado e ganhasse a tag [DNT] no nome, exemplo  [DNT] Gabriel - passou 30 dias o [DNT] Sumisse do nome do player .. ... 

 

ID  do item  que da a VIP DONATE

[ 10309 ]

 

pbotttttttttttttttttttt.gif?1435636828

Link para o post
Compartilhar em outros sites

TFS 0.4

 

tente assim.

 

action.xml

<action itemid="10309" script="test.lua"/>

action/lua.

local config = {
    removeItem = "yes",
    strInName = "[DNT] ",
    vipStorage = 13500,
    vipDays = 15
}

config.removeItem = getBooleanFromString(config.removeItem)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local name, guid = getCreatureName(cid), getPlayerGUID(cid)
    doRemoveItem(item.uid, config.removeItem and 1 or 0)
    setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time())
    doRemoveCreature(cid)
    db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";")
    return true
end

depois vá em login.lua e la no final você coloca isso;

if(string.find(getCreatureName(cid), "[DNT] ") then
        if(getPlayerStorageValue(cid, 13500) < os.time) then
            local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)
            setPlayerStorageValue(cid, 13500, -1)
            doRemoveCreature(cid)
            db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")
            return true
        end
    end
Editado por Jobs (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

 

tente assim.

 

action.xml

<action itemid="10309" script="test.lua"/>

action/lua.

local config = {
    removeItem = "yes",
    strInName = "[DNT] ",
    vipStorage = 13500,
    vipDays = 15
}

config.removeItem = getBooleanFromString(config.removeItem)
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local name, guid = getCreatureName(cid), getPlayerGUID(cid)
    doRemoveItem(item.uid, config.removeItem and 1 or 0)
    setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time())
    doRemoveCreature(cid)
    db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";")
    return true
end

depois vá em login.lua e la no final você coloca isso;

if(string.find(getCreatureName(cid), "[DNT] ") then
        if(getPlayerStorageValue(cid, 13500) < os.time) then
            local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)
            setPlayerStorageValue(cid, 13500, -1)
            doRemoveCreature(cid)
            db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")
            return true
        end
    end

Certo, mais o login.lua eu adiciono no data/creaturescripts/scripts ?

pbotttttttttttttttttttt.gif?1435636828

Link para o post
Compartilhar em outros sites

s amg.

fiz assim.... ai quando tentei abrir o servidor falou que tem um ERRO no login.lua

function onLogin(cid)

if(getConfigValue('deathLostPercent') ~= nil) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, getConfigValue('deathLostPercent') * 10)

end

if(getPlayerAccountManager(cid) == MANAGER_NONE) then

if(getPlayerLastLoginSaved(cid) > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your last visit was on " .. os.date("%a %b %d %X %Y", getPlayerLastLoginSaved(cid)) .. ".")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")

doPlayerSendOutfitWindow(cid)

end

elseif(getPlayerAccountManager(cid) == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(getPlayerAccountManager(cid) == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to manage your account and if you want to start over then type [cancel].")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to create an account or type [recover] to recover an account.")

end

if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end

registerCreatureEvent(cid, "critical")

if getPlayerStorageValue(cid, 48903) == -1 then

setPlayerStorageValue(cid, 48903, 0)

end

registerCreatureEvent(cid, "Mail")

registerCreatureEvent(cid, "DoubleExp")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "pvpsystem")

registerCreatureEvent(cid, "SaveLogout")

registerCreatureEvent(cid, "RushCombat")

registerCreatureEvent(cid, "RushAttack")

registerCreatureEvent(cid, "RushDead")

registerCreatureEvent(cid, "RushOutfit")

registerCreatureEvent(cid, "GuildMotd")

registerCreatureEvent(cid, "killer")

registerCreatureEvent(cid, "Idle")

registerCreatureEvent(cid, "antiacc")

registerCreatureEvent(cid, "TiraBattle")

registerCreatureEvent(cid, "CombatDodge")

registerCreatureEvent(cid, "attackguild")

registerCreatureEvent(cid, "advance")

registerCreatureEvent(cid, "FimVip")

registerCreatureEvent(cid, "forever amulet")

registerCreatureEvent(cid, "SkullCheck")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "VipReceive")

registerCreatureEvent(cid, "PlayerKill")

if(string.find(getCreatureName(cid), "[DNT] ") then

if(getPlayerStorageValue(cid, 13500) < os.time) then

local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)

setPlayerStorageValue(cid, 13500, -1)

doRemoveCreature(cid)

db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")

return true

end

pbotttttttttttttttttttt.gif?1435636828

Link para o post
Compartilhar em outros sites

fiz assim.... ai quando tentei abrir o servidor falou que tem um ERRO no login.lua

function onLogin(cid)

if(getConfigValue('deathLostPercent') ~= nil) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, getConfigValue('deathLostPercent') * 10)

end

if(getPlayerAccountManager(cid) == MANAGER_NONE) then

if(getPlayerLastLoginSaved(cid) > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your last visit was on " .. os.date("%a %b %d %X %Y", getPlayerLastLoginSaved(cid)) .. ".")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")

doPlayerSendOutfitWindow(cid)

end

elseif(getPlayerAccountManager(cid) == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(getPlayerAccountManager(cid) == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to manage your account and if you want to start over then type [cancel].")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to create an account or type [recover] to recover an account.")

end

if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end

registerCreatureEvent(cid, "critical")

if getPlayerStorageValue(cid, 48903) == -1 then

setPlayerStorageValue(cid, 48903, 0)

end

registerCreatureEvent(cid, "Mail")

registerCreatureEvent(cid, "DoubleExp")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "pvpsystem")

registerCreatureEvent(cid, "SaveLogout")

registerCreatureEvent(cid, "RushCombat")

registerCreatureEvent(cid, "RushAttack")

registerCreatureEvent(cid, "RushDead")

registerCreatureEvent(cid, "RushOutfit")

registerCreatureEvent(cid, "GuildMotd")

registerCreatureEvent(cid, "killer")

registerCreatureEvent(cid, "Idle")

registerCreatureEvent(cid, "antiacc")

registerCreatureEvent(cid, "TiraBattle")

registerCreatureEvent(cid, "CombatDodge")

registerCreatureEvent(cid, "attackguild")

registerCreatureEvent(cid, "advance")

registerCreatureEvent(cid, "FimVip")

registerCreatureEvent(cid, "forever amulet")

registerCreatureEvent(cid, "SkullCheck")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "VipReceive")

registerCreatureEvent(cid, "PlayerKill")

if(string.find(getCreatureName(cid), "[DNT] ") then

if(getPlayerStorageValue(cid, 13500) < os.time) then

local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)

setPlayerStorageValue(cid, 13500, -1)

doRemoveCreature(cid)

db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")

return true

end

 

tenta assim

 

function onLogin(cid)

if(getConfigValue('deathLostPercent') ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, getConfigValue('deathLostPercent') * 10)
end

if(getPlayerAccountManager(cid) == MANAGER_NONE) then
if(getPlayerLastLoginSaved(cid) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your last visit was on " .. os.date("%a %b %d %X %Y", getPlayerLastLoginSaved(cid)) .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")
doPlayerSendOutfitWindow(cid)
end
elseif(getPlayerAccountManager(cid) == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(getPlayerAccountManager(cid) == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to manage your account and if you want to start over then type [cancel].")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to create an account or type [recover] to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

if(string.find(getCreatureName(cid), "[DNT] ") then
        if(getPlayerStorageValue(cid, 13500) < os.time) then
            local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)
            setPlayerStorageValue(cid, 13500, -1)
            doRemoveCreature(cid)
            db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")
            return true
        end
    end

registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48903) == -1 then
setPlayerStorageValue(cid, 48903, 0)
end

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "DoubleExp")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "pvpsystem")
registerCreatureEvent(cid, "SaveLogout")
registerCreatureEvent(cid, "RushCombat")
registerCreatureEvent(cid, "RushAttack")
registerCreatureEvent(cid, "RushDead")
registerCreatureEvent(cid, "RushOutfit")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "killer")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "antiacc")
registerCreatureEvent(cid, "TiraBattle")
registerCreatureEvent(cid, "CombatDodge")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")

Link para o post
Compartilhar em outros sites

tenta assim

 

function onLogin(cid)

if(getConfigValue('deathLostPercent') ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, getConfigValue('deathLostPercent') * 10)
end

if(getPlayerAccountManager(cid) == MANAGER_NONE) then
if(getPlayerLastLoginSaved(cid) > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your last visit was on " .. os.date("%a %b %d %X %Y", getPlayerLastLoginSaved(cid)) .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")
doPlayerSendOutfitWindow(cid)
end
elseif(getPlayerAccountManager(cid) == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(getPlayerAccountManager(cid) == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to manage your account and if you want to start over then type [cancel].")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type [account] to create an account or type [recover] to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

if(string.find(getCreatureName(cid), "[DNT] ") then
        if(getPlayerStorageValue(cid, 13500) < os.time) then
            local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid)
            setPlayerStorageValue(cid, 13500, -1)
            doRemoveCreature(cid)
            db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";")
            return true
        end
    end

registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48903) == -1 then
setPlayerStorageValue(cid, 48903, 0)
end

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "DoubleExp")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "pvpsystem")
registerCreatureEvent(cid, "SaveLogout")
registerCreatureEvent(cid, "RushCombat")
registerCreatureEvent(cid, "RushAttack")
registerCreatureEvent(cid, "RushDead")
registerCreatureEvent(cid, "RushOutfit")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "killer")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "antiacc")
registerCreatureEvent(cid, "TiraBattle")
registerCreatureEvent(cid, "CombatDodge")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")

ainda o correu o erro 

pbotttttttttttttttttttt.gif?1435636828

Link para o post
Compartilhar em outros sites
  • Solução

Se ti ajudei. Marque como Melhor Resposta e agradeça com um Rep+, clicando em Gostei!. Obrigado!

Link para o post
Compartilhar em outros sites
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo