gms_login_set_username

Usage: gms_login_set_username ( name )

Description

Sets the username to login with.

Replies (33)

Last message on 19 Nov 2017

namlunthkl on 9 Jan 2015, 13:23:45
How can I make a script to allow the players login as guest?
Size43 (Administrator) on 9 Jan 2015, 18:17:00
Not setting a password (not calling gms_login_set_password(...)) will force a login as a guest.
Irfan_animator on 18 Nov 2017, 16:58:33
hey i need help like normal player is a white name and for owner is yellow name how can i do that how can i make yellow name for me only
Size43 (Administrator) on 19 Nov 2017, 14:36:47
Irfan_animator on 19 Nov 2017, 17:44:33
thanks helping me Size43 you are the best :D
mpgame on 19 Jan 2017, 10:42:05
Hey!
How I can set a initial string to the textboxes of login box?
matthe815 on 20 Jan 2017, 16:37:01
What are you trying put into the initial string? Are you using a custom-made login?
mpgame on 21 Jan 2017, 09:28:16
No! I want to save name of players in ini file when they login first time... and in next times that saved name set as initial string to the textbox of login box...
Dublann on 21 Jan 2017, 10:49:32
If Im not wrong, you have to create a login system. Is what I did for the same purose, using the get_string() function and the player INI functions of GM server.
mpgame on 21 Jan 2017, 11:50:45
I don't think it was very hard... I guess by a script like global.__xrs_username or global.__xls_username it can possible... but this 2 scripts don't work.
Size43 (Administrator) on 22 Jan 2017, 09:28:38
You might be able to "cheat" it in by setting the keyboard_string to the player name right before opening the login window.
mpgame on 22 Jan 2017, 14:15:26
haha it is an interesting way....
Aaron13ps on 1 Jul 2015, 02:33:51
How would I obtain the username of a player.
For instance, is there an ID/variable that is used to store the username within the obj_player/obj_other_player?
I really wish there was a list of constants.
Size43 (Administrator) on 1 Jul 2015, 15:48:54
gms_self_name for the player object. All other players will have a variable "name", which you can read using gms_other_get :)
Aaron13ps on 1 Jul 2015, 21:49:31
What do I put for the Player ID?
Size43 (Administrator) on 2 Jul 2015, 19:16:43
If you ever need to get another variable that isn't set automatically, you can use the variable player_id. That's automatically set for all other player objects.
Aaron13ps on 1 Jul 2015, 22:21:00
Nevermind, I figured out you can just use the variable name in the obj_other_player.
Aaron13ps on 1 Jul 2015, 21:47:08
Awesome! Thank you so much :)
tifongames on 27 Jan 2015, 18:19:38
Hello Size43, first sorry for my English.
The problem is that my clients connect and communicate without problems but only for 30 or 40 seconds, after the connection is lost with the server.
All clients connect as guest.
GMStudio version: 01.04.1451
GMS version: 1.8.1
Thanks for your help.
Size43 (Administrator) on 28 Jan 2015, 12:20:58
Hey,

Please make sure the GMS object is persistent, and does not get destroyed. (with(all) instance_destroy() will destroy the GMS object too).

Please also make sure that if you're using the (All) version, the GMS object has an Async Networking event that calls gms_network()

Size43
tifongames on 28 Jan 2015, 15:52:29
Thanks for your reply,

Everything you tell me, I have correctly configured.
When you disconnect from the server, this message appears:

ERROR in
action number 1
of Step Event0
for object GMS:

SERVER ERROR:A P2P message
was sent to a player that does not
exist!(ID:74112)

Please note:This is a server-sided
error message.To disable all
GameMaker Server-errors,call
gms_debug_hide_errors().
at gml_Script_XServer_step

Thanks Size43.
Size43 (Administrator) on 28 Jan 2015, 15:59:07
Are you sending any P2P messages? What does the code for that look like?
tifongames on 28 Jan 2015, 15:58:07
P.D.: everything works correctly for 1 minute
tifongames on 28 Jan 2015, 16:15:09
Send:
gms_p2p_send(p2p_vssolicitud,global.playervs,global.MyName);

Received:

switch(argument0)
{
case p2p_vssolicitud:

global.playeridreceived=(ds_list_find_value(argument2,0));
global.oterplayerid=(gms_other_find_by_name ( global.playeridreceived));
}

This work good for my.
tifongames on 28 Jan 2015, 16:27:39
I only use them to send some values and that orders are executed in the game the other player and everything works perfect until server clients are disconnected.
Size43 (Administrator) on 28 Jan 2015, 17:46:13
It seems the clients are getting disconnected because no ping is received. Are you using the All or Windows version of the extension?
tifongames on 28 Jan 2015, 18:06:56
All version.My game it's for Android.

Thanks Size43
Size43 (Administrator) on 28 Jan 2015, 18:19:31
Does the same issue occur when switching to the windows version? (You'll need to temporarily remove the call to gms_network())
tifongames on 28 Jan 2015, 18:36:53
I'll test it and let you know. I thought that with the gmstudio version I needed to call gms_network()).

Thanks !
Size43 (Administrator) on 28 Jan 2015, 19:21:09
Only the All version requires you to call gms_network. The Windows version does not contain the gms_network function. ;)
tifongames on 29 Jan 2015, 19:21:25
hello Size43:

with the windows version:

to build .exe: work prefect

to build .apk (android): I do not get login (no errors messages)

I used the same code for 2 options.

Code:

gms_login_set_username ( global.MyName );
gms_login_execute(scr_login)

scr_login:

switch(argument0)
{
case e_ok:
show_message("Login OK!");
room_goto_next();
break;
case e_already_logged_in:
show_message("You're already logged in!");
break;
default:
show_message(gms_login_error_tostring(argument0));
break;
}

Thanks!
Size43 (Administrator) on 31 Jan 2015, 18:53:22
Hey, I'm having trouble replicating the issue you're experiencing. Would you mind sending me your project files? (gamemakerserver@outlook.com)
Size43 (Administrator) on 31 Jan 2015, 16:48:53
The windows version not doing anything on android is normal. It seems like the issue is somewhere in the All version. I'll try to fix it.