Shawak
Intermediate OT User
Hello,
Here a full working and tested VIP System, i hope you like it :thumbup:.
And please don't forget to rep++ me if you like it ^_^.
Credits:
- Idea:
http://otland.net/f82/vip-system-19426/
http://otland.net/f81/updated-vip-system-44805/
- Script:
100% by Shawak (me )
Version:
- Tested on TFS 0.3.5 (If you have TFS 0.3.5pl1 you should use: Vip System v2.0)
- Should work with other TFSs.
New lua functions:
Script:
- data/lib/function.lua add at the end of the script:
And finished.
Other:
I also maked talkaction scripts for a GOD / CM / GM:
- data/talkactions/talkactions.xml
Lua files for the talkaction scripts, download here:
Here/or attachments (Not needed for the mainly functions)
Have fun with it!!!
Regards,
Shawak
Here a full working and tested VIP System, i hope you like it :thumbup:.
And please don't forget to rep++ me if you like it ^_^.
Credits:
- Idea:
http://otland.net/f82/vip-system-19426/
http://otland.net/f81/updated-vip-system-44805/
- Script:
100% by Shawak (me )
Version:
- Tested on TFS 0.3.5 (If you have TFS 0.3.5pl1 you should use: Vip System v2.0)
- Should work with other TFSs.
New lua functions:
Code:
setPlayerVipDays(cid, days) -- set player XXX Vip days // return days
getPlayerVipDays(cid) -- get player current Vip days left // return days
isPlayerVip(cid) -- check if player is vip // return TRUE (if player is Vip) or FALSE (if player isn't Vip)
doPlayerAddVipDays(cid, days) -- add player vip days // return days
doPlayerRemoveVip(cid) -- remove player Vip and set Vip days to 0 // return TRUE
Script:
- data/lib/function.lua add at the end of the script:
Lua:
--[[
VIP System by Shawak
Tested on TFS 0.3.5
For more informations visit:
[url]http://otland.net/f163/full-working-vip-system-shawak-44840/#post452638[/url]
]]--
vip_storage = 95883
function setPlayerVipDays(cid, days)
return setPlayerStorageValue(cid, vip_storage, (os.time() + 86400 * days)) and days
end
function getPlayerVipDays(cid)
local left, d = (getPlayerStorageValue(cid, vip_storage) - os.time()), 0
while left >= 86400 do
left = left - 86400
d = d+1
end
return d
end
function isPlayerVip(cid)
return getPlayerStorageValue(cid, vip_storage) >= os.time() and TRUE or FALSE
end
function doPlayerAddVipDays(cid, days)
return setPlayerStorageValue(cid, vip_storage, (os.time() + (86400 * getPlayerVipDays(cid)) + (86400 * days))) and days
end
function doPlayerRemoveVip(cid)
return setPlayerStorageValue(cid, vip_storage, 0) and TRUE
end
And finished.
Other:
I also maked talkaction scripts for a GOD / CM / GM:
- data/talkactions/talkactions.xml
Lua:
<!-- VIP -->
<talkaction log="yes" words="!set" access="5" event="script" value="vip/set.lua"/>
<talkaction log="yes" words="!get" access="5" event="script" value="vip/get.lua"/>
<talkaction log="yes" words="!is" access="5" event="script" value="vip/is.lua"/>
<talkaction log="yes" words="!add" access="5" event="script" value="vip/add.lua"/>
<talkaction log="yes" words="!remove" access="5" event="script" value="vip/remove.lua"/>
Lua files for the talkaction scripts, download here:
Here/or attachments (Not needed for the mainly functions)
Have fun with it!!!
Regards,
Shawak
Attachments
-
vip talkactions.rar882 bytes · Views: 425 · VirusTotal
Last edited: