PDA

View Full Version : Problem with saving account passwords


nicholasramdhan
24/03/2015, 03:19 AM
So, i'm in this script, and every time the player relogs, the password says it's incorrect. I go in the scriptfiles, and the password is = to a bunch of numbers. So, if anyone could help me / tell me what lines or something to post, I can.

This is the line where it loads the password/account from:

INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login","{24FF0A}Welcome to Gangwar Deathmatch.\n"MSG_WHITE"Please enter your password, to ensure your time on GW:DM!\n{24FF0A}Current Version: GW:DM v1.0!\n{FF9900}Enjoy your stay!","Login","Exit");

This is what my Scriptfiles folder looks like.

Scriptfiles > Folder(Logs) Folder(Users) Notepad(Ban)

In Users, I click on my name which I registered with, it says this:

[Data]
Password = 419103658
Cash = 5000
Admin = 0
Kills = 0
Deaths = 0
Muted = 0
Banned = 0
ReportBanned = 0
PlayingHours = 0
LSPD = 0

but, that's not my password, and when I relog, those numbers don't work, or the password that I registered with before. So, any help please?

Wolfe
24/03/2015, 03:24 AM
Are you using yini?

nicholasramdhan
24/03/2015, 03:25 AM
Yes i'm using YSI/yini

#include <YSI\y_ini> // Created by ******. // Registration & Login. //

Wolfe
24/03/2015, 03:26 AM
This is a common error. Try running samp-server.exe as an administrator. IF that does not work re-download yini

nicholasramdhan
24/03/2015, 03:30 AM
See, the thing is, I can't run as administrator because I upload to a host, but i'll try reinstalling. Standby while I check

CrossOv3r
24/03/2015, 03:31 AM
Those "numbers" won't work.

Are you hashing (encrypting) passwords?

nicholasramdhan
24/03/2015, 03:36 AM
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(538) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(538) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(543) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(543) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(2336) : error 025: function heading differs from prototype
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(2383) : error 025: function heading differs from prototype
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3116) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3116) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3116) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3170) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3170) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3170) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_inline.inc(606) : warning 219: local variable "y" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.


I reinstalled YINI, and now this happens. I had no errors/warnings before.

nicholasramdhan
24/03/2015, 03:38 AM
Those "numbers" won't work.

Are you hashing (encrypting) passwords?

Sadly IDK what you're talking about. Sorry i'm pretty noob at scripting :/

Is there someone I can add on skype and send this to that can help me to fix it?

nicholasramdhan
24/03/2015, 03:52 AM
UPDATE:

So I changed my YINI version down to 0.3x, but the server is still running on 0.3z, but it's working good! but.. I got these warnings that I never got before. Can someone help me remove them? Here's the code.


Warnings:
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(538) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(538) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(543) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_va/impl.inc(543) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3114) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3114) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3114) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3168) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3168) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_hooks/impl.inc(3168) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Nicholas\Desktop\East Coast DM\pawno\include\YSI\y_inline.inc(606) : warning 219: local variable "y" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


11 Warnings.


Line 538: {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
Line 543: {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
Line 3114: }
Line 3168: SetPlayerSkin(giveplayerid, skin);
Line 606: {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},

SickAttack
24/03/2015, 03:53 AM
Post the lines which are used to compare passwords.

nicholasramdhan
24/03/2015, 03:58 AM
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login","{24FF0A}Welcome to Gangwar Deathmatch.\n"MSG_WHITE"Please enter your password, to ensure your time on GW:DM!\n{24FF0A}Current Version: GW:DM v1.0!\n{FF9900

This?

SickAttack
24/03/2015, 04:13 AM
This?

No, example:
if(dialogid == DIALOG_LOGIN)
{
if(strcmp(pUserInfo[playerid][user_password], ...))
...
}

nicholasramdhan
24/03/2015, 05:01 AM
public LoadUser_data(playerid, name[], value[])
{
INI_Int("Password", PlayerInfo[playerid][pPass]);
INI_Int("Cash", PlayerInfo[playerid][pCash]);
INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
INI_Int("Kills", PlayerInfo[playerid][pKills]);
INI_Int("Deaths", PlayerInfo[playerid][pDeaths]);
INI_Int("Muted", PlayerInfo[playerid][pMuted]);
INI_Int("Banned", PlayerInfo[playerid][pBanned]);
INI_Int("ReportBanned", PlayerInfo[playerid][pReportBanned]);
INI_Int("PlayingHours", PlayerInfo[playerid][pConnectedTime]);
INI_Int("LSPD", PlayerInfo[playerid][pLSPD]);
return 1;
}

SickAttack
24/03/2015, 05:07 AM
public LoadUser_data(playerid, name[], value[])
{
INI_Int("Password", PlayerInfo[playerid][pPass]);
INI_Int("Cash", PlayerInfo[playerid][pCash]);
INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
INI_Int("Kills", PlayerInfo[playerid][pKills]);
INI_Int("Deaths", PlayerInfo[playerid][pDeaths]);
INI_Int("Muted", PlayerInfo[playerid][pMuted]);
INI_Int("Banned", PlayerInfo[playerid][pBanned]);
INI_Int("ReportBanned", PlayerInfo[playerid][pReportBanned]);
INI_Int("PlayingHours", PlayerInfo[playerid][pConnectedTime]);
INI_Int("LSPD", PlayerInfo[playerid][pLSPD]);
return 1;
}

That no, show me the response of the dialog id 20 (Login dialog).

nicholasramdhan
24/03/2015, 05:29 AM
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login","{24FF0A}Welcome to Gangwar Deathmatch.\n"MSG_WHITE"Please enter your password, to ensure your time on GW:DM!\n{24FF0A}Current Version: GW:DM v1.0\n{FF9900}Enjoy your stay!","Login","Exit");
}
else
{
ShowPlayerDialog(playerid,19,DIALOG_STYLE_PASSWORD ,"Registration","{24FF0A}Welcome to Gangwar Deathmatch.\n{FFFFFF}Account not found, please register now,\n{24FF0A}Current Version: "GW:DM v1.0"!\n{FF9900}Enjoy your stay!","Register","Exit");
}
}



Then this is when the person is registered already, and comes back:

new string[128];
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
format(string, sizeof(string), "System: Welcome back to Gangwar Deathmatch, %s.", PlayerName(playerid));
SendClientMessage(playerid, COLOR_WHITE,string);
LoggedIn[playerid] = 1;
}
else
{
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login",""BR"You have entered an Incorrect Password.\n"LB"Please try again.","Login","Exit");
}
return 1;
}
}

SickAttack
24/03/2015, 05:34 AM
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login","{24FF0A}Welcome to Gangwar Deathmatch.\n"MSG_WHITE"Please enter your password, to ensure your time on GW:DM!\n{24FF0A}Current Version: GW:DM v1.0\n{FF9900}Enjoy your stay!","Login","Exit");
}
else
{
ShowPlayerDialog(playerid,19,DIALOG_STYLE_PASSWORD ,"Registration","{24FF0A}Welcome to Gangwar Deathmatch.\n{FFFFFF}Account not found, please register now,\n{24FF0A}Current Version: "GW:DM v1.0"!\n{FF9900}Enjoy your stay!","Register","Exit");
}
}



Then this is when the person is registered already, and comes back:

new string[128];
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
format(string, sizeof(string), "System: Welcome back to Gangwar Deathmatch, %s.", PlayerName(playerid));
SendClientMessage(playerid, COLOR_WHITE,string);
LoggedIn[playerid] = 1;
}
else
{
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login",""BR"You have entered an Incorrect Password.\n"LB"Please try again.","Login","Exit");
}
return 1;
}
}

That isn't complete, post all of it.

nicholasramdhan
24/03/2015, 05:37 AM
if(dialogid == 19)
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputparam)) return ShowPlayerDialog(playerid, 19, DIALOG_STYLE_PASSWORD, ""MSG_WHITE"Registering...",""MSG_RED"You have entered an invalid password.\n"MSG_WHITE"Type your password below to register a new account.","Register","Exit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Data");
INI_WriteInt(File,"Password", PlayerInfo[playerid][pPass] = udb_hash(inputparam));
INI_WriteInt(File,"Cash", PlayerInfo[playerid][pCash] = 5000);
INI_WriteInt(File,"Admin", PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File,"Kills", PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File,"Deaths", PlayerInfo[playerid][pDeaths] = 0);
INI_WriteInt(File,"Muted", PlayerInfo[playerid][pMuted] = 0);
INI_WriteInt(File,"Banned", PlayerInfo[playerid][pBanned] = 0);
INI_WriteInt(File,"ReportBanned", PlayerInfo[playerid][pReportBanned] = 0);
INI_WriteInt(File,"PlayingHours", PlayerInfo[playerid][pConnectedTime] = 0);
INI_WriteInt(File,"LSPD", PlayerInfo[playerid][pLSPD] = 0);
INI_Close(File);
printf("[REGISTER] - %s has just registered.",PlayerName(playerid));
SendClientMessage(playerid, COLOR_WHITE,"System: You have successfully registered!");
LoggedIn[playerid] = 1;
}
return 1;
}
if(dialogid == 20)
{
if(!response) return Kick (playerid);
if(response)
{
if(udb_hash(inputparam) == PlayerInfo[playerid][pPass])
{
new string[128];
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
format(string, sizeof(string), "System: Welcome back to Gangwar Deathmatch, %s.", PlayerName(playerid));
SendClientMessage(playerid, COLOR_WHITE,string);
LoggedIn[playerid] = 1;
}
else
{
ShowPlayerDialog(playerid,20,DIALOG_STYLE_PASSWORD ,"Login",""BR"You have entered an Incorrect Password.\n"LB"Please try again.","Login","Exit");
}
return 1;
}
}
return 0;
} Thats Dialog 19 and 20.

JaydenJason
24/03/2015, 05:45 AM
Sadly IDK what you're talking about. Sorry i'm pretty noob at scripting :/

Is there someone I can add on skype and send this to that can help me to fix it?

Hashing passwords means that the passwords get changed into a bunch of weird numbers/letters etc to secure the passwords from a hacker who can get on your vps and steal the accounts and passwords
And when you put the original password into a dialog, you can hash the input to see if it matches the numbers in your user. ini

INI_WriteInt(File,"Password", PlayerInfo[playerid][pPass] = udb_hash(inputparam));
That's your hashing

nicholasramdhan
24/03/2015, 05:52 AM
Hashing passwords means that the passwords get changed into a bunch of weird numbers/letters etc to secure the passwords from a hacker who can get on your vps and steal the accounts and passwords
And when you put the original password into a dialog, you can hash the input to see if it matches the numbers in your user. ini

INI_WriteInt(File,"Password", PlayerInfo[playerid][pPass] = udb_hash(inputparam));
That's your hashing

Okay so is there a solution for the passwords not really working?

SickAttack
24/03/2015, 05:54 AM
Change this:
if(udb_hash(inputparam) == PlayerInfo[playerid][pPass])

To:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])

JaydenJason
24/03/2015, 05:55 AM
Okay so is there a solution for the passwords not really working?

The passwords are working, try registering a new account and input: testpswd
Themselves quit the game and see if you can log in with the password: testpswd