• 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!

Simple VIP System tfs 1.1

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Hello guys,

Today i'm gonna share my simple vip system. I need it for my self so i'm gonna share for everyone :)


VIP ITEM (you can change by yourself)

actions:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)


local viptimestorage = 15001
local itemid = 11754
local vipdays = 10
local left = os.date("%d", player:getStorageValue(viptimestorage) - os.time())

if player:getItemCount(itemid) == 0 then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You don't have an item.")
elseif player:getStorageValue(viptimestorage) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You still have " .. left .. " VIP Days.")
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "Congratulations! You got VIP " .. vipdays .. " days.")
player:setStorageValue(viptimestorage, os.time() + vipdays * 60 * 60 * 24)
doRemoveItem(item.uid, 1)
end
return true
end


Thats it :)


You can put everywhere you want. On movements on talkactions everywhere.

Small eg:
VIP TILE:

Code:
function onStepIn(cid, item, position, lastPosition)

local portal = {x = 32353, y = 32219, z = 7}
local viptimestorage = 15001
local player = Player(cid)


if (player:getStorageValue(viptimestorage) <= os.time()) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have VIP priviliges. You can buy VIP doll from website.")
else
doTeleportThing(player, portal)
doSendMagicEffect(portal, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been teleported!!")
end

return true
end

Vip time finishing automatically.
 
Last edited:
The Item Vip its OK ...
now the Title dont work =(
I Use tfs 1.1
look error in Distro:


[Warning - Event::checkScript] Can not load script: scripts/viptitle.lua
data/movements/scripts/viptitle.lua:4: unexpected symbol near 'local'

line 4 its:
local viptimestorage = 15001

Because error ?
 
Last edited:
local portal = {x = 32353, y = 32219, z = 7},

should be
local portal = {x = 32353, y = 32219, z = 7}

small mistake
 
I thank worked on mi 1.1 server :)
I wonder if you can put vip agrege all chart in the acc tnx
 
Put the script on action folder.
Code:
<action uniqueid="id" script="other/vip.lua" />


vip.lua code:
Code:
function onUse(cid,item, fromPosition, target, toPosition, isHotkey)

local portal = {x = 32353, y = 32219, z = 7}
local viptimestorage = 15001
local player = Player(cid)


if (player:getStorageValue(viptimestorage) <= os.time()) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have VIP priviliges. You can buy VIP doll from website.")
else
doTeleportThing(player, portal)
doSendMagicEffect(portal, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have been teleported!!")
end

return true
end

Here you are.
 
Back
Top