FL
pedido

Vip Por Quest

Por flavinhoo, 18 de out. de 2012 em Scripts

ajuda system de vip !
otserv
tibia
14
2k
flavinhooF
18 de outubro de 2012 às 17:29

Ai galera do Xtibia.com, eu queria saber se tem como fazer, um sistema de vip por quest.

 

Exemplo, o player da use no bau e ganha 15 dias de vip e tmb fica na frente do nome [VIP] , e asceso a area vip, qe poderia ser pela talkaction !fly

 

Alguem ai sabe como fazer?, ou se ja existe !

 

Muito Obrigado, att.

GuhPkG
18 de outubro de 2012 às 17:50

Por acaso teu server ja tem vip system?

Se sim, qual? ^^

Qual o level para poder fazer a quest?

 

 

#Edit

 

 

Olha carinha, não muito de script, to começando na area agora... Então tenta esse aqui ó:

 

 

function onUse (cid,item,frompos,item2,topos)

pos = {x=1059, y=904, z=7}

pos2 = getPlayerPosition(cid)

 

UID_DO_BAU = 2017

STORAGE_VALUE = 10000 -- Store do bau aqui

 

 

if getPlayerLevel(cid) >= 40 then

if item.uid == UID_DO_BAU then

queststatus = getPlayerStorageValue(cid,STORAGE_VALUE)

if queststatus == -1 then

doTeleportThing(cid,pos)

doPlayerSendTextMessage(cid,22,"Parabéns você terminou a Vip Quest e ganhou 15 Dias Vip.") -- Msg que ira aparecer

doPlayerAddPremiumDays(cid, 15) -- Quantidade de dias vip

setPlayerStorageValue(cid,STORAGE_VALUE,1)

doTeleportThing(cid, pos)

doSendMagicEffect(pos2, CONST_ME_TELEPORT)

else

doPlayerSendTextMessage(cid,22,"Você já fez a quest.")

end

end

else

doPlayerSendCancel(cid,'Somente leveis 40+ podem abrir este bau.')

end

return 1

end

 

 

Editando a quest

 

 

Vermelho = Dias vip's que serão ganhos.

 

Azul = Level necessário para o player poder fazer a quest.

 

Verde = Storage do bau da quest.

Editado Outubro 18 por GuhPk

flavinhooF
18 de outubro de 2012 às 19:00

ja possui sim

 

essa ai :

 

 

 

-- Script SYtem vip 1.0 --

 

function onSay(cid, words, param)

if(words == "!buyvip") then

local price = 10000000

if doPlayerRemoveMoney(cid, 10000000) == TRUE then

local days = 1

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))

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar 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

 

ou se tive-se como , colocar por item tmb , tipo nao precisava ser uma vip , algum item qe dasse tantos dias para o player poder usar !fly, para ir para area vip

Editado Outubro 18 por flavinhoo

18 de outubro de 2012 às 19:00

Por acaso teu server ja tem vip system?

Se sim, qual? ^^

Qual o level para poder fazer a quest?

 

 

#Edit

 

 

Olha carinha, não muito de script, to começando na area agora... Então tenta esse aqui ó:

 

 

function onUse (cid,item,frompos,item2,topos)

pos = {x=1059, y=904, z=7}

pos2 = getPlayerPosition(cid)

 

UID_DO_BAU = 2017

STORAGE_VALUE = 10000 -- Store do bau aqui

 

 

if getPlayerLevel(cid) >= 40 then

if item.uid == UID_DO_BAU then

queststatus = getPlayerStorageValue(cid,STORAGE_VALUE)

if queststatus == -1 then

doTeleportThing(cid,pos)

doPlayerSendTextMessage(cid,22,"Parabéns você terminou a Vip Quest e ganhou 15 Dias Vip.") -- Msg que ira aparecer

doPlayerAddPremiumDays(cid, 15) -- Quantidade de dias vip

setPlayerStorageValue(cid,STORAGE_VALUE,1)

doTeleportThing(cid, pos)

doSendMagicEffect(pos2, CONST_ME_TELEPORT)

else

doPlayerSendTextMessage(cid,22,"Você já fez a quest.")

end

end

else

doPlayerSendCancel(cid,'Somente leveis 40+ podem abrir este bau.')

end

return 1

end

 

 

Editando a quest

 

 

Vermelho = Dias vip's que serão ganhos.

 

Azul = Level necessário para o player poder fazer a quest.

 

Verde = Storage do bau da quest.

assim vai adiciona premium não vip
doPlayerAddPremiumDays(cid, 15) -- Quantidade de dias vip

 

essa função que se uso adiciona premium não vip

Editado Outubro 18 por PostadorHunterXXXX

flavinhooF
18 de outubro de 2012 às 19:11

percebi isso mesmo postadorhunter, e esse script só da a premium mesmo, acho que seria inútil ;s

Editado Outubro 18 por flavinhoo

GuhPkG
18 de outubro de 2012 às 19:32

LOL LOL

não sabia disso ai .. =//

Malz ai carinha... xD

É que estou começando agora, poderia me dar uma ajuda em duvida de alguns comandos PostadorHunter?? '-'

 

#Edit

 

Aew flavinho, troque de vip system manoow!! caraAcho que com esse vip system ai num da não para fazer nem item nem quest!!!!

Editado Outubro 18 por GuhPk

flavinhooF
19 de outubro de 2012 às 08:00

vc sabe algum que de certo?

SmiXS
19 de outubro de 2012 às 08:49

Não testei... mas vai funcionar...

local config = {
storage = 2506,
unique_Chest_Id = 3450, -- Aqui é o unique id do báu(coloca isso no map)
vip_Storage = , --  Aqui vc bota a storage do seu vip system
vip_Days = , -- Aqui vc coloca a quantidades de dias que o player vai ganhar
}
function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid ==  config.unique_Chest_Id then
queststatus = getPlayerStorageValue(cid,config.storage)
if queststatus == -1 or queststatus == 0 then
	 db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")			  
	 doPlayerSendTextMessage(cid,25,"Você será kickado em 5 segundos para mudança de nome.")	    
	 addEvent(doRemoveCreature, 5*1000, cid, true)  
		    setPlayerStorageValue(cid, config.storage, 1)
		    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
       setPlayerStorageValue(cid, config.vip_Storage, config.vip_Days)
    else
		    doPlayerSendTextMessage(cid,22,"você ja tem o [vip] no nome.")
    end
    return true
end
end

flavinhooF
19 de outubro de 2012 às 11:17

smix, me desculpe KKK , mais nao sei nem oque é o storage ;s, nao so mt ligado na area de scripts

SmiXS
19 de outubro de 2012 às 11:22

Posta seu vip system aqui

flavinhooF
19 de outubro de 2012 às 11:26

-- Script SYtem vip 1.0 --

 

function onSay(cid, words, param)

if(words == "!buyvip") then

local price = 10000000

if doPlayerRemoveMoney(cid, 10000000) == TRUE then

local days = 1

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))

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de "..price.." gp's para colocar 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

 

esse ai

SmiXS
19 de outubro de 2012 às 12:56

Agora é só testar:

local config = {
storage = 2506,
unique_Chest_Id = 3450, -- Aqui é o unique id do báu(coloca isso no map)
vip_Storage = 13540, --  Aqui vc bota a storage do seu vip system
vip_Days = 30, -- Aqui vc coloca a quantidades de dias que o player vai ganhar
}
function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid ==  config.unique_Chest_Id then
queststatus = getPlayerStorageValue(cid,config.storage)
if queststatus == -1 or queststatus == 0 then
                db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")                       
                doPlayerSendTextMessage(cid,25,"Você será kickado em 5 segundos para mudança de nome.")            
                addEvent(doRemoveCreature, 5*1000, cid, true)  
                           setPlayerStorageValue(cid, config.storage, 1)
                           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
       setPlayerStorageValue(cid, config.vip_Storage, config.vip_Days)
           else
                           doPlayerSendTextMessage(cid,22,"você ja tem o [vip] no nome.")
           end
           return true
end
end

flavinhooF
19 de outubro de 2012 às 13:13

smix, mt obrigado vei ;D ;D

 

REP+

Editado Outubro 19 por flavinhoo

SmiXS
19 de outubro de 2012 às 13:25

@Resolvido

 

Reportado para moverem...