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

Lua Trying to enter a vipdoor, something is terribly wrong.

Rickolajten

Member
Joined
Jul 21, 2008
Messages
175
Reaction score
16
Hey guys!

I downloaded Amirislos distribution and i'm playing around with it, trying to learn a thing or two.

When i try to access the vipdoor that is located in the middle of the map i'm getting this in my console

mkgdxy.png


I'm getting as far as i need a column called vipdays in my myphpadmin, how do i get it there and will it be compatible with the rest of my server?

I don't know if this is needed, but this is the vipdoor.lua

Code:
function onUse(cid, item, frompos, item2, topos)
        if getPlayerVipDays(cid) >= 1 then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
              if pos.y < topos.y then
                  pos.y = topos.y + 1
              else
                  pos.y = topos.y - 1
              end
            elseif pos.y == topos.y then
                  if pos.x < topos.x then
                      pos.x = topos.x + 1
                  else
                      pos.x = topos.x - 1
                  end
            else
                doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
            return true
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
        else
            doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
        end
        return true
end
 
you've to add your own function in you lib/functions.lua
something like this

Code:
function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end


so you can make it for vip like this
Code:
[CODE]function getPlayerVipDays(cid)
vip = getPlayerStorageValue(cid,storage number)
if vip < 0 then
vip = 0
end
return vip
end
[/CODE]


understand?
 
you've to add your own function in you lib/functions.lua
something like this

Code:
function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end


so you can make it for vip like this
Code:
[CODE]function getPlayerVipDays(cid)
vip = getPlayerStorageValue(cid,storage number)
if vip < 0 then
vip = 0
end
return vip
end
[/CODE]


understand?
I think so, thanks!
 
Back
Top