RU/getBanNick

From Multi Theft Auto: Wiki
Revision as of 18:31, 18 January 2014 by Prime (talk | contribs)
Jump to navigation Jump to search
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 nickname (nickname that the player had when he was banned) of the specified ban element.

Syntax

string getBanNick ( ban theBan )

Required Arguments

  • theBan: The ban element which nickname you want to return.

Returns

Returns a string of the nickname if everything was successfull, false if invalid arguments are specified if there was no nickname specified for the ban element.

Пример

Example 1: This example outputs the name of the player, the admin who banned the player and the reason.

function outputBan(ban)
    local plr = getBanNick(ban) -- the player who got banned
    local admin = getBanAdmin(ban) -- admin who banned the player
    local reason = getBanReason(ban) -- reason for banning
    if (plr and admin and reason) then
        outputChatBox(plr.." has been banned by "..admin.." for "..reason, getRootElement(), 255, 0, 0) -- Outputs name of the player, admin and the reason for banning
    end
end
addEventHandler("onBan", getRootElement(), outputBan) -- When a player is banned trigger the outputBan function

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