ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getUnbanTime

Function

getUnbanTime

ServerAdministration and bansIdentical to MTA:SA

Returns when the ban expires, in seconds since 1970. A permanent ban returns false.

Syntax

int getUnbanTime(ban ban)

Arguments

banban
The ban handle.

Returns

The expiry time, or false for a permanent ban.

Example

for _, ban in ipairs(getBans()) do
    local untilTime = getUnbanTime(ban)
    if untilTime then
        local left = untilTime - getRealTime().timestamp
        print(tostring(getBanNick(ban)) .. ": zostało " .. math.ceil(left / 3600) .. " h")
    else
        print(tostring(getBanNick(ban)) .. ": na zawsze")
    end
end

See also