leol
New Member
- Joined
- Apr 2, 2017
- Messages
- 17
- Reaction score
- 0
Hello boys, i'm using this script to auction system (is like a offline trade for 8x/7x servers)
TalkAction - Offline player to player item trader (Auction System).
But after a long time this been a full of trash items/absurd prices to just spam the pages...
So here in forum i found another one thing:
This actually clean the old ones, after 30 days if no one buy...
It's sound perfect, but the part to send item to the owner is not done, so if i try to sell my demon armor to 500k after 31 days if no one buy, its just be destroyed
Anybody know how to send this item back to the owner DP?
A guy named audu said that needed to be on server save because to send items to player depot, the player need to be offline, but onstartup should work, right? because everybody is offline when startup
TalkAction - Offline player to player item trader (Auction System).
But after a long time this been a full of trash items/absurd prices to just spam the pages...
So here in forum i found another one thing:
Code:
function onStartup()
local result = db.getResult("SELECT `id`, `date` FROM `auction_system` ORDER by `date` ASC;")
local days = 30*3600*24
local nowtime = os.date('*t')
if(result:getID() ~= -1) then
while(true)
local id = result:getDataInt("id")
local date = result:getDataInt("date")
local time= os.time(nowtime) - date
local duedate = time - days
if duedate >= 0 then
-- send item back to the owner
-- delete offer
db.executeQuery("DELETE FROM `auction_system` WHERE `id` = '".. id .."';")
end
if not(result:next()) then
break
end
end
end
result:free()
end
This actually clean the old ones, after 30 days if no one buy...
It's sound perfect, but the part to send item to the owner is not done, so if i try to sell my demon armor to 500k after 31 days if no one buy, its just be destroyed
Anybody know how to send this item back to the owner DP?
A guy named audu said that needed to be on server save because to send items to player depot, the player need to be offline, but onstartup should work, right? because everybody is offline when startup
Last edited: