• 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 Vip Access - Vip Medal - Need some Help !

cremes

New Member
Joined
Oct 12, 2012
Messages
69
Reaction score
2
Hi,

I got MoonOts v3. There is Vip Acces. looks like Vip Medal, and its work, but... its for ever.
So i try to do Vip Medal for 30, 15, 5 days, its work but... its dont work with Vip Door and Vip Floor.
I dont know why >.< if some1 Can help me. Rep ++

vipaccess.lua
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 5785 then
if (getPlayerStorageValue(cid,21444) < 1) then
local playerpos = getCreaturePosition(cid)
doRemoveItem(item.uid,5785)
setPlayerStorageValue(cid,21444,1)

doSendMagicEffect(playerpos, 29)
doCreatureSay(cid, "Gratulacje! Teraz jestes posiadaczem VIP Access!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Posiadasz juz VIP access.", TALKTYPE_ORANGE_1)
end
end
end

vipmedal.lua
-- Vip medal by Kekox
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 30)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 30 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end

vipdoor.lua
function onUse(cid, item, frompos, item2, topos)
viparea = {x=1137, y=812, z=6}
gracz = getCreaturePosition(cid)

if (getPlayerStorageValue(cid,21444) > 0) or (getPlayerLevel(cid) < 250) then
doTeleportThing(cid, viparea)
doSendMagicEffect(gracz,2)
doSendMagicEffect(viparea,10)
else
doPlayerSendCancel(cid, "Nie masz VIP Access.")
doSendMagicEffect(gracz,2)
end
return true
end

vipdoor.lua
function onUse(cid, item, frompos, item2, topos)
local storageValue = 21444
vipstatus = getPlayerStorageValue(cid,storageValue)
if vipstatus == 1 then
doTransformItem(item.uid, item.itemid + 1)
playerpos = getPlayerPosition(cid)
doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}
if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 0)
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then
doMoveCreature(cid, 1)
elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 2)
doMoveCreature(cid, 2)
elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then
doMoveCreature(cid, 3)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 4)
doMoveCreature(cid, 2)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 5)
doMoveCreature(cid, 2)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 6)
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 7)
doMoveCreature(cid, 0)
end
else
doCreatureSay(cid, "Nie posiadasz VIPa.", TALKTYPE_ORANGE_1)
end
return 1
end

i dont know why but i have 2 script vipdoor.lua ; )

My actions.xml is too long so i dont show it this.

Please help me. really need it.
 
the main issue is that your scripts are using on storage values, and your vip medal is using vip feature by days lmao xD, let me fix it...
Hi,

I got MoonOts v3. There is Vip Acces. looks like Vip Medal, and its work, but... its for ever.
So i try to do Vip Medal for 30, 15, 5 days, its work but... its dont work with Vip Door and Vip Floor.
I dont know why >.< if some1 Can help me. Rep ++

vipaccess.lua


vipmedal.lua


vipdoor.lua


vipdoor.lua


i dont know why but i have 2 script vipdoor.lua ; )

My actions.xml is too long so i dont show it this.

Please help me. really need it.

- - - Updated - - -

use this vip door...

function onUse(cid, item, frompos, item2, topos)
viparea = {x=1137, y=812, z=6}
gracz = getCreaturePosition(cid)

if (if getPlayerVipDays(cid) <= 1 or (getPlayerLevel(cid) < 250) then
doTeleportThing(cid, viparea)
doSendMagicEffect(gracz,2)
doSendMagicEffect(viparea,10)
else
doPlayerSendCancel(cid, "Nie masz VIP Access.")
doSendMagicEffect(gracz,2)
end
return true
end

as i been reading so far, the vip acces is like another vip medal? dont use that one(vipacces.lua), you dont need it...

just keep the vip medal script
 
fixed the second door.lua script...

function onUse(cid, item, frompos, item2, topos)
if getPlayerVipDays(cid) <= 1 then
doTransformItem(item.uid, item.itemid + 1)
playerpos = getPlayerPosition(cid)
doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}
if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 0)
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then
doMoveCreature(cid, 1)
elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 2)
doMoveCreature(cid, 2)
elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then
doMoveCreature(cid, 3)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 4)
doMoveCreature(cid, 2)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 5)
doMoveCreature(cid, 2)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 6)
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 7)
doMoveCreature(cid, 0)
end
else
doCreatureSay(cid, "Nie posiadasz VIPa.", TALKTYPE_ORANGE_1)
end
return 1
end
 
btw maybe u know what is that "exp access" its a like vip medal but it for new area for exp .. can possible do it work like vip medal ? without exp access scroll ?

expaccess.lua
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 10138 then
if (getPlayerStorageValue(cid,21446) < 1) then
local playerpos = getCreaturePosition(cid)
doRemoveItem(item.uid,10138)
setPlayerStorageValue(cid,21446,1)

doSendMagicEffect(playerpos, 52)
doCreatureSay(cid, "Gratulacje! Zyskujesz dostep do kilku nowych expowisk!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Posiadasz juz EXP Access.", TALKTYPE_ORANGE_1)
end
end
end
 
you mean that if you are vip... u can enter that zone 2? yeah i can do that but i need that expaccesdoor.lua not the expacces.lua....

be a little more specific on what you need and we can work this out..

btw maybe u know what is that "exp access" its a like vip medal but it for new area for exp .. can possible do it work like vip medal ? without exp access scroll ?

expaccess.lua
 
this

vipdoor.lua
function onUse(cid, item, frompos, item2, topos)
viparea = {x=1137, y=812, z=6}
gracz = getCreaturePosition(cid)

if (if getPlayerVipDays(cid) <= 1 or (getPlayerLevel(cid) < 250) then
doTeleportThing(cid, viparea)
doSendMagicEffect(gracz,2)
doSendMagicEffect(viparea,10)
else
doPlayerSendCancel(cid, "Nie masz VIP Access.")
doSendMagicEffect(gracz,2)
end
return true
end

doesn't work with vipmedal.lua

In this datapack are vipaccess.lua and vipdoor.lua (second script)

maybe that dont work.

can u do vipdoor.lua (second script - this longer) for vipmedal ? its real ?
 
use this one vipdoor.lua (its better, trust me)

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

and add this on actions.xml

<action actionid="2112" event="script" value="vipdoor.lua"/>

then, open your map editor and go to the door that you want to work with the script, right click it, click properties and set the door's action id to 2112.

save the map, restart your server and you will have your door working with your vip medal script...
 
ok dude its work ^^ you are sooo good.

the second script that u fix "vipdoor.lua" work with vip medal : ) ill give that much rep+ how i can ^^

btw i delate this expacces.lua , its a vip medal but from quest.

and... how i can do few vip medals ? like 3 , 5 and 7 days ?

i do vip medal with this tutorial.

http://otland.net/f163/best-vip-system-ever-action-movevent-globalevent-71638/

and i dont see how long i have vip yet. it does work when i log in acc. look at the url.

on actions.xml i have this

<action actionid="2075" script="vip/vipdoor.lua"/>
<action actionid="3480" script="vipdoor.lua" />
 
you will have to find another items to use the 3 scripts for 3,7,15 vip days btw..

oh and you will only be able to see your vip days by logging in one of your accounts characters, to display the vip days on your character screen its way way way more complicated...

here goes the scripts for the medals
7 vip days medal
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 7)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 7 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end

15 vip days medal...

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 15)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 15 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end

3 vip days medal...
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVipDays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddVipDays(cid, 3)
doCreatureSay(cid, "VIP")
doPlayerPopupFYI(cid, "We have added 3 vip days to your account!\nEnjoy it!.")
doRemoveItem(item.uid)
end
return true
end
 
on actions.xml it must be look like this ? :

<action itemid="5785" script="vipmedal3.lua" />
<action itemid="5785" script="vipmedal5.lua" />
<action itemid="5785" script="vipmedal7.lua" />
??

then it look like vip medal but other work right ?

i do it all like in this : http://otland.net/f163/best-vip-system-ever-action-movevent-globalevent-71638/
and Kekox write it work.
i mean i wanna have this :
If you have more than or just 1 vip day, when you login you'll get a message: 2yyuyq0.png
i dont have this message... or maybe u know how do it in acc maker ?
 
nope you cant use the same item id to work with the 3 scripts, its always 1 script per item :S

you will have to find 3 different items to use the scripts. =/.


about the vip days display, you have to add this on data/creaturescripts/scripts/ with the name of vipcheck.lua

--- Script by Kekox
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
end
return true
end

and add this at data/creaturescripts/creaturescripts.xml

<event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>

and add this line at your data/creaturescripts/scripts/login.lua

registerCreatureEvent(cid, "VipCheck")
 
i have it all and it not display..

its my login.lua
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

registerCreatureEvent(cid, "levelpoints")
registerCreatureEvent(cid, "bottrophy")
registerCreatureEvent(cid, "advbr")
registerCreatureEvent(cid, "logowanie")
registerCreatureEvent(cid, "supportlogin")
registerCreatureEvent(cid, "freepoints")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "5cc")
registerCreatureEvent(cid, "10cc")
registerCreatureEvent(cid, "remover")
registerCreatureEvent(cid, "firstpoints")
registerCreatureEvent(cid, "lvlitems")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "VipCheck")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "KilledMonstersCounter")
registerCreatureEvent(cid, "Advance")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
return true
end
 
creaturescripts.xml
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

<!-- NOWE - INNE -->
<event type="kill" name="KilledMonstersCounter" event="script" value="counter.lua"/>
<event type="advance" name="Advance" event="script" value="advance.lua"/>
<event type="advance" name="levelpoints" event="script" value="levelpoints.lua"/>
<event type="login" name="logowanie" event="script" value="logowanie.lua"/>
<event type="login" name="VipCheck" event="script" value="podstawowe/vipcheck.lua"/>
<!-- <event type="login" name="firstpoints" event="script" value="firstpoints.lua"/> -->
<event type="advance" name="freepoints" event="script" value="freepoints.lua"/>

<!-- LVL I START ITEMS -->
<event type="advance" name="5cc" event="script" value="items/lvlitems2.lua"/>
<event type="advance" name="10cc" event="script" value="items/lvlitems2.lua"/>
<event type="advance" name="remover" event="script" value="items/lvlitems2.lua"/>
<event type="advance" name="bottrophy" event="script" value="items/lvlitems2.lua"/>
<event type="advance" name="lvlitems" event="script" value="items/lvlitems.lua"/>
<event type="login" name="FirstItems" event="script" value="items/firstitems.lua"/>

<!-- GUILD EVENTS -->
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>

<!-- BROADCAST -->
<event type="advance" name="advbr" event="script" value="broadcast/advbroadcast.lua"/>
<event type="login" name="supportlogin" event="script" value="broadcast/supportlogin.lua"/>

<!-- PODSTAWOWE -->
<event type="receivemail" name="Mail" event="script" value="podstawowe/mail.lua"/>
<event type="reportbug" name="SaveReportBug" script="podstawowe/reportbug.lua"/>
<event type="login" name="PlayerLogin" event="script" value="podstawowe/login.lua"/>
<event type="logout" name="demonOakLogout" event="script" value="podstawowe/demonOakLogout.lua"/>
<event type="death" name="demonOakDeath" event="script" value="podstawowe/demonOakDeath.lua"/>
<event type="death" name="inquisitionPortals" script="podstawowe/inquisitionPortals.lua"/>
<event type="advance" name="AdvanceSave" event="script" value="podstawowe/advancesave.lua"/>
<event type="think" name="Idle" event="script" value="podstawowe/idle.lua"/>
<event type="think" name="SkullCheck" event="script" value="podstawowe/skullcheck.lua"/>

</creaturescripts>
 
yes im sure : )

ohh in data/lib/function.lua

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

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

i change db.executeQuery for db.escapeString cuz i have error in my ots..
but i change it like in "Init.lua" and when i change it, i cant log in on my char in ots.
so in Init.lua i must be stay on db.executeQuery

when i change it on Init.lua for db.executeQuery

[22/10/2012 02:15:49] [Error - GlobalEvent Interface]
[22/10/2012 02:15:49] data/globalevents/scripts/init.lua:eek:nStartup
[22/10/2012 02:15:49] Description:
[22/10/2012 02:15:49] data/globalevents/scripts/init.lua:9: attempt to call field 'executequery' (a nil value)
[22/10/2012 02:15:49] stack traceback:
[22/10/2012 02:15:49] data/globalevents/scripts/init.lua:9: in function <data/globalevents/scripts/init.lua:8>
this is btw only. nobody can help me about it ^^

butt. now i change db.escapeString for db.executeQuery in data/lib/function.lua and i dont have error.. its so weird..
 
Last edited:
yep i do that.

btw now when i want to use vipmedal

[22/10/2012 02:21:02] [Error - Action Interface]
[22/10/2012 02:21:02] data/actions/scripts/vipmedal3.lua:eek:nUse
[22/10/2012 02:21:02] Description:
[22/10/2012 02:21:02] data/lib/050-function.lua:13: attempt to call field 'executeQuery' (a nil value)
[22/10/2012 02:21:02] stack traceback:
[22/10/2012 02:21:02] data/lib/050-function.lua:13: in function 'doAddVipDays'
[22/10/2012 02:21:02] data/actions/scripts/vipmedal3.lua:6: in function <data/actions/scripts/vipmedal3.lua:2>

i change db.escapeString on db.executeQuery... i dont know why this stupid db.executeQuery give me error in my ots...

u know when i change :

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

on this

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

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

vips medal work, but i dont see how much i have te vip...
 
Last edited:
Back
Top Bottom