Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
  • Autor
local config = {
    removeItem = "yes",
    strInName = "[VIP] "
}

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)
    doRemoveCreature(cid)
    db.executeQuery("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";")
    return true
end

 Agora só adicionar a TAG em actions

 

 

 

Mano não add o nome =(, lembrando que meu server é tfs 0.4 e tem gesior

 

 

o que eu usava e funcinava perfeitamente era 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 
local name = getCreatureName(cid)
local days = 30 -- dias que serão adicionados
local strg = 13500 -- valor da sua storage
local strg_n = 12120 -- não precisa editar
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, strg)
local timenow = os.time()
 
 
    if getPlayerStorageValue(cid, strg) - os.time() <= 0 then
time = timenow + daysvalue
    else
time = storageplayer + daysvalue
    end
 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
        setPlayerStorageValue(cid, strg, time)
local quantity = math.floor((getPlayerStorageValue(cid, strg) - timenow)/(24 * 60 * 60))
        doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
        doPlayerAddPremiumDays(cid, 30)
doRemoveItem(item.uid, 1)
    if getPlayerStorageValue(cid, strg_n) < 1  then
        setPlayerStorageValue(cid, strg_n, 1)
        db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";")
        doRemoveCreature(cid)  
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seus dias foram acrescentados e seu nome ja foi alterado.")
    end
return TRUE
end
  • Respostas 15
  • Visualizações 916
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Pode ser por uma talkaction ? se a resposta é sim: data/talkactions/scripts crie systemvip.lua data/talkactions e abra talkactions.xml adicione a tag         <talkaction words="!svipdays

  • local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id` = "..guid..";")

  • Tenta trocar: db.executeQuery por: db.query

Postado
  • Autor

 

Tenta trocar:

db.executeQuery

por:

db.query

 

 

Manoh, agora deu kkkk, mas tipo ta assim [VIP] Tester

e tem como cria um player com o nick Tester :unsure:

 

e tem como colocar ele como storange 13500, e... acabar em 15 dias.. kk rep+++ e melhor resposta se ajuda ^^

Postado

Troca o script por esse:

local config = {
    removeItem = "yes",
    strInName = "[VIP] ",
    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), "[VIP] ")) 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 MaTTch (veja o histórico de edições)

Postado
  • Autor

 

Troca o script por esse:

local config = {
    removeItem = "yes",
    strInName = "[VIP] ",
    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), "[VIP] ") 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

 

 

olha, tem como cria 2 personagem com o mesmo nick agora ='(

 

sabe como arrumar??

 

TIPO NO ACCOUNT MANAGER TEM NÃO TEM COMO CRIAR UMA CONTA COM OUTRO NOME MAS NO SITE TEM  :unsure:

ajuda plxx

 

10981156_1547194938893894_29474915181141

Editado por Danielgomes (veja o histórico de edições)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo