Ir para conteúdo
  • Cadastre-se

Alguem poderia me ajudar com systemvip?


Posts Recomendados

Estou precisando de ajuda com meu vip, queria saber oq preciso pra colocar pro "vip por item" fazer teleportar para o templo assim que acabar o vip.

 

action/vip/addvip.lua

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local config={
removeOnUse = "yes" -- remover quando usar ("yes" or "no")
}
 
local days = 30 -- dias que serão adicionados
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13540)
local timenow = os.time()
 
if getPlayerStorageValue(cid,  13540 ) - 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, 13540, time)
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
doSendMagicEffect(getPlayerPosition(cid), math.random(28,30))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
if (config.removeOnUse == "yes") then
doRemoveItem(item.uid, 1)
end
 
return TRUE
end
 
 
actions.xml
 
 
<action itemid="5785" script="vip/addvip.lua"/>
 
 
Esse é meu vip, obg desde já!
 
Editado por fiurdrecs (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

creaturescripts/scripts/vip.lua

function onLogin(cid)
    if getPlayerPremiumDays(cid) > 0 and getPlayerStorageValue(cid, NUMERO DA STORAGE) == -1 then
        setPlayerStorageValue(cid, NUMERO DA STORAGE, 1)
    end
    if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid, NUMERO DA STORAGE) == 1 then
        setPlayerStorageValue(cid, NUMERO DA STORAGE, -1)
        local temple = getTownTemplePosition(getPlayerTown(cid))
        doTeleportThing(cid, temple)
        doPlayerPopupFYI(cid, "Sua VIP acabou!") 
    end
 return true
end

creaturescripts.xml

<event type="login" name="Vip" script="vip.lua"/>

login.lua

registerCreatureEvent(cid, "Vip")
Link para o post
Compartilhar em outros sites
  Em 28/06/2015 em 17:19, Larissa Azhaurn disse:

 

creaturescripts/scripts/vip.lua

function onLogin(cid)
    if getPlayerPremiumDays(cid) > 0 and getPlayerStorageValue(cid, NUMERO DA STORAGE) == -1 then
        setPlayerStorageValue(cid, NUMERO DA STORAGE, 1)
    end
    if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid, NUMERO DA STORAGE) == 1 then
        setPlayerStorageValue(cid, NUMERO DA STORAGE, -1)
        local temple = getTownTemplePosition(getPlayerTown(cid))
        doTeleportThing(cid, temple)
        doPlayerPopupFYI(cid, "Sua VIP acabou!") 
    end
 return true
end

creaturescripts.xml

<event type="login" name="Vip" script="vip.lua"/>

login.lua

registerCreatureEvent(cid, "Vip")
Mostrar mais  

Eu coloquei, agora pra testar, eu teria que ter um comando pra tirar o vip e aquele !vipdays, sabe fazer? 

Obs: Meu sistema de vip, não é pelo premium!! obg (: depois de resolvido vou postar ele, vai ficar bacana!

Editado por fiurdrecs (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Veja se vai:

 

data/talkactions/vipcomandos.lua

function onSay(cid,words,param)

local requiredGroup = x  ----- ID DO GRUPO QUE PODE USAR O COMANDO

local vipStorageValue = xxx ------ STORAGE DA VIP

local target = getPlayerByNameWildcard(param)

    if words == '/adicionarvip' then    
    
        if target > 0 then
        if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == -1 then
            adminName = getPlayerName(cid)         
            setPlayerStorageValue(target, vipStorageValue, 1)            
            doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'Agora você é um membro VIP, '..adminName..' adicionou sua VIP')             
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deu VIP para "..param..".")            

        elseif getPlayerGroupId(cid) < requiredGroup then        
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode dar VIP para este membro.")
            
        elseif getPlayerStorageValue(target, vipStorageValue) ~= -1 then        
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este membro ja está com VIP.")
        end
        else
                doPlayerSendTextMessage(cid, 21, "O player não existe ou não está online.")
        
        end
        

    elseif words == '/removervip' then    
    
        if target > 0 then
        if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == 1 then
            adminName = getPlayerName(cid)         
            setPlayerStorageValue(target, vipStorageValue, -1)            
            doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'Agora você é um membro free. '..adminName..' Retirou sua VIP.')             
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você retirou a VIP de "..param..".")            

        elseif getPlayerGroupId(cid) < requiredGroup then        
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode tirar a VIP of anyone.")
            
        elseif getPlayerStorageValue(target, vipStorageValue) ~= 1 then        
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não é um membro VIP.")
        end
        else
                doPlayerSendTextMessage(cid, 21, "O player não existe ou não está online.")
        
        end
end        
return TRUE
end

talkactions.xml

<talkaction log="yes" words="/adicionarvip" event="script" value="vipcomandos.lua"/>
<talkaction log="yes" words="/removervip" event="script" value="vipcomandos.lua"/>
Link para o post
Compartilhar em outros sites
  Em 28/06/2015 em 17:53, Larissa Azhaurn disse:
Expand   Mostrar mais  

Consegui por os comandos olhando outro tutorial, ficou assim:

 

data/talkactions/scripts/vipcomandos.lua:

 

 

-- Script System vip 1.0 --
 
function onSay(cid, words, param)
if(words == "!vip") then
if doPlayerRemoveItem(cid, 5785, 1) == TRUE then
local days = 30
local daysvalue = days * 24 * 60 * 60
local storageplayer = getPlayerStorageValue(cid, 13540)
local timenow = os.time()
 
if getPlayerStorageValue(cid, 13540) - 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, 13540, time)
 
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(240 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa do item da quest Vip.")
end
 
elseif(words == "!vipdays") then
local timenow = os.time()
local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no seu character.")
 
elseif(words == "/checkvip") then
if getPlayerAccess(cid) == 5 then
if not param then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end
 
local player = getPlayerByName(param)
local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
 
local timenow = os.time()
 
local quantity = math.floor((getPlayerStorageValue(player, 13540) - timenow)/(24 * 60 * 60))
doPlayerPopupFYI(cid, "O jogador tem ".. (quantity < 0 and 0 or quantity) .." dias de VIP no character.")
return TRUE
end
 
elseif(words == "/addvip") then
if getPlayerAccess(cid) == 5 then
local t = string.explode(param, ",")
if not t[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end
 
local player = getPlayerByName(t[1])
local days = t[2]
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
 
local daysvalue = days*3600*24
local storageplayer = getPlayerStorageValue(player, 13540)
local timenow = os.time()
 
local time = storageplayer <= 0 and (timenow + daysvalue) or (storageplayer + daysvalue)
 
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..days.." dias de VIP no seu character.")
setPlayerStorageValue(player, 13540, time)
local quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você tem "..quantity.." dias de VIP restantes.")
end
 
elseif(words == "/delvip") then
if getPlayerAccess(cid) == 5 then
local dec = MESSAGE_INFO_DESCR
if(param == "") then return TRUE,doPlayerSendTextMessage(cid,18,"Command param required.")end
local C,t = {},string.explode(param, ",")
C.pos = getPlayerPosition(cid)
C.uid = getCreatureByName(t[1])
C.time = ((tonumber(t[2]) == nil) and 1 or tonumber(t[2]))*3600*24 --Tempo da vip por dia.
C.days = (tonumber(t[2]) == nil) and 1 or tonumber(t[2]) --Dias de vip.
local pid = getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
 
if(getPlayerStorageValue(C.uid, 13540) < C.time)then
doPlayerSendTextMessage(cid,dec,'O jogador '..t[1]..' não possui '..C.days..' dias de vip.')
else
doPlayerSendTextMessage(cid,dec,'Você removeu '..C.days..' dias de vip do player '..t[1]..'.')
setPlayerStorageValue(C.uid, 13540, getPlayerStorageValue(C.uid, 13540)-C.time)
end
doSendMagicEffect(C.pos, math.random(28,30))
end
end
 
return TRUE
end
 
 
 
data/talkactions/talkactions.xml :
 
<talkaction log="yes" words="/checkvip;/addvip;/delvip" script="vipcomandos.lua"/>
<talkaction words="!vip;!vipdays;" script="vipcomandos.lua"/>
 

Agora só preciso do sistema que manda o player para o templo assim que a vip acabar, mas ta dificil :/ obg

OBS: Esqueci de avisar, uso mysql

Editado por fiurdrecs (veja o histórico de edições)
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.

  • Estatísticas dos Fóruns

    96837
    Tópicos
    519577
    Posts
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo