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

TFS 1.X+ Premium Account expires (Houses)

what file and part ? can u tell me? for check
You can do this in lua too. In globalevents startup.lua add this before "Check house auctions":
Lua:
    -- Check house owner premium
    local resultId = db.storeQuery("SELECT `id`, `owner` FROM `houses` WHERE NOT `owner` = 0 AND (SELECT `premdays` FROM `accounts` WHERE (SELECT `account_id` FROM `players` WHERE `id` = `owner`) = `id`) = 0")
    if resultId ~= false then
        repeat
            local house = House(result.getDataInt(resultId, "id"))
            if house then
                house:setOwnerGuid(0)
            end
        until not result.next(resultId)
        result.free(resultId)
    end
Untested so let me know how it goes.
 
You can do this in lua too. In globalevents startup.lua add this before "Check house auctions":
Lua:
    -- Check house owner premium
    local resultId = db.storeQuery("SELECT `id`, `owner` FROM `houses` WHERE NOT `owner` = 0 AND (SELECT `premdays` FROM `accounts` WHERE (SELECT `account_id` FROM `players` WHERE `id` = `owner`) = `id`) = 0")
    if resultId ~= false then
        repeat
            local house = House(result.getDataInt(resultId, "id"))
            if house then
                house:setOwnerGuid(0)
            end
        until not result.next(resultId)
        result.free(resultId)
    end
Untested so let me know how it goes.

no sucess :/, player still have a house without premium
 
no sucess :/, player still have a house without premium
Just tested this myself and it does work. Are you sure you placed in right script (data/globalevents/scripts/startup.lua) and add the code BEFORE:
Lua:
    -- Check house auctions
Then verify that the player in questions account table on phpmyadmin under premdays does in fact say 0 and after all this you must restart the server for this script to take effect, you cannot just reload scripts.

If all this does not work then you must have a customized version of tfs 1.x and it would be useful to know which one.
 
Back
Top