RI

System Vip Poe Item

Por rime, 30 de jul. de 2010 em Scripts

13
3k
rimeR
30 de julho de 2010 às 14:13

Boa galera, estou precisando urgente de um scritp vou explica...

Eu tenho um ot e queria vender o vip por um item que quando o playe clicasse nele ele ganhasse 30 dias de vip.

 

O storage do vip do meu serv e 13540

 

 

Me ajuda ae galera ;x

VodkartV
30 de julho de 2010 às 15:22
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

rimeR
30 de julho de 2010 às 18:41

Ei vei legal masi sou meio noob aonde eu boto isso?

Qual tag uso?

qual nome que salvo esse arquivo

Obrigado ;D

e cada o id do item ;p

me explica o procedimento corretim sou newbie

Editado Julho 30 por rime

VodkartV
30 de julho de 2010 às 18:45

a script é em Actions/script

 

dps em Actions.xml

 

add

 

<action itemid="ID DO SEU ITEM" script="NOME DO SEU SCRIPT.lua" />

 

Negrito : Modifique

rimeR
30 de julho de 2010 às 18:46

te amo amo amo vlw vei.

paz e tudo de bom pra vc.

 

-----------------------------

Cara deu qualse tudo certo.

so que o item n adiciona o vip não adiciona.

da tudo certo menos o vip n e add ;/

------------------------------

no site o meu status fica como se eu tivesse vip mais no jogo n posso acessa as areas vip.

-----------------------------

Ja com o comando do god /vip add eu posso entra nas areas

--------------------------------

olhei no talcktions

e o script do god é assim:

 

-- [( Script edited by: DoidinMapper )] --
function onSay(cid, words, param)
access = 4
days = 30
player = getPlayerByName(param)
daysvalue = days*3600*24
storageplayer = getPlayerStorageValue(player,13540)
timenow = os.time()
if storageplayer == -1 or storageplayer == 0 then
time = timenow+daysvalue
else
time = storageplayer+daysvalue
end
if param ~= "" then
if getPlayerGroupId(cid) >= access then
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added ".. days .." VIP day on your character.")
setPlayerStorageValue(player,13540,time)
quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have ".. quantity .." days of VIP time.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only members with greater access to ".. access .." can add VIP.")
end
end
end

Editado Julho 30 por rime

VodkartV
30 de julho de 2010 às 19:25

eu testei aqui e adiciona sim...

 

qual o tile vip que voce ta usando?

 

eu tenho um comando !vipdays que checka quantos dias de vip ainda tem...

rimeR
30 de julho de 2010 às 19:34

------------------------------

no site o meu status fica como se eu tivesse vip mais no jogo n posso acessa as areas vip.

-----------------------------

Ja com o comando do god /vip add eu posso entra nas areas

--------------------------------

olhei no talcktions

e o script do god é assim:

 

-- [( Script edited by: DoidinMapper )] --
function onSay(cid, words, param)
access = 4
days = 30
player = getPlayerByName(param)
daysvalue = days*3600*24
storageplayer = getPlayerStorageValue(player,13540)
timenow = os.time()
if storageplayer == -1 or storageplayer == 0 then
time = timenow+daysvalue
else
time = storageplayer+daysvalue
end
if param ~= "" then
if getPlayerGroupId(cid) >= access then
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added ".. days .." VIP day on your character.")
setPlayerStorageValue(player,13540,time)
quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have ".. quantity .." days of VIP time.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only members with greater access to ".. access .." can add VIP.")
end
end
end

VodkartV
30 de julho de 2010 às 19:52

quero ver o do tilevip

 

lá em, movements

rimeR
30 de julho de 2010 às 20:21

tae

 

 

function onStepIn(cid, item, position, fromPosition)

local tileConfig = {
kickPos = fromPosition, kickEffect = CONST_ME_POFF,
kickMsg = "You need to be a vip player to access this area.",
enterMsg = "Welcome to vip area!",
enterEffect = CONST_ME_MAGIC_RED,
}

if isPlayer(cid) == true then   
if vip.hasVip(cid) == FALSE then 
       doTeleportThing(cid, tileConfig.kickPos)
       doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect)
       doPlayerSendCancel(cid, tileConfig.kickMsg)
       return
   end
       doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg)
       doSendMagicEffect(position, tileConfig.enterEffect)
       return true
end
end

 

 

---------------------------------------------------------

TENTEI BOTA ESSE PRA VER SE RESOLVIA ALGO MAIS NADA:

 

TODOS OS PLAYER PASSAVAM

 

function onStepIn(cid, position, fromPosition)

local tileConfig = {
kickPos = fromPosition, kickEffect = CONST_ME_POFF,
kickMsg = "You need to be a vip player to access this area.",
enterMsg = "Welcome to vip area!",
enterEffect = CONST_ME_MAGIC_RED,
vipstorage = getPlayerStorageValue(cid,13540),
}

if isPlayer(cid) == true then   
if vipstorage(cid) >= 1 then 
       doTeleportThing(cid, tileConfig.kickPos)
       doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect)
       doPlayerSendCancel(cid, tileConfig.kickMsg)

   end
       doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg)
       doSendMagicEffect(position, tileConfig.enterEffect)
end
end

Editado Julho 30 por rime

VodkartV
30 de julho de 2010 às 20:29

poe esse:

 

vipe.lua

function onStepIn(cid, item, position, fromPosition)

local config = {
msgDenied = "You need to be a vip player to access this area.",
msgWelcome = "Welcome to vip area!."
}

if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome)
return TRUE
end

 

movements.xml

<movevent type="StepIn" uniqueid="13700" event="script" value="vipe.lua"/>

rimeR
30 de julho de 2010 às 20:44

deu certo mano...

04 de agosto de 2010 às 22:43

Pedido/Dúvida sanada, tópico reportado.

 

Abraços.. ;)

7 meses depois...
FeehGussoF
14 de março de 2011 às 04:24

Boooa lek..essa script funcionou aki certinho :D..mais tenho uma duvida keria tua scprit desse nome [VIP] ...e quando acabar a vip sai o nome vip :D..valew tenta ae ;x