Problem with Login/Register
#7

No logs or any error in mysql_log

But i don't understand why it's crashing when the player join with "playerid"

EDIT: I changed code to:

Код:
public OnPlayerConnect(playerid)
{
	TogglePlayerSpectating(playerid, true);

	GetPlayerName(playerid, pInfo[playerid][Name], MAX_PLAYER_NAME);
	pInfo[playerid][RemainingAtt] = 3;
	pInfo[playerid][pCash] = 120000;
	pInfo[playerid][pAdmin] = 0;
	pInfo[playerid][pHelper] = 0;
	pInfo[playerid][pRespect] = 0;
	pInfo[playerid][pHours] = 0;

	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, " ");
	SendClientMessage(playerid, COLOR_DEFAULT, ""alb"SERVER: "w"Welcome to OldStyle RPG.");
	
	GameTextForPlayer(playerid, "~r~CHECKING BAN STATUS...", 3000, 3);
	SetTimer("OnPlayerChecked", 3500, 0);
	return 1;
}

forward OnPlayerChecked(playerid); 
public OnPlayerChecked(playerid)
{
	new DB_Query[115], pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `users` WHERE `Username` = '%e'", pname);
	mysql_query(Database, DB_Query);

	new rows;
    cache_get_row_count(rows);
	if(rows)
	{	
		SendClientMessage(playerid, COLOR_WHITE, ""alb"SERVER: "w"You already have a registered account, please enter your password into the dialog box.");
		cache_get_value(0, "Password", pInfo[playerid][Password], 65);
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "SERVER: Login", "Welcome to OldStyle RPG.\n\nPlease enter your password below.", "Login", "Cancel");
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, ""alb"SERVER: "w"You aren't registered yet, please your desired password in the dialog box to register.");
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "Welcome to OldStyle RPG.\n\nPlease enter your desired password below.", "Register", "Cancel");
	}
	TextDrawShowForPlayer(playerid, Text:blackbox);
	return 1;
}
And still not working, it will show me the dialogs again
Reply


Messages In This Thread
Problem with Login/Register - by C0oL3r - 06.02.2018, 20:20
Re: Problem with Login/Register - by Private200 - 06.02.2018, 20:34
Re: Problem with Login/Register - by C0oL3r - 06.02.2018, 20:41
Re: Problem with Login/Register - by Private200 - 06.02.2018, 20:51
Re: Problem with Login/Register - by C0oL3r - 06.02.2018, 21:00
Re: Problem with Login/Register - by Private200 - 07.02.2018, 11:48
Re: Problem with Login/Register - by C0oL3r - 07.02.2018, 17:04
Re: Problem with Login/Register - by C0oL3r - 07.02.2018, 17:12
Re: Problem with Login/Register - by Private200 - 07.02.2018, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)