Question about MySQL Login System
#1

Hey guys there is a tutorial in this link https://sampforum.blast.hk/showthread.php?tid=627520

In this tutorial the player is auto logging to the game after register. But i want to ask for a password after player registered to game. So login dialog will follow after register dialog. How can i make this?
Reply
#2

Instead of logging him in, show him the login dialog instead.

It's simple as that.
Reply
#3

Quote:
Originally Posted by GangstaSunny.
Посмотреть сообщение
Instead of logging him in, show him the login dialog instead.

It's simple as that.
But its not simple like that.

As you say "invalid cache id" and "cache_get_value_name_int no active cache" errors are coming out .

Sorry for my bad english by the way
Reply
#4

Originally this:
Код:
forward OnPlayerRegister(playerid);
public OnPlayerRegister(playerid)
{
	// retrieves the ID generated for an AUTO_INCREMENT column by the sent query
	pInfo[playerid][UserID] = cache_insert_id();

	ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Register", "You are now registered and has been logged in.", "Okay", "");
	pInfo[playerid][IsLoggedIn]=true;
	return 1;
}
to changed
Код:
forward OnPlayerRegister(playerid);
public OnPlayerRegister(playerid)
{
	// retrieves the ID generated for an AUTO_INCREMENT column by the sent query
	pInfo[playerid][UserID] = cache_insert_id();

	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "You are now registered. Write your password below to login account", "Okay", "");
	pInfo[playerid][IsLoggedIn]=false;
	return 1;
}
after i getting this errors
Код:
[10:41:20] [plugins/mysql] cache_set_active: invalid cache id '0'
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name_int: no active cache
[10:41:20] [plugins/mysql] cache_get_value_name: no active cache
[10:41:20] [plugins/mysql] cache_delete: invalid cache id '0'
Reply
#5

Someone help me please
Reply
#6

24 hour bumps only, someone will respond, just don't start spamming/double posting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)