[Pawn] i have problem with easyDialog or mysql r41-4 - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] i have problem with easyDialog or mysql r41-4 (/showthread.php?tid=2454) |
i have problem with easyDialog or mysql r41-4 - lifehd326 - 2023-09-14 Dovada: https://www.youtube.com/watch?v=JI6VpCtqK2w public OnGameModeExit() { mysql_close(SQL); return 1; } public OnPlayerRequestClass(playerid) { return 1; } public OnPlayerConnect(playerid) { qQuery[0] = (EOS); mysql_format(SQL, qQuery, sizeof(qQuery), "SELECT * FROM `users` WHERE `Name` = '%e' LIMIT 1", GetPlayerNameEx(playerid)); mysql_pquery(SQL, qQuery, "CheckPlayerAccount", "d", playerid); PlayerInfo[playerid][pLoginTires] = 0; return 1; } function CheckPlayerAccount(playerid) { qString[0] = (EOS); switch(cache_num_rows()) { case 0: { format(qString, sizeof(qString), "Bine ai venit, %s.\nScrie o parola pentru a te inregistra:", GetPlayerNameEx(playerid)); Dialog_Show(playerid, DILOAG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", qString, "Register", "Quit"); } case 1: { format(qString, sizeof(qString), "Bine ai revenit, %s.\nScrie mai jos parola contului tau:", GetPlayerNameEx(playerid)); Dialog_Show(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", qString, "Login", "Quit"); } } return 1; } Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[]) { if(!response) return Kick(playerid); if(strlen(inputtext) < 8 || strlen(inputtext) > 32) return Dialog_Show(playerid, DILOAG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a te inregistra:\nNumarul de caractere trebuie sa fie format din 8 - 64", "Register", "Quit"); format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid)); format(PlayerInfo[playerid][pPassword], 128, inputtext); qQuery[0] = (EOS); mysql_format(SQL, qQuery, sizeof(qQuery), "INSERT INTO `users` (Name, Password) VALUES ('%e', '%e')", GetPlayerNameEx(playerid), inputtext); mysql_pquery(SQL, qQuery, "CheckSQLID", "d", playerid); Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-Mail", "Scrie mai jos adresa ta de e-mail:", "Ok", ""); return 1; } Dialog:DIALOG_EMAIL(playerid, response, listitem, inputtext[]) { if(!response) return Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-Mail", "Scrie mai jos adresa ta de e-mail:", "Ok", ""); if(strlen(inputtext) < 8 || strlen(inputtext) > 128 || !IsValidEmailAddress(inputtext)) return Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-Mail", "Scrie mai jos adresa ta de e-mail:\nAdresa de e-mail nu este valida.", "Ok", ""); qQuery[0] = (EOS); mysql_format(SQL, qQuery, sizeof(qQuery), "UPDATE `users` SET `Email` = `%e` WHERE `ID` = `%d`", PlayerInfo[playerid][pEmail], PlayerInfo[playerid][pSQLID]); mysql_tquery(SQL, qQuery, "", ""); return 1; } Dialog:DIALOG_LOGIN(playerid, response, listitem, inputtext[]) { if(!response) return Kick(playerid); qQuery[0] = (EOS); mysql_format(SQL, qQuery, sizeof(qQuery), "SELECT * FROM `users` WHERE `Name` = `%e` AND `Password` = `%e` LIMIT 1", GetPlayerNameEx(playerid), inputtext); mysql_pquery(SQL, qQuery, "OnPlayerLogin", "d", playerid); return 1; } function OnPlayerLogin(playerid) { switch(cache_num_rows()) { case 0: { PlayerInfo[playerid][pLoginTires] ++; if(PlayerInfo[playerid][pLoginTires] == 3) return Kick(playerid); } case 1: { cache_get_value_name_int(0, "pSQLID", PlayerInfo[playerid][pSQLID]); cache_get_value_name_int(0, "Name", PlayerInfo[playerid][pName]); cache_get_value_name_int(0, "Password", PlayerInfo[playerid][pPassword]); cache_get_value_name_int(0, "Email", PlayerInfo[playerid][pEmail]); } } return 1; } function CheckSQLID(playerid) { PlayerInfo[playerid][pSQLID] = cache_insert_id(); printf("New account: %s.", GetPlayerNameEx(playerid)); return 1; } RE: i have problem with easyDialog or mysql r41-4 - Radical - 2023-09-22 I watched your video. The errors are: Code: easyDialog.inc(95) : error 035 : argument type mismatch (argument 4) Check lines 95 and 98 of this include. |