_server.banUser()
Availability:
SmartFoxServer PRO 1.6.3
Usage:
_server.banUser(user, delay, farewellMessage, banType)
Description:
Bans a user from the server after a certain amount of seconds. The farewellMessage allows you to immediately send an Administrator Message to the user being banned. On the client side the message should be handled via the onAdministratorMessage callback.
Properties:
| user | the user to ban | |
| delay | the amount of delay (in seconds) before the action is performed | |
| farewellMessage | an Administrator Message that is delivered immediately to the client | |
| type | allows to specify if the user should be banned by IP address or name. Acceptable values are _server.BAN_BY_NAME and _server.BAN_BY_IP |
Returns:
nothing.
Example:
/* * Bans a user (it.gotoandaply.smartfoxserver.data.User) referenced by the bannableUser variable * The action is delayed by 10 seconds * The user is banned by Name */ _server.banUser(bannableUser, 10, "You're banned!", _server.BAN_BY_NAME)
See also:
kickUser, banOfflineUser, removeBanishment