06.02.2018, 20:20
Hello, when someone connect to the server, it's showing me the dialog.
Code:
Code:
Код:
forward OnPlayerChecked(playerid); public OnPlayerChecked(playerid) { new DB_Query[115], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `users` WHERE `Username` = '%e'", pname); mysql_tquery(Database, DB_Query, "OnPlayerChecked2", "i", pInfo[playerid]); } forward OnPlayerChecked2(playerid); public OnPlayerChecked2(playerid) { new rows; cache_get_row_count(rows); if(rows) { SendClientMessage(playerid, COLOR_WHITE, ""alb"SERVER: "w"You already have a registered account, please enter your password into the dialog box."); cache_get_value(0, "Password", pInfo[playerid][Password], 65); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "SERVER: Login", "Welcome to OldStyle RPG.\n\nPlease enter your password below.", "Login", "Cancel"); } else { SendClientMessage(playerid, COLOR_WHITE, ""alb"SERVER: "w"You aren't registered yet, please your desired password in the dialog box to register."); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "SERVER: Registration", "Welcome to OldStyle RPG.\n\nPlease enter your desired password below.", "Register", "Cancel"); } TextDrawShowForPlayer(playerid, Text:blackbox); return 1; }