Scripting help
#1

The Folder where the players data saved. when i open it, the password is wrong, how to fix it :

Reply
#2

The password is not wrong, he's just hash (md5, sha1, Whirlpool, ...).

You must edit the insert data player if the password not fit you.

Nlx.
Reply
#3

You mean i have to change things in that code
Код:
forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
	INI_String("Password", PlayerInfo[playerid][Password], 129);
//	INI_Int("RegID", PlayerInfo[playerid][RegID]);
	INI_String("LastActive", lastactive[playerid], 50);
	INI_String("Registered_On", PlayerInfo[playerid][RegOn], 20);
	INI_Int("Admin", PlayerInfo[playerid][Admin]);
	INI_Int("VIP", PlayerInfo[playerid][VIP]);
	INI_String("AltName", PlayerInfo[playerid][AltName], 30);
	INI_Int("Cash", PlayerInfo[playerid][Cash]);
	INI_Int("Score", PlayerInfo[playerid][Score]);
	INI_Int("Kills", PlayerInfo[playerid][Kills]);
	INI_Int("Deaths", PlayerInfo[playerid][Deaths]);
	INI_Int("Skin", PlayerInfo[playerid][Skin]);
	INI_Int("WeaponSet", PlayerInfo[playerid][WeaponSet]);
	INI_Int("CustomSlot1", PlayerInfo[playerid][CustomSlot1]);
	INI_Int("CustomSlot2", PlayerInfo[playerid][CustomSlot2]);
	INI_Int("CustomSlot3", PlayerInfo[playerid][CustomSlot3]);
	INI_Int("CustomSlot4", PlayerInfo[playerid][CustomSlot4]);
	INI_Int("CustomSlot5", PlayerInfo[playerid][CustomSlot5]);
	INI_Int("CustomSlot6", PlayerInfo[playerid][CustomSlot6]);
	INI_Int("CustomSlot7", PlayerInfo[playerid][CustomSlot7]);
	INI_Hex("Color", PlayerInfo[playerid][Color]);
	INI_Int("Hours", PlayerInfo[playerid][Hours]);
	INI_Int("Minutes", PlayerInfo[playerid][Minutes]);
	INI_Float("SpawnPosX", PlayerInfo[playerid][POS_X]);
	INI_Float("SpawnPosY", PlayerInfo[playerid][POS_Y]);
	INI_Float("SpawnPosZ", PlayerInfo[playerid][POS_Z]);
	INI_Int("Helmet", PlayerInfo[playerid][Helmet]);
	SetPVarInt(playerid, "Admin", PlayerInfo[playerid][Admin]);
	SetPVarInt(playerid, "VIP", PlayerInfo[playerid][VIP]);
	return 1;
}
Reply
#4

No, here the server receive the data, and the password is already hash.

INI_String("Password", PlayerInfo[playerid][Password], 129);

Look at the registering, maybe.

Nlx.
Reply
#5

Maybe this
Код:
	if (dialogid == REGISTER)
	{
	    if (!response) return Kick(playerid);
	    if (response)
	    {
	        if (!strlen(inputtext))
	        {
	            ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, ""RED">> "PREMIUM"Account Register", ""WHITE"Welcome to "RED"Extreme Street Fighters"WHITE"!\n"WHITE"This account is "RED"not "WHITE"registered.\n\n"YELLOW"» Please enter a password below to register.", "Register", "Quit");
	            return 1;
			}
			new hashpass[129], date[20], year, month, day, str[200];
			new    random_color = ( 16777216 * random( 256 ) ) + ( 65536 * random( 256 ) ) + ( 256 * random( 256 ) ) + 255;
			WP_Hash(hashpass, sizeof(hashpass), inputtext);
 			getdate(year, month, day);
			format(date, sizeof(date), "%d/%d/%d", day, month, year);
			new INI:File = INI_Open(UserPath(playerid));
			INI_SetTag(File, "Player's Data");
			INI_WriteString(File, "Password", hashpass);
			INI_WriteString(File, "Registered_On", date);
		 	INI_WriteInt(File,"Admin", 0);
            INI_WriteInt(File,"VIP", 0);
            INI_WriteInt(File,"Cash", 0);
            INI_WriteInt(File,"Score", 0);
            INI_WriteInt(File,"Kills", 0);
            INI_WriteInt(File,"Deaths", 0);
            INI_WriteInt(File, "Hours", 0);
			INI_WriteInt(File, "Minutes", 0);
            INI_Close(File);
            gTotalRegisters++;
            GivePlayerMoney(playerid, 100000);
            PlayerInfo[playerid][Hours] = 0;
            PlayerInfo[playerid][Minutes] = 0;
            PlayerInfo[playerid][POS_X] = -2355.9038;
            PlayerInfo[playerid][POS_Y] = -1635.4912;
            PlayerInfo[playerid][POS_Z] = 483.7031;
            PlayerInfo[playerid][Helmet] = 1;
            SendClientMessage(playerid, COLOR_PINK, ""PREMIUM"*** "LIGHTBLUE"Thank you for registering your account!");
            PlayerInfo[playerid][RegOn] = date;
            SpawnPlayer(playerid);
 		 	format(str, sizeof(str), ""RED"[EsF] {%06x}%s(%d) {2BD9F8}has registered, making the server have total {008FFB}%d {2BD9F8}players registered.", random_color >>> 8, GetName(playerid), playerid, gTotalRegisters);
 		 	SetPlayerColor(playerid, random_color);
            SendClientMessageToAll(0x2BD9F8FF, str);
           	new INI:FILE_SERVER_STATS = INI_Open(ServerStats);
           	INI_SetTag(FILE_SERVER_STATS, "Server_Statistics");
			INI_WriteInt(FILE_SERVER_STATS, "Total_Registered_Users", gTotalRegisters);
 			INI_Close(FILE_SERVER_STATS);
            PlayerInfo[playerid][Spawned] = 1;
            PlayerInfo[playerid][LoggedIn] = 1;
            TD_MSG(playerid, 3000, "~b~~h~You have successfully registered!~w~~b~~h~~n~~b~~h~$100000 bonus for registering!");
			new regInfo[300];
			format(regInfo, sizeof(regInfo), ""YELLOW"Hello!\n\n"GREEN"» Your nick: "YELLOW"%s\n"GREEN"\n"GREEN"» Your password: "YELLOW"%s\n\n"LIGHTGREEN"Never share your password with anyone!\nYou'll need it for logging next time.", GetName(playerid), inputtext);
 		 	ShowPlayerDialog(playerid, DIALOG_CONFIRM_REGISTER, DIALOG_STYLE_MSGBOX, ""RED"Register Info", regInfo, "OK", "");
            return 1;
		}
Reply
#6

Here:

PHP код:
WP_Hash(hashpasssizeof(hashpass), inputtext); 
If you delete here, you must delete all over, otherwise when the player will connect, its password (think "hello") will different to "46I8HE9Z0G0ZP7G5J4ZP3IG4258697Y4792HG924G".

You understand?

Nlx.
Reply
#7

Sorry, not understanded
Reply
#8

I've edit.

Breif, you must delete all over the WP_Hash if you want withdraw the hash password.

Nlx
Reply
#9

The password is hashed. i.e. for security reasons it is encoded to another format. ****** it.
Reply
#10

pawn Код:
if (dialogid == REGISTER)
    {
        if (!response) return Kick(playerid);
        if (response)
        {
            if (!strlen(inputtext))
            {
                ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, ""RED">> "PREMIUM"Account Register", ""WHITE"Welcome to "RED"Extreme Street Fighters"WHITE"!\n"WHITE"This account is "RED"not "WHITE"registered.\n\n"YELLOW"» Please enter a password below to register.", "Register", "Quit");
                return 1;
            }
            new hashpass[129], date[20], year, month, day, str[200];
            new    random_color = ( 16777216 * random( 256 ) ) + ( 65536 * random( 256 ) ) + ( 256 * random( 256 ) ) + 255;
            WP_Hash(hashpass, sizeof(hashpass), inputtext);
            getdate(year, month, day);
            format(date, sizeof(date), "%d/%d/%d", day, month, year);
            new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File, "Player's Data");
            INI_WriteString(File, "Password", inputtext); //it wont hash password now if you want to hash it change "inputtext" to "hashpass"
            INI_WriteString(File, "Registered_On", date);
            INI_WriteInt(File,"Admin", 0);
            INI_WriteInt(File,"VIP", 0);
            INI_WriteInt(File,"Cash", 0);
            INI_WriteInt(File,"Score", 0);
            INI_WriteInt(File,"Kills", 0);
            INI_WriteInt(File,"Deaths", 0);
            INI_WriteInt(File, "Hours", 0);
            INI_WriteInt(File, "Minutes", 0);
            INI_Close(File);
            gTotalRegisters++;
            GivePlayerMoney(playerid, 100000);
            PlayerInfo[playerid][Hours] = 0;
            PlayerInfo[playerid][Minutes] = 0;
            PlayerInfo[playerid][POS_X] = -2355.9038;
            PlayerInfo[playerid][POS_Y] = -1635.4912;
            PlayerInfo[playerid][POS_Z] = 483.7031;
            PlayerInfo[playerid][Helmet] = 1;
            SendClientMessage(playerid, COLOR_PINK, ""PREMIUM"*** "LIGHTBLUE"Thank you for registering your account!");
            PlayerInfo[playerid][RegOn] = date;
            SpawnPlayer(playerid);
            format(str, sizeof(str), ""RED"[EsF] {%06x}%s(%d) {2BD9F8}has registered, making the server have total {008FFB}%d {2BD9F8}players registered.", random_color >>> 8, GetName(playerid), playerid, gTotalRegisters);
            SetPlayerColor(playerid, random_color);
            SendClientMessageToAll(0x2BD9F8FF, str);
            new INI:FILE_SERVER_STATS = INI_Open(ServerStats);
            INI_SetTag(FILE_SERVER_STATS, "Server_Statistics");
            INI_WriteInt(FILE_SERVER_STATS, "Total_Registered_Users", gTotalRegisters);
            INI_Close(FILE_SERVER_STATS);
            PlayerInfo[playerid][Spawned] = 1;
            PlayerInfo[playerid][LoggedIn] = 1;
            TD_MSG(playerid, 3000, "~b~~h~You have successfully registered!~w~~b~~h~~n~~b~~h~$100000 bonus for registering!");
            new regInfo[300];
            format(regInfo, sizeof(regInfo), ""YELLOW"Hello!\n\n"GREEN"» Your nick: "YELLOW"%s\n"GREEN"\n"GREEN"» Your password: "YELLOW"%s\n\n"LIGHTGREEN"Never share your password with anyone!\nYou'll need it for logging next time.", GetName(playerid), inputtext);
            ShowPlayerDialog(playerid, DIALOG_CONFIRM_REGISTER, DIALOG_STYLE_MSGBOX, ""RED"Register Info", regInfo, "OK", "");
            return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)