RU/getBans: 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 a table over all the ban values in the server. ==Syntax== <syntaxhighlight lang="lua"> table getBans () </syntaxhighlight> ===Returns=== Returns a ...
 
Prime (talk | contribs)
No edit summary
Line 12: Line 12:


==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)
        outputChatBox("Ban #".. i ..": "..nick, 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:getBans]]
[[en:getBans]]

Revision as of 18:22, 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 a table over all the ban values in the server.

Syntax

table getBans ()

Returns

Returns a table over all the ban pointers.

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)
        outputChatBox("Ban #".. i ..": "..nick, 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