RU/getBanSerial: 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 serial of the specified ban pointer. ==Syntax== <syntaxhighlight lang="lua"> string getBanSerial ( ban theBan ) </syntaxhighlight> ===Requi...
 
Prime (talk | contribs)
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">
--TODO
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
)
</syntaxhighlight>
</syntaxhighlight>


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

Revision as of 18:44, 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 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

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 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