<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=BanPlayer</id>
	<title>BanPlayer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=BanPlayer"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=BanPlayer&amp;action=history"/>
	<updated>2026-09-19T07:32:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=BanPlayer&amp;diff=661&amp;oldid=prev</id>
		<title>QCherry: Document 0.1a Lua API, identities, moderation and synchronized spells</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=BanPlayer&amp;diff=661&amp;oldid=prev"/>
		<updated>2026-08-27T11:36:25Z</updated>

		<summary type="html">&lt;p&gt;Document 0.1a Lua API, identities, moderation and synchronized spells&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= banPlayer =&lt;br /&gt;
Persists a verified client-serial ban and disconnects the connected player.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool banPlayer(int playerId [, int minutes = 0 [, string reason = &amp;quot;Banned by a server resource&amp;quot;]])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || yes || The connected player identifier.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || no || Optional duration in whole minutes. Use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for a permanent ban; the maximum is 5,256,000 minutes (10 years).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || no || Optional non-empty reason of at most 160 bytes without control characters.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; only when the serial ban is persisted and the player&amp;#039;s disconnect is accepted. Returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for an invalid or unauthenticated player, invalid arguments, or a persistence failure.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Ban a player for one hour:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
if not banPlayer(playerId, 60, &amp;quot;Repeated griefing&amp;quot;) then&lt;br /&gt;
    outputDebugString(&amp;quot;The ban could not be persisted.&amp;quot;, 1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Available only in server-side resource scripts.&lt;br /&gt;
* The ban is stored by verified client serial in the server&amp;#039;s local &amp;lt;code&amp;gt;bans.json&amp;lt;/code&amp;gt;. It is distinct from global master-list bans and from any account-ban table maintained by a gamemode.&lt;br /&gt;
* This function does not grant or check a gamemode permission such as &amp;lt;code&amp;gt;admin.ban&amp;lt;/code&amp;gt;. The calling resource must authorize the command or action before invoking it.&lt;br /&gt;
* A successful call immediately revokes voice, ends the gameplay connection and closes the game client. The launcher displays the ban reason, and the normal &amp;lt;code&amp;gt;onPlayerQuit&amp;lt;/code&amp;gt; event follows. There is no separate &amp;lt;code&amp;gt;onPlayerBan&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* Omitting &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; or passing &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; creates a permanent ban.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Functions]]&lt;br /&gt;
[[Category:Server Functions]]&lt;br /&gt;
[[Category:Player Functions]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>