Difference between revisions of "CSecurity::ban"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) m (moved BanPlayer to CSecurity::ban) |
Shadlington (Talk | contribs) |
||
Line 11: | Line 11: | ||
{ | { | ||
if (text == "!banme") | if (text == "!banme") | ||
− | + | getSecurity().ban( player, 10 ); // 10 minute ban | |
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 21:49, 6 September 2012
Bans the given CPlayer for the given length of time, in minutes.
void banPlayer( CPlayer@ player, s32 time_in_minutes )
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 }