25.12.2013, 19:44
I thought I'd try something new and learn how to use these YSI libraries but I'm stuck. I'm trying to make a basic registration system right now... and simply don't understand how.
When a player first creates an account, their ID file is generated in YSI\users\ like it should but with contents similar to this (?):
I don't really comprehend any of that. Or know if I even should. But anyway, afterwards they can login with any password. Obviously the problem is the password isn't being stored/is being stored and not checked for correctness, but the purpose of these libraries is to handle all that in the back end, no? So I don't know where to look to fix this.
I found this: https://sampforum.blast.hk/showthread.php?tid=414141 but there's no mention of registration/handling passwords that I can see so that just confused me even more.
And also, this message is displayed in the console for players joining:
What is that?
Sorry for the lengthy post and thanks in advance for any help. I know I'm probably just missing something important somewhere, I haven't been scripting lately.
pawn Код:
public OnPlayerConnect(playerid)
{
Langs_SetPlayerLanguage(playerid, lEnglish);
if(Player_IsRegistered(playerid)) {
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Please enter the password to this account below to continue.","Login","Change Name");
}
else {
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Please enter a password to register this account below.","Register","Change Name");
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid) {
case DIALOG_LOGIN: {
if(!response) ShowPlayerDialog(playerid,DIALOG_CHANGENAME,DIALOG_STYLE_INPUT,"Change name","Enter a new name below to continue (Firstname_Lastname format).","Change","Quit");
else if(response) {
if(strlen(inputtext)) {
new str[32]; format(str,sizeof(str),"%s",inputtext);
Player_TryLogin(playerid,str);
}
else {
SendClientMessage(playerid,-1,"Invalid field entry. Please try again.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Please enter the password to this account below to continue.","Login","Change Name");
}
}
}
case DIALOG_REGISTER: {
if(!response) ShowPlayerDialog(playerid,DIALOG_CHANGENAME,DIALOG_STYLE_INPUT,"Change name","Enter a new name below to continue (Firstname_Lastname format).","Change","Quit");
else if(response) {
if(strlen(inputtext)) {
new str[32]; format(str,sizeof(str),"%s",inputtext);
Player_TryRegister(playerid,str);
}
else {
SendClientMessage(playerid,-1,"Invalid field entry. Please try again.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Please enter a password to register this account below.","Register","Change Name");
}
}
}
}
return 1;
}
Код:
[@@BasicRoleplay-y_uvar] PlayerInfo = 27 @@PlayerInfo-0 = >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@PlayerInfo-1 = >>>>>>>>>>>>>>>>
I found this: https://sampforum.blast.hk/showthread.php?tid=414141 but there's no mention of registration/handling passwords that I can see so that just confused me even more.
And also, this message is displayed in the console for players joining:
Код:
format_DoDisplay b: 0, 000000, "Text Not Found"
Sorry for the lengthy post and thanks in advance for any help. I know I'm probably just missing something important somewhere, I haven't been scripting lately.