nanduzenho
Member
Good morning, I don't know what else to do. My TFS 1.3 doesn't have the premium_ends_at function, so the script when the premium account ends doesn't work, I don't know what else to do. I tried this procedure but was unsuccessful. I would like your help, because without this script I cannot deliver premium to the player.
I opened other threads with other errors in an attempt to solve this one, but I got no response from the community. Please someone help me!
I opened other threads with other errors in an attempt to solve this one, but I got no response from the community. Please someone help me!
LUA:
local TOWN_ID = 2
function onLogin(cid)
local player = Player(cid)
local resultId = db.storeQuery("SELECT `premium_ends_at` FROM `accounts` WHERE `id` = " .. player:getAccountId())
local premiumEnd = false
if resultId ~= false then
premiumEnd = result.getNumber(resultId, "premium_ends_at")
result.free(resultId)
end
if premiumEnd and (os.time() > premiumEnd) and (player:getLastLogout() < premiumEnd) then
local town = Town(TOWN_ID)
player:setTown(town)
local templePosition = town:getTemplePosition()
player:teleportTo(templePosition)
templePosition:sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua premium acabou!")
end
return true
end