Difference between revisions of "CSecurity::ban"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
Line 18: Line 18:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
Object method of: [[CSecurity]]
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Object Methods]]
 
[[Category:Object Methods]]

Latest revision as of 13:36, 8 September 2012

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