OnUnban: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Fixed incorrect onUnban parameters)
No edit summary
Line 11: Line 11:


==Source==
==Source==
The [[event system#Event source|source]] of this event is the [[element]] that was responsible for the unbanning. If no responsible was specified, the source is the global root element.
The source is always the global root element.


==Cancel effect==
==Cancel effect==

Revision as of 05:18, 16 March 2012

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

Parameters

ban theBan
  • theBan : The ban that will be removed.

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 )
	if getElementType( source ) then --Check if a player unbanned the IP/Serial
		outputChatBox( getPlayerName( source ) .. " 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'

See Also

Server events


Event functions