OnUnban: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
This event is triggered when a ban is removed from the server.
This event is triggered when a ban is removed from the server.


if the ban was removed using function removeBan(), responsibleElement will be nil.
if the ban was removed using function [[removeBan]], responsibleElement will be nil.


==Parameters==
==Parameters==

Revision as of 15:45, 16 June 2012

This event is triggered when a ban is removed from the server.

if the ban was removed using function removeBan, responsibleElement will be nil.

Parameters

ban theBan, player responsibleElement
  • theBan : The ban that will be removed.
  • responsibleElement: The player who removed the ban, otherwise return nil.

Source

The source is always the global root element.

Cancel effect

If this event is canceled, the requested unban is not performed.

Example

This example does...

root = getRootElement()

function announceUnban( theBan, responsibleElement )
	if getElementType( responsibleElement ) then --Check if a player unbanned the IP/Serial
		outputChatBox( getPlayerName( responsibleElement ) .. " unbanned " .. ( getBanSerial(theBan) or getBanIP(theBan) ) ) --Output to the chatbox saying the player has unbanned the IP/Serial
	end
end

addEventHandler( "onUnban", root, announceUnban ) --Adds the event handler for 'onUnban'

Changelog

Version Description
1.3.0-9.03908 Fixed/added responsible element parameter

See Also

Server events


Event functions