MySQL - Check Register - 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: MySQL - Check Register (
/showthread.php?tid=656292)
MySQL - Check Register -
BrainDamaged - 12.07.2018
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;
}
Re: MySQL - Check Register -
Calisthenics - 12.07.2018
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)
Re: MySQL - Check Register -
BrainDamaged - 12.07.2018
I changed the problem like this
Код:
if (!GetPVarInt(playerid, "LoggedIn"))
is it true ?
Re: MySQL - Check Register -
JasonRiggs - 12.07.2018
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..
Re: MySQL - Check Register -
BrainDamaged - 12.07.2018
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