MySQL - Check Register
#1

Hi, if you try to use the registered players command, you will get an error saying that you are not registered. How can i solve the problem ?


Код:
CMD:changeques(playerid, params[])
{
	if (eUser[playerid][e_USER_SQLID] != 1)
	{
		SendClientMessage(playerid, COLOR_TOMATO, "Only registered users can use this command.");
		return 1;
	}

    new list[2 + (sizeof(SECURITY_QUESTIONS) * MAX_SECURITY_QUESTION_SIZE)];
	for (new i; i < sizeof(SECURITY_QUESTIONS); i++)
	{
	    strcat(list, SECURITY_QUESTIONS[i]);
	    strcat(list, "\n");
	}
	ShowPlayerDialog(playerid, CHANGE_SEC_QUESTION, DIALOG_STYLE_LIST, "Change account security question... [Step: 1/2]", list, "Continue", "Cancel");
	SendClientMessage(playerid, COLOR_WHITE, "[Step: 1/2] Select a security question. This will help you retrieve your password in case you forget it any time soon!");
	PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
	return 1;
}
Reply
#2

I just checked the code from Gammix's gamemode and resetting value for e_USER_SQLID is -1. Therefore:
pawn Код:
if (eUser[playerid][e_USER_SQLID] != -1)
Reply
#3

I changed the problem like this

Код:
if (!GetPVarInt(playerid, "LoggedIn"))
is it true ?
Reply
#4

This checks if the player is logged in tho.. (If you already set a variable integer of logging in to the player to 1) I guess you need to know if the player is registered or no, By checking if his SQLID is a valid row id in the accounts table.. valid ID = not equal -1..
Reply
#5

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
This checks if the player is logged in tho.. (If you already set a variable integer of logging in to the player to 1) I guess you need to know if the player is registered or no, By checking if his SQLID is a valid row id in the accounts table.. valid ID = not equal -1..
Thank you for the information
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)