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

Help With VipTile Script

pedromaluko

New Member
Joined
Apr 14, 2009
Messages
21
Reaction score
2
I have this script:

function onStepIn(cid, item, position, fromPosition)

local tileConfig = {
kickPos = fromPosition,
kickEffect = CONST_ME_POFF,
kickMsg = "You need to be a vip player to access this area.",
enterMsg = "Welcome to vip area. Enjoy!",
enterEffect = CONST_ME_MAGIC_BLUE,
vipStorage = 13540,
}

if(getPlayerStorageValue(cid, tileConfig.vipStorage) <= 0) then
doTeleportThing(cid, tileConfig.kickPos)
doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect)
doPlayerSendCancel(cid, tileConfig.kickMsg)
return
end

doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg)
doSendMagicEffect(position, tileConfig.enterEffect)
return true
end

Is a Premium Tile, but no one can pass, or the premiums, how to fix?
 
And you are sure that for the player the storage is set in the database to 1?


Try this btw:
Lua:
function onStepIn(cid, item, position, fromPosition)

local tileConfig = {
kickPos = fromPosition,
kickEffect = CONST_ME_POFF,
kickMsg = "You need to be a vip player to access this area.",
enterMsg = "Welcome to vip area. Enjoy!",
enterEffect = CONST_ME_MAGIC_BLUE,
vipStorage = 13540,
}

if(getPlayerStorageValue(cid, tileConfig.vipStorage) <= 0) then
doTeleportThing(cid, tileConfig.kickPos)
doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect)
doPlayerSendCancel(cid, tileConfig.kickMsg)
return true
end

doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg)
doSendMagicEffect(position, tileConfig.enterEffect)
return true
end
 
Lua:
function onStepIn(cid, item, position, fromPosition)
	if(isPremium(cid)) then
		doPlayerSendTextMessage(cid, 21, "Welcome premium member!")
	else
		doTeleportThing(cid, fromPosition)
	end
		doSendMagicEffect(getPlayerPosition(cid), 37)
	return true
end
 
What do you want to add as config?

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

        local msg = Welcome premium member! -- Msg when you enter
        local msg2 = You are not premium -- Msg if you're not prem

 if(isPremium(cid)) then
                doPlayerSendTextMessage(cid, 21, ..msg..)
        else
                doTeleportThing(cid, fromPosition)
                doPlayerSendTextMessage(cid, 21, ..msg2..)
        end
                doSendMagicEffect(getPlayerPosition(cid), 37)
        return true
end

maybe? xD
 
Code:
local CFG = {
		PREM_MSG = "Welcome premium member!",
		NOT_PREM_MSG = "Only players with premium account can pass."
		}
function onStepIn(cid, item, position, fromPosition)
	if isPremium(cid) then
		doPlayerSendTextMessage(cid, 21, CFG.PREM_MSG)
	else
		doTeleportThing(cid, fromPosition)
		doPlayerSendCancel(cid, CFG.NOT_PREM_MSG)
	end
	doSendMagicEffect(getPlayerPosition(cid), 37)
	return true
end
 
Shorter xDDD not tested
Lua:
function onStepIn(cid, item, itemEx, position, fromPosition)
local config = { error_msg = "You are not a VIP member!", enter = "Welcome in!" }
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, isPremium(cid) and enter or error_msg)
		doTeleportThing(cid, isPremium(cid) == false and fromPosition)
		doSendMagicEffect(getPlayerPosition(cid), isPremium(cid) and 37 or 2)
	return true
end
 
Last edited:
Hi, i have the same script but my vip system is by account, not player and i think this script checks for the vip of the player not the account, and then no one can pass even being vip, does anyone know a way to change it so it checks your vip by the account?
Thanks.
 
Back
Top