vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, i have problem:
I got this script from brazil datapack, but im sure in 100% i copy all files.
Globalevents:
SUPERUP:freeCave function:
I got this script from brazil datapack, but im sure in 100% i copy all files.
Globalevents:
Code:
function onThink(interval)
local ricardoViado = SUPERUP:freeCave()
for _, b in pairs(ricardoViado) do
if os.time() >= b[2] then
db.query(string.format("UPDATE exclusive_hunts SET `guid_player` = %d, `time` = %s, `to_time` = %s WHERE `hunt_id` = %d", 0, 0, 0, b[1]))
end
end
return true
end
SUPERUP:freeCave function:
Code:
function SUPERUP:freeCave()
freeCaves = {}
local db = db.storeQuery("SELECT `hunt_id`, `to_time`, `guid_player` FROM exclusive_hunts")
if not db then
return
end
repeat
local idHunt = result.getDataInt(db, "hunt_id")
local tempoFinal = result.getDataLong(db, "to_time")
local guidPlayer = result.getDataInt(db, "guid_player")
result.free(db)
table.insert(freeCaves, {idHunt, tempoFinal, guidPlayer})
until not result.next(db)
return freeCaves
end