Banning not working?

Posted by Ytsim
Oddly enough, I can't get banning to work.
Also, yes the player is being banned while in game.

This is the code I am using:

if(gms_self_admin_rights()) {
var nom = get_string("Player Name", "");
var pid = gms_other_find_by_name(nom);

gms_admin_ban(pid, "Because", 5);
gms_admin_kick(pid, "Because");

I can ban through the site all good and well, but that means the player wont be banned till he logs on again.

Replies (8)

Last message on 14 Jul 2017

Size43 (Administrator) on 30 Jun 2017, 11:35:27
Do you see an error?
Ytsim (Topicstarter) on 30 Jun 2017, 20:36:22
No error, just nothing happens.
Size43 (Administrator) on 1 Jul 2017, 12:33:34
Are you logged in to an account that has admin privileges?

What version of GM:Studio and GameMaker Server are you using?
Ytsim (Topicstarter) on 2 Jul 2017, 20:52:10
Yes, I am using my account I'm logged in with now.
I use GameMaker: Studio v1.4.1760
And GameMaker Server v1.9.9e
Size43 (Administrator) on 14 Jul 2017, 16:54:11
I've fixed this in GameMaker Sever 1.9.9f. Please download it and let me know if it fixes your issue:

Download GameMaker Server
Ytsim (Topicstarter) on 14 Jul 2017, 19:30:18
Yep, it indeed works! One suggestion though, would it be possible to make an on screen ban message rather than an error message? It just looks really tacky :p
Size43 (Administrator) on 14 Jul 2017, 21:45:55
You can use gms_debug_hide_errors() to disable the error messages. The gsm_script_set_* functions can be used to hook into disconnects or being kicked from the server (a ban kicks the user).
Ytsim (Topicstarter) on 14 Jul 2017, 22:30:57
I didn't know that, thanks!