Knight God
Member
- Joined
- Oct 19, 2008
- Messages
- 1,180
- Reaction score
- 21
this tile sends you to a zone "x" if you vip , and if you're not sent to another place, as simple as that.
you need to add this to data/lib/050-functions.lua
that's all, if you like, give me a point of reputation.
PHP:
function onStepIn(cid, item, frompos, item2, topos)
local back = {x=1049, y=858, z=15} --Place where non vip is teleported.
local allowed = {x=1025, y=856, z=15} --Place where VIPs are teleported.
currentVip = getPlayerVipDays(cid)
if (currentVip > 0) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You are premium gold, welcome to premium area, seal demon III.")
doSendMagicEffect(getPlayerPosition(cid),29)
doTeleportThing(cid, allowed)
doSendMagicEffect(allowed,10)
else
if getPlayerVipDays(cid) == 0 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Thou shall not pass, this is for premium gold only!.")
doTeleportThing(cid, back)
end
return TRUE
end
end
you need to add this to data/lib/050-functions.lua
PHP:
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
that's all, if you like, give me a point of reputation.
Last edited: