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

Solved Vip tile - level limit acces

therrax

Member
Joined
Jul 12, 2012
Messages
262
Solutions
1
Reaction score
11
Hi.
Information: TFS 1.0

Now only players with VIP can enter
I wish people [ no-vip] having less than 80 level could enter.


Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not VIP!!!")
end
return true
end
 
Last edited:
As far as I understood it you want people below 80 to enter? Okay

Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not VIP!!!")
elseif getPlayerLevel(cid) =~ 80 then
doTeleportThing(cid, toposition, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can pass!")
end
return true
end
 
@DestinationSer look
Code:
[Warning - Event::checkScript] Can not load script: scripts/viptile.lua
data/movements/scripts/viptile.lua:6: 'then' expected near '='

@kikos What you think about that?
 
Last edited by a moderator:
Yes.. :D

Script does not work..I can not go on a 7 level.
No console errors.
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nie jestes VIPem!!!")
elseif getPlayerLevel(cid) < 80 then
doTeleportThing(cid, toposition, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Mozesz przejsc!")
end
return true
end
 
Last edited by a moderator:
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nie jestes VIPem!!!")
else
if getPlayerLevel(cid) < 80 then
doTeleportThing(cid, toposition, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Mozesz przejsc!")
end
end
return true
end
Check this one.
 
try this one, need to go lunch so i did it fast haha ill come back later
Code:
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
if not player then
    return true
end

if getPlayerVipTime(cid) == 0 then
player:teleportTo(fromPosition, false)
player:sendTextMessage(MESSAGE_STATUS_WARNING, 'Nie jestes VIPem!!!')
elseif player:getLevel() < 80 then
player:teleportTo(fromPosition, true)
player:sendTextMessage(MESSAGE_STATUS_WARNING, 'Mozesz przejsc!')
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end
 
This one is gonna work.
@therrax
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not VIP!!!")
elseif getPlayerLevel(cid) ~= 80 then
doTeleportThing(cid, toposition, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can pass!")
end
return true
end
 
This one is gonna work.
@therrax
Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipTime(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doSendMagicEffect(getCreaturePosition(cid),66)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not VIP!!!")
elseif getPlayerLevel(cid) ~= 80 then
doTeleportThing(cid, toposition, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can pass!")
end
return true
end

elseif getPlayerLevel(cid) ~= 80 then

The ~= means "not equal to" so it would read: "If the players' level is not equal to 80 then let them pass. That means even a non-vip level 81 could pass.
 
It's weird... Doesn't work for me :( I cant stand on this, at level 7 :( why? I dont have errors in console. "20:46 You are not VIP!!!" why?
 
Code:
function onStepIn(cid, item, position, fromPosition)
    local player = Player(cid)
    if not player then
        return
    end

    if getPlayerVipTime(cid) == 0 and player:getLevel() < 80 then
        player:teleportTo(fromPosition, true)
        fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You are not VIP!')
        return true
    end

    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Welcome to the VIP Island!')
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    return true
end
 
Back
Top