SetBanAdmin: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| No edit summary | |||
| Line 1: | Line 1: | ||
| __NOTOC__   | __NOTOC__   | ||
| {{Server function}} | {{Server function}} | ||
| {{New items|4.0132|1.4| | {{New items|4.0132|1.4| | ||
| This function  | This function sets a new admin for a [[ban]]. | ||
| }} | }} | ||
| Line 13: | Line 12: | ||
| ===Required Arguments===   | ===Required Arguments===   | ||
| *'''theBan:''' The [[ban]]  | *'''theBan:''' The [[ban]] you want to change the admin of. | ||
| *'''theAdmin:'''  | *'''theAdmin:''' The new admin. | ||
| ===Returns=== | ===Returns=== | ||
| Returns ''true''  | Returns ''true'' if changed, ''false'' otherwise. | ||
| ==Example== | ==Example== | ||
| This example changes the ban admin to the admin's IP (If it's a player), if someone gets banned. | |||
| <syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| function banHappened(theBan) | |||
|     if getElementType(source) == "player" then | |||
|         local adminIP = getPlayerIP(source) | |||
|         setBanAdmin(theBan,adminIP) | |||
|     end | |||
| end | |||
| addEventHandler( "onBan", getRootElement(), banHappened ) | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| ==See Also== | ==See Also== | ||
| {{Admin_functions}} | {{Admin_functions}} | ||
Revision as of 19:50, 8 August 2014
Syntax
bool setBanAdmin ( ban theBan, string theAdmin )
Required Arguments
- theBan: The ban you want to change the admin of.
- theAdmin: The new admin.
Returns
Returns true if changed, false otherwise.
Example
This example changes the ban admin to the admin's IP (If it's a player), if someone gets banned.
function banHappened(theBan)
    if getElementType(source) == "player" then
        local adminIP = getPlayerIP(source)
        setBanAdmin(theBan,adminIP)
    end
end
addEventHandler( "onBan", getRootElement(), banHappened )
See Also
- addBan
- banPlayer
- getBanAdmin
- getBanIP
- getBanNick
- getBanReason
- getBanSerial
- getBanTime
- getBans
- getUnbanTime
- isBan
- kickPlayer
- setBanAdmin
- setBanNick
- setBanReason
- setUnbanTime
- reloadBans
- removeBan