Having a few scripting questions.
#10

Yeah I noticed, but only after I posted that.. therefor the edit :P

Anyways, I have one more question (note: here comes the question that proves I'm a total starter in this scripting/programming).

I have a function that creates the login screen:
Код:
public OnPlayerConnect(playerid)
{
	new query[126], pName[MAX_PLAYER_NAME];
	
	GetPlayerName(playerid, pName, sizeof(pName));
	
	format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s'", pName);
	mysql_query(query);
	mysql_store_result();
	new rows = mysql_num_rows();
	
	printf("There are %s rows in table1",rows);
	
	if(mysql_num_rows() ==1)
	{
		SendClientMessage(playerid, -1, "That username is registered!");
		ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "Login", "Please login with the password you made", "Login", "Cancel");
	}
	else
	{
		SendClientMessage(playerid, -1, "That username is not registered. You may register it");
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Register", "Please enter a password for your account", "Register", "Cancel");
	}
	return 1;
}
Now I would like to create the logout command, except I have no idea how I make it return to the public OnPlayerConnect(playerid) function.
I tried return OnPlayerConnect, but that doesn't work... My simplistic brain
Код:
CMD:logout(playerid)
{
	return 1;
}
Reply


Messages In This Thread
Having a few scripting questions. - by dragonslife - 22.11.2013, 15:56
Re: Having a few scripting questions. - by Konstantinos - 22.11.2013, 16:00
Re: Having a few scripting questions. - by dragonslife - 22.11.2013, 16:20
Re: Having a few scripting questions. - by RajatPawar - 22.11.2013, 16:24
Re: Having a few scripting questions. - by Konstantinos - 22.11.2013, 16:26
Re: Having a few scripting questions. - by dragonslife - 22.11.2013, 16:49
Re: Having a few scripting questions. - by Konstantinos - 22.11.2013, 17:04
Re: Having a few scripting questions. - by dragonslife - 22.11.2013, 17:18
Re: Having a few scripting questions. - by Konstantinos - 22.11.2013, 17:26
Re: Having a few scripting questions. - by dragonslife - 22.11.2013, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)