GetBanReason

From Multi Theft Auto: Wiki
Revision as of 10:14, 3 May 2011 by EAi (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function will return the ban reason of the specified ban.

Syntax

string getBanReason ( ban theBan )

Required Arguments

  • theBan: The ban in which you want to return the reason of.

Returns

Returns a string of the reason if everything was successful, false if invalid arguments are specified if there was no reason specified for the 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

See Also