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

MoveEvent Vip Tile

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.

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:
Lua:
local t = {x=1000, y=1000, z=7}
function onStepIn(cid, item, frompos, item2, topos) 
	if getPlayerVipDays(cid) >= 1 then
		doTeleportThing(cid, t)
			else
		doTeleportThing(cid, frompos)
		doPlayerSendTextMessage(cid, 21, "You need atleast 1 vip day to pass!")
	end
return TRUE
end

and
Lua:
function doAddVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
 
function doRemoveVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
is unnecessary.
 
Last edited:
is for using the vip system ¬ ¬

yep:

function doAddVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

function doRemoveVipDays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

is unnecesary XP
 
Back
Top