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

The best VIP system ever! [Action/Movevent/Globalevent]

[12/02/2014 01:15:18] [Error - CreatureScript Interface]
[12/02/2014 01:15:18] data/creaturescripts/scripts/login.lua
[12/02/2014 01:15:18] Description:
[12/02/2014 01:15:18] (luaRegisterCreatureEvent) Creature not found
_____________________________________________________

[12/02/2014 01:15:18] [Error - CreatureScript Interface]
[12/02/2014 01:15:18] data/creaturescripts/scripts/login.lua
[12/02/2014 01:15:18] Description:
[12/02/2014 01:15:18] (luaRegisterCreatureEvent) Creature not found
_____________________________________________________

Please help :(!
 
Hi, how to remove vip days from user?
doRemoveVipDays(cid, days)
[12/02/2014 01:15:18] [Error - CreatureScript Interface]
[12/02/2014 01:15:18] data/creaturescripts/scripts/login.lua
[12/02/2014 01:15:18] Description:
[12/02/2014 01:15:18] (luaRegisterCreatureEvent) Creature not found
_____________________________________________________

[12/02/2014 01:15:18] [Error - CreatureScript Interface]
[12/02/2014 01:15:18] data/creaturescripts/scripts/login.lua
[12/02/2014 01:15:18] Description:
[12/02/2014 01:15:18] (luaRegisterCreatureEvent) Creature not found
_____________________________________________________

Please help :(!
Incase you haven't solved this yet, the registerCreatureEvent line must be inside the function like the other registerCreatureEvent lines.
i already searched... thats the point why im post that or do you think other? i wouldnt post it if i found any other options

so my problem again
im using 3.6
:
when i use: vip medal
[07/02/2014 00:53:12] [Error - Action Interface]
[07/02/2014 00:53:12] data/actions/scripts/vip/vipmedal.lua:eek:nUse
[07/02/2014 00:53:12] Description:
[07/02/2014 00:53:12] data/lib/050-function.lua:776: attempt to call field 'executeQuery' (a nil value)
[07/02/2014 00:53:12] stack traceback:
[07/02/2014 00:53:12] data/lib/050-function.lua:776: in function 'doAddVipDays'
[07/02/2014 00:53:12] data/actions/scripts/vip/vipmedal.lua:6: in function <data/actions/scripts/vip/vipmedal.lua:2>

when i make /adddays
[07/02/2014 00:53:23] [Error - TalkAction Interface]
[07/02/2014 00:53:23] data/talkactions/scripts/adddays.lua:eek:nSay
[07/02/2014 00:53:23] Description:
[07/02/2014 00:53:23] data/lib/050-function.lua:776: attempt to call field 'executeQuery' (a nil value)
[07/02/2014 00:53:23] stack traceback:
[07/02/2014 00:53:23] data/lib/050-function.lua:776: in function 'doAddVipDays'
[07/02/2014 00:53:23] data/talkactions/scripts/adddays.lua:30: in function <data/talkactions/scripts/adddays.lua:1>
http://otland.net/threads/bug-with-vip-system-help.201450/#post-1937119
 
doRemoveVipDays(cid, days)

I want to remove it from players* i allready have doRemoveVipDays. Instead of going to database and set it to** i want to have an fast command like: /removedays "players name (so it removes from whole account)" "Days that will be removed."
 
How to set doRemoveVipDays(cid, days) so that it goes days from player each time they login to the server? So say: Sessions*

I would like in another words make it to sessions instead of days* :)
 
@wikutag

Go to your items.xml

should look like this

Code:
    <item id="5785" article="a" name="Vip Medal">
        <attribute key="weight" value="1000"/>
        <attribute key="writeable" value="1"/>
        <attribute key="maxTextLen" value="128"/>
    </item>

remove these lines

Code:
      <attribute key="writeable" value="1"/>
        <attribute key="maxTextLen" value="128"/>

or change it to 0
 
can someone rewrite this to tfs 1.0?
Code:
function getPlayerVipDays(cid)
local Info = db.storeQuery("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

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

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

I have add it to global.lua (tfs 1.0 functions) tried alot but no result:( it keep saying error line xxx -> local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
after I fixed that it wil give another error for the next line ->if Info:getID() ~= LUA_ERROR then
 
can someone rewrite this to tfs 1.0?
Code:
function getPlayerVipDays(cid)
local Info = db.storeQuery("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

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

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

I have add it to global.lua (tfs 1.0 functions) tried alot but no result:( it keep saying error line xxx -> local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
after I fixed that it wil give another error for the next line ->if Info:getID() ~= LUA_ERROR then
add

ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0
 
can someone rewrite this to tfs 1.0?
Code:
function getPlayerVipDays(cid)
local Info = db.storeQuery("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

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

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

I have add it to global.lua (tfs 1.0 functions) tried alot but no result:( it keep saying error line xxx -> local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
after I fixed that it wil give another error for the next line ->if Info:getID() ~= LUA_ERROR then
Code:
function getPlayerVipDays(cid)
     local Info = db.storeQuery("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. Player(cid):getAccountId() .. " LIMIT 1")
     if Info then
         local days = result.getDataString(Info, 'vipdays')
         result.free(Info)
         return days
     end
     return LUA_ERROR
end
I dont have the folder lib, functions in data
Add to global.lua.
 
@Limos
When I use the medal I get a debug.
Code:
-- 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, 7)
        doCreatureSay(cid, "VIP")
        doPlayerPopupFYI(cid, "We have added 7 vip days to your account!\nEnjoy it!.")
        doRemoveItem(item.uid,1)
    end
return true
end
 
Back
Top