Usage: gms_admin_ban ( player_id, reason, days )


Bans the given player for 'days' days, and kicks him.

'reason' is optional, and can be used to send the player a last message before getting kicked.

Warning:This function can be executed on every client, even guests. You'll need to check by using server_self_admin_rights and server_other_admin_rights whether the player is authorized to ban someone.

Replies (11)

Last message on 2 Apr 2018

MyLegGuy on 3 Oct 2014, 04:25:57
This isn't working for me. It says player to ban not found. Would you please add an example?
Size43 (Administrator) on 3 Oct 2014, 18:48:17
Admin functions can only ban/kick people that are logged in to your game at the time of calling the function. Please make sure the player you're trying to ban is in the same session as the client calling the function.
omar4321 on 26 Jun 2017, 19:11:28
size where do I add the code?
Size43 (Administrator) on 30 Jun 2017, 11:35:06
When you want to someone banned, you add the code there.
captainJACK on 8 Aug 2017, 00:44:28
In what obj do I put this code and in what event?
captainJACK on 8 Aug 2017, 00:42:29
Where do I put this code?
Size43 (Administrator) on 4 Sep 2017, 11:12:46
Apologies for the delay, I've been having some health issues.

Presumably you have some button or thing that your admins need to press/do to ban someone, right? That's where you'd add this code. If you just want to make a "/ban ..." command, that's built in to the chat already: "/ban username days reason"
mogollon1980 on 1 Jul 2017, 05:37:20
Hey, why did you ban me? i not did nothing
Size43 (Administrator) on 1 Jul 2017, 09:28:07
Please contact the developer of the game in which you were banned.
I_AM_DERPINESS on 2 Apr 2018, 11:53:26
Does that mean the person who created the game? or the server host?
Size43 (Administrator) on 2 Apr 2018, 15:38:06
The person that created the game.