SA-MP Forums Archive
Question about MySQL Login System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about MySQL Login System (/showthread.php?tid=656384)



Question about MySQL Login System [Thread updated] - Sensation - 14.07.2018

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?


Re: Question about MySQL Login System - GangstaSunny. - 14.07.2018

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

It's simple as that.


Re: Question about MySQL Login System - Sensation - 15.07.2018

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


Re: Question about MySQL Login System - Sensation - 15.07.2018

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'



Re: Question about MySQL Login System - Sensation - 15.07.2018

Someone help me please


Re: Question about MySQL Login System - Sew_Sumi - 15.07.2018

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