else if(dialogid == DIALOG_JOIN)
{
if(response)
{
new string2[256];
format(string, sizeof(string), "Welcome to %s | V: %s!", SCRIPT_MODE, SCRIPT_VERSION);
format(string2, sizeof(string2), "In order to play on our server, we require you create an account.\nYou may be asking yourself, why do I have to create an account? The answer would be: Security.\nWe strive to provide a completely secure SA:MP experience! Please enter a password below:");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_JOIN, DIALOG_STYLE_INPUT, string, string2, "Join", "Leave");
new INI:File = INI_Open(FindUserPath(playerid));
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
INI_SetTag(File,"DATA");
INI_WriteInt(File,"Password", udb_hash(inputtext));
INI_WriteString(File, "IP", plrIP);
INI_WriteInt(File,"Money", 0);
INI_WriteInt(File,"AuthLevel", 0);
INI_WriteInt(File,"Kills", 0);
INI_WriteInt(File,"Deaths", 0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 119, 0, 0, 0, 0, 24, 99999, 31, 99999, 34, 99999);
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_SUCCESSFUL, "[System] You have been booted from the server. (Clicked \"Leave\" or closed the dialog!)");
return Kick(playerid);
}
}
else if(dialogid == DIALOG_LOGIN)
{
if(response)
{
if(udb_hash(inputtext) == UserInfo[playerid][Password])
{
INI_ParseFile(FindUserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
format(string, sizeof(string), "AuthLevel: %d", UserInfo[playerid][AuthLevel]);
SendClientMessage(playerid, -1, string);
return 1;
}
else
{
SendClientMessage(playerid, -1, "Invalid Password!");
return 1;
}
}
return 1;
}
if(udb_hash(inputtext) == UserInfo[playerid][Password])
if(!strcmp(udb_hash(inputtext), UserInfo[playerid][Password], false))
pawn Код:
pawn Код:
|
error 035: argument type mismatch (argument 1) |
Okay, but you can't do the thing you currently have because "UserInfo[playerid][Password]" is a string, correct?
|
if(!strcmp(inputtext, UserInfo[playerid][Password], false))
if(strcmp(inputtext, UserInfo[playerid][Password], true))
"Password" in the enum is actually an integer, sadly, I'm flawed when it comes to Y_INI, and I can't figure out how to create password as a string properly, and the tutorial I'm looking at is wrong, I'm assuming.
However, I have switched "Password" over to a string in the enum, and changed my code around a bit; Let me test it, and I will edit my post/reply to this thread if it works or not. Give me about a minute. EDIT: Alright, after switching my "Password" to a string in every bit of code, I'm getting a different action now. It's logging me in now, even if the password is incorrect. The correct password is "hello", I type in "1" as the password, and it automatically logs me in, when it is obviously not the password. The password-checking code is: pawn Код:
EDIT2: I changed the password-checking code to the following - pawn Код:
|
print(UserInfo[playerid][Password]);