• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

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

Its working perfectly.

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

XML:
<action itemid="2112" event="script" value="vipmedal.lua"/>

Try to put in the correct place
Also, check on your functions if u have
Lua:
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

change it with
Lua:
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

Regards,
H4CK3R
 
XML:
	<item id="116" article="a" name="Vip Medal">
	    <attribute key="description" value="One month of vip if you use it." />
		<attribute key="weight" value="3500" />
	</item>
Actions:
XML:
 <action itemid="116" script="vipmedal.lua"/>

vipmedal.lua
Lua:
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)
            doPlayerPopupFYI(cid, "We have added 30 vip days to your account!\nEnjoy it!.")
            doRemoveItem(item.uid)
         end
        return true
end

functions:
Lua:
function doAddVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vip_time` = `vip_time` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
 
function doRemoveVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vip_time` = `vip_time` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

yeah, my table is "vip_time" cuz i already have it.
 
I'm trying to use your vip system, but an error just keeps coming up:
smth like that a "=" is missing near the doaddplayer...in line 17 or 18 or 19...please help :D
 
Plz This vip Effect Don't work Help
[26/10/2012 07:14:01] data/globalevents/scripts/vipEffect.lua:4: attempt to call global 'getPlayerVipDays' (a nil value)
[26/10/2012 07:14:01] stack traceback:
[26/10/2012 07:14:01] data/globalevents/scripts/vipEffect.lua:4: in function <data/globalevents/scripts/vipEffect.lua:1>
[26/10/2012 07:14:01] [Error - GlobalEvents::think] Couldn't execute event: vipEffect
 
An fucking waste of time.
I always liked to use the normal PACC for "VIP".
But obviously all spells were to FACC :)
 
I have no idea of what I am doing but im trying to add this to [9.60/9.61] The Forgotten Server v0.2.14 (Mystic Spirit) I guess it's not the same "type" of code but it fails at "attempt to call field 'executeQuery' (a nil value)" when trying to add days ingame.
So im guessing that "db.executeQuery" doesn't exist so what is the correct way to call the database on this ot?
Code:
function doAddVipDays(cid, days)
     db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
This fails.
 
Last edited:
lol vip item dont work... i tried using it with vip medal....
 
Last edited:
I get an error that doesn't let me use vip systems?

[07/02/2013 00:46:37] [Error - TalkAction Interface]
[07/02/2013 00:46:37] data/talkactions/scripts/VIP/addvipp.lua:eek:nSay
[07/02/2013 00:46:38] Description:
[07/02/2013 00:46:38] data/talkactions/scripts/VIP/addvipp.lua:13: attempt to index global 'vip' (a nil value)
[07/02/2013 00:46:38] stack traceback:
[07/02/2013 00:46:38] data/talkactions/scripts/VIP/addvipp.lua:13: in function <data/talkactions/scripts/VIP/addvipp.lua:1>

always routes back to attempt to index global vip I have tried your system and a few others why?
 
says that 'vip' dosent exist and the function in addvip.lua dosent work, ill take a look at the system and try to fix it.

edit: i believe part of the system is missing lol
 
And this is with another one but i got this error message also leading back to index global

[07/02/2013 01:00:06] [Error - CreatureScript Interface]
[07/02/2013 01:00:06] data/creaturescripts/scripts/vip.lua:eek:nLogin
[07/02/2013 01:00:06] Description:
[07/02/2013 01:00:06] data/creaturescripts/scripts/vip.lua:4: attempt to index global 'vip' (a nil value)
[07/02/2013 01:00:06] stack traceback:
[07/02/2013 01:00:06] data/creaturescripts/scripts/vip.lua:4: in function <data/creaturescripts/scripts/vip.lua:2>

- - - Updated - - -

I redid all the steps of this one and NOW i am getting this error

[07/02/2013 01:08:02] [Error - Action Interface]
[07/02/2013 01:08:02] buffer:eek:nUse
[07/02/2013 01:08:02] Description:
[07/02/2013 01:08:02] [string "--- Vip functions by Kekox..."]:13: attempt to call field 'query' (a nil value)
[07/02/2013 01:08:02] stack traceback:
[07/02/2013 01:08:02] [string "--- Vip functions by Kekox..."]:13: in function 'doAddVipDays'
[07/02/2013 01:08:02] [string "loadBuffer"]:9: in function <[string "loadBuffer"]:4>
 
Back
Top