ayuda con registro dini - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: Other languages (https://forum.open.mp/forumdisplay.php?fid=23) --- Forum: Spanish/Espa?ol (https://forum.open.mp/forumdisplay.php?fid=24) ---- Forum: Programaci?n (https://forum.open.mp/forumdisplay.php?fid=51) ---- Thread: ayuda con registro dini (/showthread.php?tid=1674) |
ayuda con registro dini - Nikolay_Staggs - 2021-02-16 tengo dos d?as tratando de resolver el problema pero no puedo, por que no se guardan los datos de los usuarios :) ?este es el c?digo"? //_____Enum______// enum DATA_PLAYER { ? ? GAME_IDENTIFICADO, ? ? GAME_REGISTRADO, GAME_EXP, GAME_ADMIN_LEVEL, GAME_SCORE, GAME_MONEY }; new PLAYER_INFO[MAX_PLAYERS][DATA_PLAYER]; //_________News__________// new GAME_PASSWORD_INCORRECTA[MAX_PLAYERS]; public OnPlayerConnect(playerid) { ? ? GAME_PASSWORD_INCORRECTA[playerid] = 0; ? ? ? ? new string[250]; ? ? if (fexist(ac_ARCHIBO_USER(playerid))) ? ? { PLAYER_INFO[playerid][GAME_REGISTRADO] = 1; ? ? } ? ? ? ? if (PLAYER_INFO[playerid][GAME_REGISTRADO]) ? ? { format(string, sizeof(string), "{CCCCCC}- Bienvenido %s.\n- Escribe tu contrase?a para identificarte", NAME_USER(playerid)); ? ShowPlayerDialog(playerid, DIALOG_INGRESO, DIALOG_STYLE_PASSWORD, ""#BLANCO"Ingreso", string, "Ingresar", "Salir"); ? ? } ? ? else ? ? { ? format(string, sizeof(string), "{CCCCCC}- Bienvenido %s.\n- Escribe una contrase?a para Registrarte", NAME_USER(playerid)); ? ShowPlayerDialog(playerid, DIALOGO_REGISTRO, DIALOG_STYLE_PASSWORD, ""#BLANCO"Registrar", string, "Ok", "Salir"); ? ? } ? ? ? ? RESET_USER(playerid); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { ? ? new string[250]; ? ? if(dialogid == DIALOGO_REGISTRO) ? ? { ? ? ? ? dini_Create(ac_ARCHIBO_USER(playerid)); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "contrase?a",? ? ? ? adler32(inputtext)); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Exp",? ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_EXP]); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Admin",? ? ? ? ? ? PLAYER_INFO[playerid][GAME_ADMIN_LEVEL]); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Score",? ? ? ? ? ? PLAYER_INFO[playerid][GAME_SCORE]); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Dinero",? ? ? ? ? ? PLAYER_INFO[playerid][GAME_MONEY]); ? ? ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_IDENTIFICADO] = 1; ? ? ? ? PLAYER_INFO[playerid][GAME_REGISTRADO] = 1; ? ? } ? ? else if(dialogid == DIALOG_INGRESO) ? ? { ? ? ? ? if (dini_Int(ac_ARCHIBO_USER(playerid), "Contrase?a") == adler32(inputtext)) ? ? ? ? { ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_IDENTIFICADO] = 1; ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_REGISTRADO] = 1; ? ? ? ? ? ? ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_EXP] = dini_Int? ? ? ? ? ? ? ? (ac_ARCHIBO_USER(playerid), "Exp"); ? ? ? ? ? ? PLAYER_INFO[playerid][GAME_ADMIN_LEVEL] = dini_Int? ? ? ? (ac_ARCHIBO_USER(playerid), "Admin"); ? ? ? ? ? ? SetPlayerScore(playerid, dini_Int? ? ? ? ? ? ? ? ? ? ? ? ? (ac_ARCHIBO_USER(playerid), "Score")); ? ? ? ? ? ? GivePlayerMoney(playerid, dini_Int? ? ? ? ? ? ? ? ? ? ? ? (ac_ARCHIBO_USER(playerid), "Dinero")); ? ? ? ? } ? ? ? ? else ? ? ? ? { ? ? ? ? ? ? GAME_PASSWORD_INCORRECTA[playerid]; ? ? ? ? ? ? format(string, sizeof(string), "{CCCCCC}- Por favor %s.\n- Ingresa una contrase?a correcta", NAME_USER(playerid)); ? ? ? ? ? ? ShowPlayerDialog(playerid, DIALOG_INGRESO, DIALOG_STYLE_PASSWORD, "{6F0000}Error", string, "Ok", "Salir"); ? ? ? ? ? ? if(GAME_PASSWORD_INCORRECTA[playerid] == MAX_PASSWORD_INVALIDA) ? ? ? ? ? ? { ? ? ? ? ? ? ? ? format(string,sizeof(string),"{6F0000}[Cuentas]: %s fue expulsado (Max intentos de ingresar(Contrase?a invalida))", NAME_USER(playerid)); ? ? ? ? ? ? ? ? SendClientMessageToAll(-1, string); ? ? ? ? ? ? ? ? SendClientMessage(playerid, -1, "** Haz puesto varias contrase?as incorrectas has sido kickeado del servidor por seguridad."); ? ? ? ? ? ? ? ? Kick(playerid); ? ? ? ? ? ? } ? ? ? ? } ? ? } ? ? return 1; } stock NAME_USER(playerid) { new User_Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, User_Name, sizeof(User_Name)); return User_Name; } stock ac_ARCHIBO_USER(playerid) { new User_Name[250]; GetPlayerName(playerid, User_Name, sizeof(User_Name)); format(User_Name, sizeof(User_Name), "DM_FREEROAM/%s.ini", User_Name); return User_Name; } stock SAVE_USER(playerid) { ? ? if(PLAYER_INFO[playerid][GAME_IDENTIFICADO]) ? ? { ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Exp",? ? ? ? ? PLAYER_INFO[playerid][GAME_EXP]); dini_IntSet(ac_ARCHIBO_USER(playerid), "Admin",? ? ? ? PLAYER_INFO[playerid][GAME_ADMIN_LEVEL]); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Score",? ? ? ? GetPlayerScore(playerid)); ? ? ? ? dini_IntSet(ac_ARCHIBO_USER(playerid), "Dinero",? ? ? ? GetPlayerMoney(playerid)); ? ? } ? ? return 1; } stock adler32(buf[]) { ? ? new len = strlen(buf), key1 = 1, key2 = 0, n; ? ? for (n = 0; n < len; n ) ? ? { ? ? ? ? key1 = (key1 buf[n])? % 65521; ? ? ? ? key2 = (key2 key1)? ? % 65521; ? ? } ? ? return (key2 << 16) key1; } stock RESET_USER(playerid) { ? ? PLAYER_INFO[playerid][GAME_IDENTIFICADO] = 0; ? ? PLAYER_INFO[playerid][GAME_REGISTRADO] = 0; ? ? PLAYER_INFO[playerid][GAME_EXP] = 0; ? ? PLAYER_INFO[playerid][GAME_ADMIN_LEVEL] = 0; ? ? PLAYER_INFO[playerid][GAME_SCORE] = 0; ? ? PLAYER_INFO[playerid][GAME_MONEY] = 0; ? ? return 1; } RE: ayuda con registro dini - Porkaslov - 2021-02-21 ?Que errores te indica, podr?as compartir alguna imagen de los errores? RE: ayuda con registro dini - Nikolay_Staggs - 2021-03-01 No guarda los datos de los usuarios |