CSecurity::ban

From King Arthur's Gold Wiki
(Redirected from BanPlayer)
Jump to: navigation, search

Bans the given player (by name or CPlayer reference) for the given length of time, in minutes. Can optionally provide a reason too.

void ban( CPlayer@ player, const s32 minutes )
void ban( CPlayer@ player, const s32 minutes, const string &in reason )
void ban( const string &in username, const s32 minutes )
void ban( const string &in username, const s32 minutes, const string &in reason )

Usage example, in which saying '!banme' in the chat will cause the player that said it to be banned for 10 minutes:

void ProcessChat( CRules@ this, string text, CPlayer@ player ) 
{
  if (text == "!banme")
    getSecurity().ban( player, 10 ); // 10 minute ban
}

Object method of: CSecurity