RU/GetBanNick: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Redirected page to RU/getBanNick)
 
Line 1: Line 1:
{{Translate}}
#REDIRECT [[RU/getBanNick]]
__NOTOC__
{{Server function}}
This function will return the nickname (nickname that the player had when he was banned) of the specified [[ban]] element.
 
==Syntax==
<syntaxhighlight lang="lua">
string getBanNick ( ban theBan )
</syntaxhighlight>
 
===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. 
<syntaxhighlight lang="lua">
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
</syntaxhighlight>
 
==See Also==
{{Admin functions}}
[[en:getBanNick]]

Latest revision as of 16:25, 10 September 2014

Redirect to: