Quote:
Originally Posted by Code8976Man
Fнjate que compilas con el pawno que tiene los includes del 0.3c. Abrelo, y abre la gm desde ahн y prueba.
|
Si tambien crei que lo hacia desde otro pawno pero no
ya me fije bien jeje bueno aqui les va todo lo que hago
primero pongo el include Dini de DracoBlue:
despues pongo 2 defines:
Код:
#define Registro 0
#define Ingreso 1
despues una variable:
Код:
new Identificado[MAX_PLAYERS];
en onplayerconnect pongo esto:
Код:
Identificado[playerid] = 0;
new nombre[MAX_PLAYER_NAME], archivo[256];
GetPlayerName(playerid, nombre, sizeof(nombre));
format(archivo, sizeof(archivo), "/Usuarios/%s.ini", nombre);
if (!dini_Exists(archivo))
{
ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Ingresa tu contrasсea en el siguiente campo:", "Continuar", "Cancelar");
}
else
{
ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_INPUT, "Ingreso", "Ingresa tu contrasсea en el siguiente campo:", "Aceptar", "Cancelar");
}
despues me voy a ondialogresponse, la public la tengo asi:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
entre esa callback pongo esto:
Код:
if (dialogid == Registro)
{
new nombrejugador[MAX_PLAYER_NAME], archivo[256];
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Ingresa tu contrasсea en el siguiente campo:", "Continuar", "Cancelar");
if (!response) return ShowPlayerDialog(playerid, Registro, DIALOG_STYLE_INPUT, "Registro", "Ingresa tu contrasсea en el siguiente campo:", "Continuar", "Cancelar");
GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
format(archivo, sizeof(archivo), "/Usuarios/%s.ini", nombrejugador);
dini_Create(archivo);
dini_Set(archivo, "Usuario", nombrejugador);
dini_Set(archivo, "Contraseсa", inputtext);
ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_INPUT, "Ingreso", "Ingresa tu contrasсea en el siguiente campo:", "Aceptar", "Cancelar");
}
y despues:
Код:
if (dialogid == Ingreso)
{
new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_INPUT, "Ingreso", "Ingresa tu contrasсea en el siguiente campo:", "Aceptar", "Cancelar");
if (!response) return ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_INPUT, "Ingreso", "Ingresa tu contrasсea en el siguiente campo:", "Aceptar", "Cancelar");
GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
format(archivo, sizeof(archivo), "/Usuarios/%s.ini", nombrejugador);
format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Contraseсa"));
if (!strcmp (inputtext, comprobante))
{
Identificado[playerid] = 1;
}
else
{
ShowPlayerDialog(playerid, Ingreso, DIALOG_STYLE_INPUT, "Ingreso", "Ingresa tu contrasсea en el siguiente campo:", "Aceptar", "Cancelar");
}
}
y listo es todo
espero puedan ayudarme de antemano gracias