OnUnban: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
(Fixed incorrect onUnban parameters) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{Server event}} | ||
This event is triggered when | This event is triggered when a ban is removed from the server. | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
ban theBan | |||
</syntaxhighlight> | </syntaxhighlight> | ||
*''' | *'''theBan ''': The [[ban]] that will be removed. | ||
==Source== | ==Source== | ||
Line 23: | Line 23: | ||
root = getRootElement() | root = getRootElement() | ||
function announceUnban( | function announceUnban( theBan ) | ||
if getElementType( source ) then --Check if a player unbanned the IP/Serial | if getElementType( source ) then --Check if a player unbanned the IP/Serial | ||
outputChatBox( getPlayerName( source ) .. " unbanned " .. | outputChatBox( getPlayerName( source ) .. " 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 14:41, 8 February 2010
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 of this event is the element that was responsible for the unbanning. If no responsible was specified, the source is 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
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled