RU/getBansXML: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Enterprise (talk | contribs)
New page: {{Translate}} {{Server function}} {{Deprecated}} This function retrieves the root xmlnode of the ban file (server/mods/deathmatch/banlist.xml). ==Syntax== <syntaxhighlight lang="lua"> xmlnode getBa...
 
Strix (talk | contribs)
mNo edit summary
Line 1: Line 1:
{{Translate}}
{{Translate}}
{{Server function}}
{{RU/Server function}}
{{Deprecated}}
{{Deprecated}}
This function retrieves the root [[xmlnode]] of the ban file (server/mods/deathmatch/banlist.xml).
This function retrieves the root [[xmlnode]] of the ban file (server/mods/deathmatch/banlist.xml).

Revision as of 20:04, 29 September 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 is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.

This function retrieves the root xmlnode of the ban file (server/mods/deathmatch/banlist.xml).

Syntax

xmlnode getBansXML ()

Returns

Returns a xmlnode, false if something went wrong.

Example

This example prints the amount of bans in the banfile to the chat when player uses command banamount.

function tellPlayerBanAmount ( thePlayer )
    local bansNode = getBansXML () -- get the root node of ban file
    local children = xmlNodeGetChildren ( bansNode ) -- get the children (bans) of the root xml node
    outputChatBox ( "There are " .. #children .. " bans in the ban file.", thePlayer ) -- print the size of children table to the chat
end
addCommandHandler ( "banamount", tellPlayerBanAmount )

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