GetBanNick: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 14: | Line 14: | ||
Возвращает ник, если все было правильно, ''Неправильно'' если указаны неверные аргументы , либо не было ника, указанного для запрета элемента [[ban]]. | Возвращает ник, если все было правильно, ''Неправильно'' если указаны неверные аргументы , либо не было ника, указанного для запрета элемента [[ban]]. | ||
== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function outputBan(ban) | function outputBan(ban) | ||
local banned = getBanNick(ban) -- | local banned = getBanNick(ban) -- Get the name of the player who was banned | ||
local banner = getBanAdmin(ban) -- | local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player | ||
local reason = getBanReason(ban) -- | local reason = getBanReason(ban) -- Get the reason the player was banned | ||
outputChatBox("-----BAN-----",getRootElement(),255,0,0) | outputChatBox("-----BAN-----",getRootElement(),255,0,0) | ||
if (banned) then | if (banned) then | ||
outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- | outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- Output the player name who was banned | ||
end | end | ||
if (banner) then | if (banner) then | ||
outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- | outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban | ||
end | end | ||
if (reason) then | if (reason) then | ||
outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- | outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned | ||
end | end | ||
end | end | ||
addEventHandler("onBan",getRootElement(),outputBan) | addEventHandler("onBan",getRootElement(),outputBan) -- When a player is banned trigger the outputBan function | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==См. также== | ==См. также== | ||
{{Admin functions}} | {{Admin functions}} |
Revision as of 17:04, 26 March 2012
Эта функция возвращает ник заблокированного игрока через ban.
Синтаксис
string getBanNick ( ban theBan )
Обязательный аргумент
- theBan: ban элемент, ник которого вы хотите вернуть.
Возвращение
Возвращает ник, если все было правильно, Неправильно если указаны неверные аргументы , либо не было ника, указанного для запрета элемента ban.
Example
function outputBan(ban) local banned = getBanNick(ban) -- Get the name of the player who was banned local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player local reason = getBanReason(ban) -- Get the reason the player was banned outputChatBox("-----BAN-----",getRootElement(),255,0,0) if (banned) then outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- Output the player name who was banned end if (banner) then outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban end if (reason) then outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned end end addEventHandler("onBan",getRootElement(),outputBan) -- When a player is banned trigger the outputBan function
См. также
- addBan
- banPlayer
- getBanAdmin
- getBanIP
- getBanNick
- getBanReason
- getBanSerial
- getBanTime
- getBanUsername
- getBans
- getUnbanTime
- isBan
- kickPlayer
- setBanAdmin
- setBanNick
- setBanReason
- setUnbanTime
- reloadBans
- removeBan