Register Crash Problem
#1

Guys, when i try to register (after typing password) my sa-mp server.exe crashes.



Exception At Address: 0x0049417B Module: (samp-server.exe)



Registers:

EAX: 0x0018F818 EBX: 0x03048A98 ECX: 0x00000000 EDX: 0x004056C0

ESI: 0x00000000 EDI: 0x02509780 EBP: 0x0018F828 ESP: 0x0018F800

EFLAGS: 0x00010286



Stack:

+0000: 0x02509780 0x02509780 0x03048A98 0xFFFFFFFF

+0010: 0x0018F800 0x0018F240 0x0018FB4C 0x00497FE8

+0020: 0x004B2D50 0xFFFFFFFF 0x03048C34 0x004056CD

+0030: 0x00000000 0x004010B6 0x02509780 0x031DD7D4

+0040: 0x03054324 0x00402B63 0x02509780 0x00000005

+0050: 0x0018F868 0x031DD7D4 0x0018FB5C 0x02509780

+0060: 0x00000000 0x00000000 0x00000000 0x001894AC

+0070: 0x001894B0 0x001894FC 0x00185518 0x001894B8

+0080: 0x00185618 0x03048A98 0x03054324 0x00000000

+0090: 0x03048020 0x0000B88C 0x0046DE11 0x02509780

+00A0: 0x0018F8E8 0x00000000 0x02509780 0x00000000

+00B0: 0x02509780 0x00000000 0x02509780 0x00000001

+00C0: 0x02509780 0xFFFFFFFF 0x02509780 0x0018F904

+00D0: 0x0018F8EC 0x0018FA40 0x031D9824 0x00000000

+00E0: 0x0018FB41 0x02509780 0x00000000 0x031D9824

+00F0: 0x0048DAA2 0x00000000 0x00000000 0x00000001

+0100: 0xFFFFFFFF 0x00185500 0x02481020 0x0018FB68

+0110: 0x02480C01 0x00000000 0x0105F9A4 0x776BFFFF

+0120: 0x00000000 0x00000000 0x00000060 0x00000060

+0130: 0x00000058 0x0018FB68 0x00000000 0x00000010



here is the dialog code:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case DIALOG_REG:
	    {
	        if(!response)
	        {
	            PlayerInfo[playerid][pLoginAttempts]++;
	            if(PlayerInfo[playerid][pLoginAttempts] > MAX_LOGIN_FAIL)return KickEx(playerid, "ERRORE: Superato limite di tentavi Login");
				return ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "Registrazione", "ERRORE: La registrazione и obbligatoria.\nInserisci una password per registrarti", "Conferma", "");
			}
			if(strlen(inputtext) < MIN_LENGHT_PASS || strlen(inputtext) > MAX_LENGHT_PASS)
			{
			    PlayerInfo[playerid][pLoginAttempts]++;
			    if(PlayerInfo[playerid][pLoginAttempts] > MAX_LOGIN_FAIL)return KickEx(playerid, "ERRORE: Superato limite di tentavi Login");
			    format(tstring, sizeof(tstring), "ERRORE: Devi inserire una password compresa tra %d e %d caratteri.\nInserisci una password per registrarti", MIN_LENGHT_PASS, MAX_LENGHT_PASS);
			    return ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "Registrazione", tstring, "Conferma", "");
			}
			RegisterPlayer(playerid, inputtext);
	        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Bentornato!\nDigita la tua password per effettuare il login", "Conferma", "");
	    }
And this is the RegisterPlayer stock:
Код:
stock RegisterPlayer(playerid, password[])
{
	dfile_Create(PlayerFile(playerid));
	SavePlayerPass(playerid, password);
    GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
    PlayerInfo[playerid][pPos][0] = -188.655105;
    PlayerInfo[playerid][pPos][1] = 941.477600;
    PlayerInfo[playerid][pPos][2] = 15.380722;
    PlayerInfo[playerid][pPos][3] = 355.891571;
	PlayerInfo[playerid][pInterior] = 0;
	PlayerInfo[playerid][pWorld] = 0;
	PlayerInfo[playerid][pLevel] = 1;
	PlayerInfo[playerid][pAdminLevel] = 0;
	PlayerInfo[playerid][pExp] = 0;
	PlayerInfo[playerid][pMoney] = 500;
	PlayerInfo[playerid][pSkin] = 1;
	for(new i; i<4; i++)
	{
		PlayerInfo[playerid][pPos][i] = 0.0;
	}
	PlayerInfo[playerid][pHP] = 100;
	PlayerInfo[playerid][pAP] = 0;
	PlayerInfo[playerid][pBanned] = false;
	format(PlayerInfo[playerid][pBannedReason], MAX_BAN_REASON, "");
	SavePlayer(playerid);
}
Reply
#2

Can i have a look at the "SavePlayerPass(playerid, password);" function?

And does the login dialog show up before it crashes ? Or does it crash before that happens ?
Reply
#3

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
Can i have a look at the "SavePlayerPass(playerid, password);" function?

And does the login dialog show up before it crashes ? Or does it crash before that happens ?
It crashes before login dialog

Код:
 stock SavePlayerPass(playerid, password[])
{
	dfile_Open(PlayerFile(playerid));
	dfile_WriteString("Password", password);
	dfile_SaveFile();
	dfile_CloseFile();
	return 1;
}
Reply
#4

Okay so;
simple things - did you create a directory for saving the files into? (scriptfiles) ? (did you create a folder named exactly as in the script)
if you did;
can you add debug-messages into the registerplayer stock, so we could find out where it stops working?
Reply
#5

Your player files save in any folder?
Reply
#6

I failed to name the users directory, what a noob.

thx everyone
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)