14.11.2016, 08:08
Here is My Code
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
This code works and lets me log in instead of kicking
but this doesnt show up
i cant get dialogs to show up!
Код:
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; }
Код:
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"); }
Код:
else if(mysql_fetch_int() == 1)
Код:
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