gms_admin_ban

Usage: gms_admin_ban ( player_id, reason, days )

Description

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 (29)

Last message on 4 Feb 2023

xcj233 on 29 Dec 2022, 04:41:10
How to display the banned days and reasons in the game
Size43 (Administrator) on 21 Jan 2023, 18:41:36
Apologies for the delay. You get additional information when a banned user is trying to login, in argument1 of the script you supplied to login_execute. This argument contains a JSON string, which you can decode with json_decode.
xcj233 on 27 Jan 2023, 12:29:28
How to get the corresponding value
Size43 (Administrator) on 4 Feb 2023, 17:41:50
If you ban yourself, you can check the values you receive. You can write some code to extract the right value from that.
xcj233 on 27 Jan 2023, 12:29:25
How to get the corresponding value
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?
devguy4002 on 30 Dec 2021, 03:10:31
is there a way to use this function without the player needing to have admin rights?
Size43 (Administrator) on 4 Jan 2022, 14:48:54
I believe any player can use this on themselves without needing admin rights. Other than that, it's not possible.
asriel_the_leader on 28 Jul 2018, 20:45:45
Hey, why did you ban me? i not did nothing :(
Size43 (Administrator) on 28 Jul 2018, 20:46:19
Please contact the developer of the game in which you were banned.
asriel_the_leader on 28 Jul 2018, 20:49:25
and how do I get in touch with the developer
Size43 (Administrator) on 28 Jul 2018, 20:50:19
Some games have a game page on this site, for other games you might need to visit the page where you downloaded the game to find out who created it and how to get in contact with them.
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.
64R1M on 3 Nov 2020, 09:14:38
What is the email of developer, please unban me
Size43 (Administrator) on 3 Nov 2020, 11:35:22
Please stop spamming.
Kotaru_Shenjuke on 12 Nov 2020, 01:15:58
Hello. I have a problem with "View LOVE/SPARE Leaderboard". When I try to view this section, the game freezes...
Size43 (Administrator) on 15 Nov 2020, 13:28:14
If I understand correctly, this is a problem with the game you're playing, not the extension itself. This is not the right place to report such an issue, as I develop the GameMaker Server extension that is used by some games for multiplayer functionality.
Artekk on 12 Nov 2020, 22:03:27
? ??? ?????????? ??????
Artekk on 12 Nov 2020, 22:04:20
How to revive boss?
Size43 (Administrator) on 15 Nov 2020, 13:28:32
If I understand correctly, this is a problem with the game you're playing, not the extension itself. This is not the right place to report such an issue, as I develop the GameMaker Server extension that is used by some games for multiplayer functionality.