JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
This script has been updated and fixed by JDB.
Although it was first edited by Trekes & Kaorus.
And was originally created by Empty.
The Forgotten Server 0.3.4 & 0.3.5
For More Information: http://otland.net/f82/vip-system-19426/
data/actions/actions.xml
data/actions/scripts/other/vip.lua
data/globalevents/globalevents.xml
data/globalevents/scripts/removeVipDays.lua
data/globalevents/scripts/removeVip.lua
NOTICE:
System has not been tested thoroughly.
If there are problem's, please report them here.
Although it was first edited by Trekes & Kaorus.
And was originally created by Empty.
The Forgotten Server 0.3.4 & 0.3.5
For More Information: http://otland.net/f82/vip-system-19426/
data/actions/actions.xml
PHP:
<action itemid="5807" script="other/vip.lua"/>
<action itemid="5806" script="other/vip.lua"/>
<action itemid="5805" script="other/vip.lua"/>
<action itemid="5785" script="other/vip.lua"/>
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg =
{
[5807] = {amount = (getPlayerStorageValue(cid)+30), days = 30}, -- Bronze Goblet
[5806] = {amount = (getPlayerStorageValue(cid)+90), days = 60}, -- Silver Goblet
[5805] = {amount = (getPlayerStorageValue(cid)+180), days = 180}, -- Golden Goblet
[5785] = {amount = (getPlayerStorageValue(cid)+360), days = 360} -- Medal of Honor
}
local status = 10000
local storage = getPlayerStorageValue(cid, status)
if (storage == -1) then
doSendAnimatedText(getCreaturePosition(cid), "+".. cfg[item.itemid].days .." Days", TEXTCOLOR_LIGHTBLUE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You are now a VIP Member for ".. cfg[item.itemid].days .." days.")
setPlayerStorageValue(cid, status, cfg[item.itemid].amount)
doRemoveItem(item.uid)
else
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already a VIP member.")
end
return true
end
data/globalevents/globalevents.xml
PHP:
<globalevent name="checkVip" interval="86400000" script="removeVipDays.lua"/>
<globalevent name="removeVip" interval="36000000" script="removeVip.lua"/>
Lua:
local storage = 10000
function onThink(cid, item, fromPosition, toPosition)
for _, name in ipairs(getOnlinePlayers()) do
local player = getPlayerByName(name)
if getPlayerStorageValue(player, storage) > 1 then
setPlayerStorageValue(player, storage, getPlayerStorageValue(player) - 1)
end
end
end
data/globalevents/scripts/removeVip.lua
Lua:
local storage = 10000
function onThink(cid, item, fromPosition, toPosition)
for _, name in ipairs(getOnlinePlayers()) do
local player = getPlayerByName(name)
if getPlayerStorageValue(player, storage) == 1 then
setPlayerStorageValue(player, storage, 0)
end
end
end
NOTICE:
System has not been tested thoroughly.
If there are problem's, please report them here.
Last edited: