I don't understand the first GUI hidding by secont, when I connect I see first GUI 1sec and he disappears and when be login/registration.
pawn Код:
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Example","Test.","Continue","");
bancheck(playerid);
GetPlayerIp(playerid, PIP, 18);
format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' LIMIT 1", escpname(playerid), PIP);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0) {
new PIP2[18];
mysql_fetch_field_row(PIP2, "IP");
if(!strcmp(PIP, PIP2, true) && strlen(PIP2) != 0) {
SetPVarInt(playerid, "Logged", 1);
SendClientMessage(playerid, 0x009600AA, "Auto Logged in!");
if(mysql_fetch_row(line)) {
new data[3][55];
new data2[5];
sscanf(line, "p<|>s[50]s[300]dddds[50]ds[100]", data[0], largestring, data2[0], data2[1], data2[2], data2[3], data[2], data2[4], estring);
stringempty(estring);
stringempty(largestring);
SetPVarInt(playerid, "Kills", data2[0]);
SetPVarInt(playerid, "Logged", 1);
SetPVarInt(playerid, "Deaths", data2[1]);
SetPlayerScore(playerid, data2[2]);
GivePlayerMoney(playerid, data2[3]);
SetPVarInt(playerid, "AdminLevel", data2[4]);
mysql_free_result();
}
}
else {
SendClientMessage(playerid, 0x009600AA, "This account is registered, please login");
ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_INPUT , "Login", "This account is registered, please login", "OK", "Cancel");
}
}
else {
ShowPlayerDialog(playerid, 14600, DIALOG_STYLE_INPUT , "Register", "This account is not registered, please register!", "OK", "Cancel");
SendClientMessage(playerid, 0x009600AA, "This account is not registered, please register!");
}
mysql_free_result();
return 1;
}