Name suddenly null?
#1



Код:
public OnAccountCheck(playerid)
{
	print("Reached onAccountCheck!");
	new rows, fields, string[128];
	cache_get_data(rows, fields, mysql);

	if (rows)
	{
	    format(string, sizeof(string), "Name before: %s", PlayerInfo[playerid][Name]);
	    print(string);
	    
	    cache_get_field_content(0, "Password", PlayerInfo[playerid][Password], mysql, 65);
	    cache_get_field_content(0, "Salt", PlayerInfo[playerid][Salt], mysql, 11);
	    cache_get_field_content(0, "ID", PlayerInfo[playerid][ID], mysql, 10);
	    
	    format(string, sizeof(string), "Name after: %s", PlayerInfo[playerid][Name]);
	    print(string);
	    
	    format(string, sizeof(string), "Welcome %s!\nThis username is registered, please fill in your password.", PlayerInfo[playerid][Name]);
	    ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Quit");
	}
	else
	{
	    format(string, sizeof(string), "Welcome %s!\nThis username is NOT registered. Please fill in a password.", PlayerInfo[playerid][Name]);
	    ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_PASSWORD, "Register", string, "Register", "Quit");
	}
	return 1;
}
Why is PlayerInfo[playerid][Name] suddenly empty after I retrieve 3 values from the cache? I save the name under OnPlayerConnect btw. It should have nothing to do with SQL, but I have no idea why it's suddenly empty.
It doesn't show the name either in the 'Welcome %s..' message.
Код:
public OnPlayerConnect(playerid)
{	
	.....
	GetPlayerName(playerid, PlayerInfo[playerid][Name], MAX_PLAYER_NAME);
        .....
Reply


Messages In This Thread
Name suddenly null? - by MartinSwag - 23.08.2015, 16:53
Respuesta: Name suddenly null? - by Zume - 23.08.2015, 17:28

Forum Jump:


Users browsing this thread: 2 Guest(s)