RU/getBanSerial: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:


==Example==
==Example==
'''Example 1:''' This example lists all the ban when someone types /listban.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler("listban",
addCommandHandler("listban",

Revision as of 18:44, 18 January 2014

Warning.png 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 serial of the specified ban pointer.

Syntax

string getBanSerial ( ban theBan )

Required Arguments

  • theBan: The ban you want to retrieve the serial of.

Returns

Returns a string of the serial if everything was successful, false if invalid arguments are specified or if there was no serial specified for the ban.

Example

addCommandHandler("listban",
function()
    local allBans = getBans() --get all the bans
    for i,v in ipairs(bans)do
        local nick = getBanNick(v)
        local serial= getBanSerial(v) -- gets the serial
        outputChatBox("Ban #".. i ..": "..nick.." . Serial "..serial, 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