Restart game after register
#1

Hi all.. when i choose "Ok" in dialog, my game will restart (bad connecting with the server) and when i connect again, dialog doesnt show for me... i dont understand it

Код:
	new path[256];
	format(path, sizeof(path), soubor, PlayerConnectName(playerid));
	if(fexist(path))
	{
	    SPD(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Prihlaseni", "{FFFFFF}Vнtejte zpбtky na serveru {ffd700}Mafia Roleplay{FFFFFF} přihlaљte se zadбnнm hesla prosнm!\n\nVytvořili:\n{FFFFFF}Pawner a maper: {00ffff}SweetCZ\n{FFFFFF}Testeři: {00ffff}TheTotifus, Ar3st, MiskulunCZ, Skrilex\n{FFFFFF}Webmaster: {00ffff}ManSlayer", "Ok", "Odejit");
	}
	else
	{
		SPD(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registrace", "{FFFFFF}Vнtejte na serveru {ffd700}Mafia Roleplay{FFFFFF} zaregistrujte se zadбnнm hesla prosнm!\n\nVytvořili:\n{FFFFFF}Pawner a maper: {00ffff}SweetCZ\n{FFFFFF}Testeři: {00ffff}TheTotifus, Ar3st, MiskulunCZ, Skrilex\n{FFFFFF}Webmaster: {00ffff}ManSlayer", "Ok", "Zavrit");
	}
Код:
	new path[256];
	format(path, sizeof(path), soubor, PlayerConnectName(playerid));
	if(dialogid == DIALOG_REGISTER)
	{
		if(response)
		{
			new pwlength = strlen(inputtext);
			if(pwlength > 0)
			{
			    new string[256];
				new File:RegFile = fopen(path, io_write);
				if(RegFile)
				{
				    strmid(Information[playerid][Heslo], inputtext, 0, strlen(inputtext), 255);
				    format(string, sizeof(string), "Heslo=%s", Information[playerid][Heslo]);
				    fwrite(RegFile, string);
				    fclose(RegFile);
					Information[playerid][NewRegister] = true;
					Mafia[playerid][ID] = 0;
					Mafia[playerid][Hodnost] = 0;
					Mafia[playerid][Sidlo] = 0;
					format(MafiaName[Mafia[playerid][ID]],24,"None");
					//---------------------------------------------------------
					Log(playerid, "Hrac se zaregistroval");
				}
			}
 			else
 			{
        		SPD(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registrace", "{FFFFFF}Zadejte heslo prosнm!", "Ok", "Zavrit");
 			}
		}
	}
Reply
#2

Is fopen(path, io_write); Created?
Reply
#3

Are you sure your scriptfiles folders are correct?
And what is this?
pawn Код:
format(path, sizeof(path), soubor, PlayerConnectName(playerid));
can you show me what soubor includes?
Reply
#4

Yes, i tested it with dini, DOF2 but problem is same.

Yea, folders are created ... #define soubor "/Mafia/Ucty/%s.sav"
Reply
#5

some idea please?
Reply
#6

When you're using a code that prevents the use of file save/load and the file isn't located in the correct folder/subfolder, the server can crash.

Mafia folder must be in /scriptfiles folder.
Ucty subfolder must be inside /Mafia folder.

So: /scriptfiles/Mafia/Ucty/%s.sav

Also, try to change from .sav to .ini to see if works.
Reply
#7

I have created folders, but server dont crash, only my game ... i connected to server, write password to register dialog and after clicking on button my game crashed (it write server restarting)
Reply
#8

It crashes only at you? Did you checked server_log?
Reply
#9

Yes, only me. But when some player want register.. he has same problem
Reply
#10

PM me the IP, i'll check it out.

EDIT: Give me your OnPlayerConnect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)