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

AAC Looking for working MYACC ban page TFS 1.2

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
Looking for ban table like this

Banned PlayerCommentBanned ByAddedExpires
PLAYER NAMEBeing a degenerate [GM]DICK18/10/2020, 7:20:4615/11/2020, 7:20:46

ban.php
Completely empty deleted entire code because it just wasnt working so there was no point to have it

ban.lua
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    local split = param:split(",")
   
    local name = split[1]
    local reason = tostring(split[2])
    local bandays = tonumber(split[3])
   
    local accountId = getAccountNumberByPlayerName(name)
    if accountId == 0 then
        player:sendCancelMessage("Usage: /Ban PlayerName, Reason, Days")
        return false
    end

    local resultId = db.storeQuery("SELECT 1 FROM `account_bans` WHERE `account_id` = " .. accountId)
    if resultId ~= false then
        result.free(resultId)
        return false
    end

    local timeNow = os.time()
    db.query("INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES (" ..
            accountId .. ", " .. db.escapeString(reason) .. ", " .. timeNow .. ", " .. timeNow + (bandays * 86400) .. ", " .. player:getGuid() .. ")")

    local target = Player(name)
    if target ~= nil then
        broadcastMessage("" .. split[1] .. " has been banned for" .. split[3] .. " days. Reason:" .. split[2] .. ".",MESSAGE_STATUS_WARNING)
        target:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, name .. " has been banned.")
    end
end

ban table in phpmyadmin
0de62ff35d190fd32eec0470a6112406.png
 
first thanks for your work and support @slaw
I changed bans.php and added bans.twig and functions in functions.php.

before nothing worked, now it shows the table (with nick, expires, added by..) but it doesn't load the bans, the table is empty
could help??
(using nostalrius 7.7 distro)
 
Back
Top