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

I have the problem of "sender" too...
Here is the error :

[17:42:47.843] [Error - TalkAction Interface]
[17:42:47.843] data/talkactions/scripts/removedays.lua:eek:nSay
[17:42:47.843] Description:
[17:42:47.843] data/talkactions/scripts/removedays.lua:33: attempt to concatenat
e global 'sender' (a nil value)
[17:42:47.843] stack traceback:
[17:42:47.843] data/talkactions/scripts/removedays.lua:33: in function <data/ta
lkactions/scripts/removedays.lua:2>
 
wouldn't it be better to simply use os.time() to store an expiry date on sql? I.E: store on accounts table os.time() + 24*3600*30

then simply compare dates at login and with an onthink() if you want more presition.
 
this fail if the guy gets premmy 1:59 pm ;P and first day removes 2 pm ;C but good script , thanks you. ill use it ;)
 
Can You Make mmm Like When Vip Days Are Over You get Teleported To Temple If You Are Still In Vip Zone??
 
try this, just add in login lua:
Lua:
if getPlayerVipDays(cid) > 0 then
setPlayerStorageValue(cid, 20500, 1)
	
elseif getPlayerStorageValue(cid, 20500) == 1 and getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, getTownTemplePosition(2))
doPlayerSetTown(cid, 2)
setPlayerStorageValue(cid, 20500, -1)
end

this checks if the player has vip days with a storage value if you want to change the temple just edit
Code:
getTownTemplePosition(2)
doPlayerSetTown(cid, 2)
and change for the townid where you want the players get teleport when the vip days over.
 
I'm having some issues

When I add or remove days for someone, I get the following message in server console:

[Error -TalkAction Interface]
data/talkactions/scripts/adddays.lua: onSay
Description:
data/talkactions/scripts/adddays.lua:33: attempt to concatenate global 'sender' <a nil value>
strack traceback:
data/talkactions/scripts/adddays.lua:33: in function <data/talkactions/scripts/adddays.lua:2>

So, the command works. It add vip days, but when I use the command, it appears in default yellow text, everyone can see it, no message like "Oh, you added X days for someone" appears, and the player who I add vipdays also don't get any message

Except from this, the system works perfectly! Im using TFS 0.3.6

BTW: The script above is very useful, but it didn't work here

-- addvips.lua -- line 31~34 (where the bug is)

doAddVipDays(pid, t[1])
doPlayerSendTextMessage(cid, "You have added ".. t[1] .." vip days to ".. t[2])
doPlayerSendTextMessage(pid, sender .." just added you ".. t[1] .." vip days.")
return true
 
After a long time without cheking the thread... Here is another script. xD!:

Thanks Legnak for the script, I just made it work. And thanks to cesar for the idea..

data/creaturescripts/scripts/templeteleport.lua
Lua:
function onLogin(cid)
	if getPlayerVipDays(cid) > 0 then
		setPlayerStorageValue(cid, 20500, 1)
	elseif getPlayerVipDays(cid) == 0 and getPlayerStorageValue(cid, 20500) == 1 then
		doTeleportThing(cid, getPlayerMasterPos(cid))		
		setPlayerStorageValue(cid, 20500, -1)
	end
	return true
end

/data/creaturescripts/creaturescripts.xml
XML:
<event type="login" name="TempleTeleporter" event="script" value="templeteleport.lua"/>

In /data/creaturescripts/scripts/login.lua add this line:
Lua:
registerCreatureEvent(cid, "TempleTeleporter")
 
I got problem with this, using 0.4 TFS (3671)8.54-8.57.
Got this error:
Code:
[Warning - Event::loadScript] Event onTime not found (data/global
events/scripts/daysremover.lua)

globalevents
Code:
<globalevent name="vipdaysremover" time="00:01" event="script" value="daysremover.lua"/>

daysremover
Code:
  --- Script by Kekox
function onTimer()
                 db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
        return true
end


I tested it with changin "time" to "timer" but then I got this error:
Code:
[Error - GlobalEvent::configureEvent] No interval for globalevent
 with name vipdaysremover
[Warning - BaseEvents::loadFromXml] Cannot configure an event
 
I have this erro! Help pls:

[Error - TalkAction Interface]
data/talkactions/scripts/adddays.lua:eek:nSay
Description:
data/lib/functions.lua:13: attempt to call filed 'executeQuery' <a nil value>

stack traceback:
data/lib/functions.lua:13: in function 'doAddVipDays'
data/talkactions/scripts/adddays.lua:31: in function <data/talkactions/scripts/adddays.lua:2>
 
Perdon por hablar en espeñaol pero no hablo bien el ingles.. mi problema es este cuando intento entrar con mi cuenta me salta este error en la consola noc como acomodarlo.

[11/10/2010 20:37:06] Stong flog has logged in.
[11/10/2010 20:37:06] mysql_real_query(): SELECT `vip_time` FROM `accounts` WHERE `name` = '1846776'; - MYSQL ERROR: Unknown column 'vip_time' in 'field list' (1054)
[11/10/2010 20:37:06] mysql_real_query(): SELECT `vip_time` FROM `accounts` WHERE `name` = '1846776'; - MYSQL ERROR: Unknown column 'vip_time' in 'field list' (1054)
[11/10/2010 20:37:06] mysql_real_query(): SELECT `vip_time` FROM `accounts` WHERE `name` = '1846776'; - MYSQL ERROR: Unknown column 'vip_time' in 'field list' (1054)

[11/10/2010 20:37:06] [Error - CreatureScript Interface]
[11/10/2010 20:37:06] data/creaturescripts/scripts/vipcheck.luanLogin
[11/10/2010 20:37:06] Description:
[11/10/2010 20:37:06] data/creaturescripts/scripts/vipcheck.lua:3: attempt to call global 'getPlayerVipDays' (a nil value)
[11/10/2010 20:37:06] stack traceback:
[11/10/2010 20:37:06] data/creaturescripts/scripts/vipcheck.lua:3: in function <data/creaturescripts/scripts/vipcheck.lua:2>
[11/10/2010 20:37:06] Stong flog has logged out.
:(
 
You're not using my vip system... And you didnt follow the tutorial step by step..
 
Back
Top