SetBanReason

From Multi Theft Auto: Wiki
Revision as of 15:17, 23 July 2014 by Soner Sayakci (talk | contribs)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.4 :

This function set a new reason in the ban.


Syntax

bool setBanReason( ban theBan, string theReason )

Required Arguments

  • theBan: The ban in which you wish to retrieve the username of.
  • theReason: the new reason (max 60 characters)

Returns

Returns true when is changed, false otherwise.

Example

function setreason (player,cmd,name,...)
	local reason = table.concat({...}," ")
	if name and reason then
		local bans = getBans()
		for i,v in ipairs(bans)do
			if getBanNick(v) == name then
				setBanReason(v,reason)
				outputChatBox("Successfully edited the new Ban Reason.")
			end
		end
	end
end
addCommandHandler("setreason",setreason)

See Also