RU/getUnbanTime: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Enterprise (talk | contribs)
New page: {{Translate}} {{Server function}} This function will return the unbanning time of the specified ban pointer in '''seconds'''. ==Syntax== <syntaxhighlight lang="lua"> int getUnbanTime ( ban theBan )...
 
Prime (talk | contribs)
No edit summary
Line 16: Line 16:


==Example==
==Example==
'''Example 1:''' This example lists all the ban when someone types /listban.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
addCommandHandler("listban",
function()
    local allBans = getBans() --get all the bans
    for i,v in ipairs(bans)do
        local nick = getBanNick(v)
        local unbanTime= getUnbanTime(v) -- time to get unban
        outputChatBox("Ban #".. i ..": "..nick.." . Time to get unban "..unbanTime, source, 255, 0, 0) -- lists all the ban
    end
end
)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{RU/Admin functions}}
{{RU/Admin functions}}
[[Category:Needs Example]]
[[en:getUnbanTime]]
[[en:getUnbanTime]]

Revision as of 18:40, 18 January 2014

This page requires local translation. If page will remain not translated in reasonable period of time it would be deleted.
After translating the page completely, please remove the ‎{{translate}}‎ tag from the page.

This function will return the unbanning time of the specified ban pointer in seconds.

Syntax

int getUnbanTime ( ban theBan )

Required Arguments

  • theBan: The ban in which you wish to retrieve the unban time of.

Returns

  • Returns an integer of the unbanning time in the format of seconds from the year 1970. Use in conjunction with getRealTime in order to retrieve detailed information.
  • Returns false if invalid arguments are specified or if there was no unbanning time specified for the ban.

Example

Example 1: This example lists all the ban when someone types /listban.

addCommandHandler("listban",
function()
    local allBans = getBans() --get all the bans
    for i,v in ipairs(bans)do
        local nick = getBanNick(v)
        local unbanTime= getUnbanTime(v) -- time to get unban
        outputChatBox("Ban #".. i ..": "..nick.." . Time to get unban "..unbanTime, source, 255, 0, 0) -- lists all the ban
    end
end
)

See Also

Серверные функции

  • addBan — блокирует доступ по серийному номеру, IP адресу и / или нику
  • banPlayer — блокирует указанного игрока по серийному номеру, IP адресу и / или нику
  • getBanAdmin — возвращает ник администратора, ответственного за указанную блокировку
  • getBanIP — возвращает заблокированный IP адрес для указанной блокировки
  • getBanNick — возвращает ник заблокированного игрока для указанной блокировки
  • getBanReason — возвращает причину выдачи для указанной блокировки
  • getBans — возвращает таблицу выданных блокировок
  • getBanSerial — возвращает заблокированный серийный номер для указанной блокировки
  • getBanTime — возвращает время в секундах, прошедшее от 1.01.1970 до момента выдачи указанной блокировки
  • getBanUsername — возвращает ник заблокированного игрока для указанной блокировки (устарела)
  • getUnbanTime — возвращает время в секундах, прошедшее от 1.01.1970 до момента снятия указанной блокировки
  • isBan — проверка значение на соответствие типу ban
  • kickPlayer — исключает указанного игрока из игры
  • setBanAdmin — изменяет никнейм ответственного за блокировку администратора
  • setBanNick — изменяет никнейм игрока для указанной блокировки
  • setBanReason — изменяет причину указанной блокировки
  • setUnbanTime — изменяет время разблокировки для указанного игрока
  • removeBan — удаляет указанную блокировку
  • reloadBans — обновление данных о выданных блокировках из файла banlist.xml