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
#2

format(Query, sizeof(Query), "SELECT activate FROM users WHERE usid = '%s';", pName);

Damn son... remove that shit
Reply
#3

if i remove that i cant see if account is activated and it will let everyone login even if their account is activated or not
Reply
#4

The freaking query wont work with that thing....
Reply
#5

that activate query works so do i have to delete that query for new one ? is there any other way ?
Reply
#6

https://sampwiki.blast.hk/wiki/MySQL_Pl...l_fetch_string

The first parameter is a string to store the text (password in your case). You should consider switching to BlueG's latest version (it will take a while, but it's worth it) eventually because there's simply no support for old and oudated plugins.

Quote:
Originally Posted by iLearner
Посмотреть сообщение
format(Query, sizeof(Query), "SELECT activate FROM users WHERE usid = '%s';", pName);

Damn son... remove that shit
Semicolon is valid at the end of the query, we just don't use it because multi-statements were not enabled in the old versions so it wasn't necessary.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The first parameter is a string to store the text (password in your case). You should consider switching to BlueG's latest version (it will take a while, but it's worth it) eventually because there's simply no support for old and oudated plugins.
I was using strickenboy's. Thanks for the headsup but i feel totally stupid when i look into that a_mysql.inc
This is so different to me and i found a tutorial which is very explanative to some people while it made me understand nothing
Can i get any more help about this mysql plugin ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)