SA-MP Forums Archive
Server Shutsdown / Crashes When i Connect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server Shutsdown / Crashes When i Connect (/showthread.php?tid=173196)



Server Shutsdown / Crashes When i Connect - Gforcez - 01.09.2010

Hello,
When a Player connects to my server. The Server Shuts down, But i don't know why:

My OnPlayerConnect:

Код:
public OnPlayerConnect(playerid)
{
	GetPlayerName(playerid, Playername[playerid], MAX_PLAYER_NAME);
	
    CheckPlayerAccount(playerid);

	return 1;
}
My CheckPlayerAccount(playerid);

Код:
public CheckPlayerAccount(playerid)
{
	new EscapedName[MAX_PLAYER_NAME];
	new Query[128];
	
	mysql_real_escape_string(Playername[playerid], EscapedName);
	format(Query, sizeof(Query), "SELECT `id` FROM `%s` WHERE `pName` = '%s'", DB_USER_TABLE, EscapedName);
	mysql_query(Query);
	
	mysql_store_result();
	
	if(mysql_num_rows() >= 1)
	{
        PlayerInfo[playerid][pID] = mysql_fetch_int();
        mysql_free_result();
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Underground Roleplay - Account Login", "Please Login using your password", "Login", "Quit");
	}
	else
	{
	    mysql_free_result();
	    format(Query, 128, "Welcome to Underground Roleplay, %s \n\nPlease enter your password so we can create your account.",Playername[playerid]);
	    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Underground Roleplay - Account Registration", "Welcome, Please type in a password", "Register", "Quit");
		return 1;
	}
	return 1;
}
Does Someone know whats Wrong ?

Greetingz,
Gforcez


Re: Server Shutsdown / Crashes When i Connect - Gforcez - 02.09.2010

Please Someone?


Re: Server Shutsdown / Crashes When i Connect - Scenario - 02.09.2010

I had a similar issue. If you haven't done so already, try to "drop" all of the account data within your MySQL database. So if you have an "Accounts" table, delete all of the user accounts in it. Hope this helps!


Re: Server Shutsdown / Crashes When i Connect - Gforcez - 02.09.2010

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I had a similar issue. If you haven't done so already, try to "drop" all of the account data within your MySQL database. So if you have an "Accounts" table, delete all of the user accounts in it. Hope this helps!
Well, i have no accounts init, Thats the weirdest.


Re: Server Shutsdown / Crashes When i Connect - Scenario - 02.09.2010

Have you check 'mysql_log.txt' or 'server_log.txt'? You might also have 'crashinfo.txt'...