• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Check number of VIP days when logging in

Mizakinha

New Member
Joined
Apr 18, 2021
Messages
31
Reaction score
4
Hello, gentlemen!

I have a script that when the player buys a VIP on my server, his account will stay with that VIP for 30 days and he will get a storage (which will be used for several things, but it does not matter here).

Well, the problem is that when the 30 days of VIP is over, the player continues with a storage.

I need a script that removes that storage when the VIP days are over. Can anyone help me with this?
 

Attachments

Solution
Forgiveness by mistake.

I was trying to edit my code and ended up changing it. I'll post again with the right script this time. This one has a 30-day counter, how can I do it so that after those 30 days have finished removing the player's storage?

I am using a TFS version 0.3.6

Lua:
local a = {
ITEM = {2145, 25}, -- ITEM, QUANTIDADE
DAYS = 90 -- Dias de vip
}
function onSay(cid, words, param,channel)
if getPlayerItemCount(cid, a.ITEM[1]) >= a.ITEM[2] then
doPlayerAddPremiumDays(cid, a.DAYS)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You receive "..a.DAYS.." VIP account days!")
setPlayerStorageValue (cid, 123456, 1)
doSendMagicEffect(getCreaturePosition(cid), 28)
doPlayerRemoveItem(cid, a.ITEM[1], a.ITEM[2])
else...

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
1,036
Solutions
102
Reaction score
1,093
Location
London
GitHub
MillhioreBT
I would recommend you publish the code and if it is too long you have the option of using a page to publish codes, per example: pastebin.com
it's easier for us to help you if you do it that way
 
OP
OP
M

Mizakinha

New Member
Joined
Apr 18, 2021
Messages
31
Reaction score
4
I would recommend you publish the code and if it is too long you have the option of using a page to publish codes, per example: pastebin.com
it's easier for us to help you if you do it that way
function onSay(cid, words, param)
if getPlayerStorageValue(cid, 123456) == 1 then
return doPlayerSendTextMessage(cid, 20, "Ya eres Vip.") and true
else
if getPlayerItemCount(cid, 2145) < 8 then
return doPlayerSendTextMessage(cid, 20, "Necesitas de 8 diamond para comprar vip.") and true
end
if getPlayerItemCount(cid, 2145) >= 8 then
setPlayerStorageValue(cid, 123456, 1)
doPlayerRemoveItem(cid, 2145, 8)
doPlayerSendTextMessage(cid, 20, "FELICIDADES! Ahora eres vip!.")
return true
end
end
end
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
1,036
Solutions
102
Reaction score
1,093
Location
London
GitHub
MillhioreBT
That is not the script that is responsible for removing the storage, in fact it seems that it does not even have a 30-day counter as you mention in your post
that script you show is just a command that removes an item and gives you a storage and already
Surely he has raised his publication wrong, he must have written something like: I need a VIP system with time, that after 30 days it finish
And if that is what you are looking for, would it not be bad if I published what version of the server you are using, TFS 0.4? OTX, or other distribution

Special note, when you want to publish code, you must format, how is it formatted?

Examples:
Lua:
-- ¡Here the code!
1619057850191.png

C++:
// ¡Here the code!
1619057863507.png
 
OP
OP
M

Mizakinha

New Member
Joined
Apr 18, 2021
Messages
31
Reaction score
4
That is not the script that is responsible for removing the storage, in fact it seems that it does not even have a 30-day counter as you mention in your post
that script you show is just a command that removes an item and gives you a storage and already
Surely he has raised his publication wrong, he must have written something like: I need a VIP system with time, that after 30 days it finish
And if that is what you are looking for, would it not be bad if I published what version of the server you are using, TFS 0.4? OTX, or other distribution

Special note, when you want to publish code, you must format, how is it formatted?

Examples:
Lua:
-- ¡Here the code!
View attachment 57905

C++:
// ¡Here the code!
View attachment 57906
Forgiveness by mistake.

I was trying to edit my code and ended up changing it. I'll post again with the right script this time. This one has a 30-day counter, how can I do it so that after those 30 days have finished removing the player's storage?

I am using a TFS version 0.3.6

Lua:
local a = {
ITEM = {2145, 25}, -- ITEM, QUANTIDADE
DAYS = 90 -- Dias de vip
}
function onSay(cid, words, param,channel)
if getPlayerItemCount(cid, a.ITEM[1]) >= a.ITEM[2] then
doPlayerAddPremiumDays(cid, a.DAYS)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You receive "..a.DAYS.." VIP account days!")
setPlayerStorageValue (cid, 123456, 1)
doSendMagicEffect(getCreaturePosition(cid), 28)
doPlayerRemoveItem(cid, a.ITEM[1], a.ITEM[2])
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry but you don't have enough Digicoins to activate your VIP account.")
end
return TRUE
end
 

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,607
Solutions
34
Reaction score
303
Forgiveness by mistake.

I was trying to edit my code and ended up changing it. I'll post again with the right script this time. This one has a 30-day counter, how can I do it so that after those 30 days have finished removing the player's storage?

I am using a TFS version 0.3.6

Lua:
local a = {
ITEM = {2145, 25}, -- ITEM, QUANTIDADE
DAYS = 90 -- Dias de vip
}
function onSay(cid, words, param,channel)
if getPlayerItemCount(cid, a.ITEM[1]) >= a.ITEM[2] then
doPlayerAddPremiumDays(cid, a.DAYS)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You receive "..a.DAYS.." VIP account days!")
setPlayerStorageValue (cid, 123456, 1)
doSendMagicEffect(getCreaturePosition(cid), 28)
doPlayerRemoveItem(cid, a.ITEM[1], a.ITEM[2])
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry but you don't have enough Digicoins to activate your VIP account.")
end
return TRUE
end
in login add
Lua:
if not isPremium(cid) then
setPlayerStorageValue (cid, 123456, 0)
end
 
Solution
Top