OnUnban: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
root = getRootElement() | root = getRootElement() | ||
function announceUnban( theBan ) | function announceUnban( theBan, responsibleElement ) | ||
if getElementType( | if getElementType( responsibleElement ) then --Check if a player unbanned the IP/Serial | ||
outputChatBox( getPlayerName( | outputChatBox( getPlayerName( responsibleElement ) .. " unbanned " .. ( getBanSerial(theBan) or getBanIP(theBan) ) ) --Output to the chatbox saying the player has unbanned the IP/Serial | ||
end | end | ||
end | end |
Revision as of 05:21, 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, 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'
See Also
Server events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled