SetBanAdmin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Fixed a typo after adding example.)
mNo edit summary
Line 33: Line 33:
==See Also==
==See Also==
{{Admin_functions}}
{{Admin_functions}}
[[ru:setBanAdmin]]

Revision as of 16:02, 10 September 2014

ADDED/UPDATED IN VERSION 1.4 :

This function sets a new admin for a ban.


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), when 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