if structure doesnt follow new commands
#1

Here is My Code
Код:
public OnPlayerConnect(playerid)
{
	new Query[80],pName[24];
 	GetPlayerName(playerid, pName, 24);
 	format(Query, sizeof(Query), "SELECT activate FROM users WHERE usid = '%s';", pName);
 	mysql_query(Query);
 	mysql_store_result();
 	if(mysql_fetch_int() == 0)
 	{
		SendClientMessage(playerid, COLOR_RED, "Your Character Is Not Approved Or Registered. Please Check Your User Control Panel.");
		SetTimerEx("nonregisterkck",1000,false,"i",playerid);
		mysql_free_result();
 	}
 	else if(mysql_fetch_int() == 1)
 	{
 	        mysql_free_result();
			new Query2[80];
			format(Query2, sizeof(Query2), "SELECT uspass FROM users Where usid = '%s';", pName);
			mysql_query(Query2);
			mysql_store_result();
			if(mysql_fetch_string() != 0)
			{
				ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Login","","Login","Cancel");
			}
			else if(mysql_fetch_string() == 0)
			{
				ShowPlayerDialog(playerid,11,DIALOG_STYLE_INPUT,"Set Password","","Set Password!","Cancel");
			}
 	}
 	return 1;
}
what i am trying to do is check if in database acticate column shows 1 if its 0 it will kick user if its 1 it will continue for checking if player set password before or if password area shows 0 right now let him set i have set the OnDialogResponse correctly im sure of it but i cant make dialogs show up after

Код:
else if(mysql_fetch_int() == 1)
 	{
 	        mysql_free_result();
			new Query2[80];
			format(Query2, sizeof(Query2), "SELECT uspass FROM users Where usid = '%s';", pName);
			mysql_query(Query2);
			mysql_store_result();
			if(mysql_fetch_string() != 0)
			{
				ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Login","","Login","Cancel");
			}
			else if(mysql_fetch_string() == 0)
			{
				ShowPlayerDialog(playerid,11,DIALOG_STYLE_INPUT,"Set Password","","Set Password!","Cancel");
			}
This code works and lets me log in instead of kicking
Код:
else if(mysql_fetch_int() == 1)
but this doesnt show up
Код:
if(mysql_fetch_string() != 0)
			{
				ShowPlayerDialog(playerid,10,DIALOG_STYLE_INPUT,"Login","","Login","Cancel");
			}
			else if(mysql_fetch_string() == 0)
			{
				ShowPlayerDialog(playerid,11,DIALOG_STYLE_INPUT,"Set Password","","Set
i cant get dialogs to show up!
Reply


Messages In This Thread
if structure doesnt follow new commands - by grymtn - 14.11.2016, 08:08
Re: if structure doesnt follow new commands - by iLearner - 14.11.2016, 08:10
Re: if structure doesnt follow new commands - by grymtn - 14.11.2016, 08:11
Re: if structure doesnt follow new commands - by iLearner - 14.11.2016, 08:12
Re: if structure doesnt follow new commands - by grymtn - 14.11.2016, 08:13
Re: if structure doesnt follow new commands - by Konstantinos - 14.11.2016, 08:26
Re: if structure doesnt follow new commands - by grymtn - 14.11.2016, 15:00

Forum Jump:


Users browsing this thread: 3 Guest(s)