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

VIP Days Remover

kozmo

Member
Joined
Jan 30, 2009
Messages
433
Solutions
2
Reaction score
22
So i finally got VIP added into the server the only issue now is that the script i have seems to not work, It looks like this.

function onTime()
db.query("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
return true
end

And for the XML Part looks like this.

<globalevent name="VipDaysRemover" interval="86395"" event="script" value="daysremover.lua"/>

If someone could help me solve this problem it would be much appreciated thanks.
 
LUA:
function onThink(cid, item, fromPosition, toPosition)
		if getPlayerStorageValue(player,19551) > 1 then
			setPlayerStorageValue(player,19551,getPlayerStorageValue(player) - 1)
		end
	end
end

Try that one, mine has the name "removevipdays" but doesn't really matter.. I believe you know that

XML:
<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>

you could replace the time with a interval, the difference is that interval starts when the server restarts and it can be reset during server crash and so on. (unless the server hasn't saved anything nerby)

Db.query doesn't work with all 8.54 servers, you might need to ad some codes to function.lua..
 
I help he..
and say db.query and Executequery and more..
ontimr to Ontime

He use 9.1, don't know use other version TFS why not works?
 
Thanks for that Glisadgri , but lets get serious here can someone explain this to me a little better..?


- - - Updated - - -

Fixed everything now just need help understanding how to set this "time="00:01" i want it set to 23 hours an hour before globalsave.
 
Thanks for that Glisadgri , but lets get serious here can someone explain this to me a little better..?


- - - Updated - - -

Fixed everything now just need help understanding how to set this "time="00:01" i want it set to 23 hours an hour before globalsave.

Then change it to 23:00?
 
Alright well i should have said this before, i tested it with "Time 00:01" but it still did not take away my VIP Day.
So any thoughts on that?
 
Inster this in
phpmyadmin -> SQL
SQL:
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;

dude, system is for SQL yes you use sqlite not works..
 
Someone now want to explain how to insert this?

ALTER TABLE `accounts` ADD
`vipdays` INT(11) NOT NULL DEFAULT 0;
 
In server 9.1 + no have function onTimer()


try this

daysremover.lua
LUA:
function onThink(interval, lastExecution)
if tostring(os.date("%X")):sub(1, 5) == "00:00" then
db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
end
return true
end

Code:
<globalevent name="VipDaysRemover" interval="60" event="script" value="daysremover.lua"/>


interval="60" -- 1 minuto

your server is mile second?

60000 = 1 minute in ms
 
Alright thanks for everyones help but the one thing no one has yet explained is acutally how to Execute Query
So whoever knows how please let me know.
 
Last edited:
Back
Top