Ayuda [Alguien que sepa manejarse en dialogos ayudeme :(]
#1

Buenas, bueno eh visto varios tutoriales que explican como poner el Registro e Ingreso con Dialogo la verdad funcionan al 100%, bueno pero lo que yo ando buscando no es un Fs ni tampoco un tutorial que diga como hacer Registro e Ingreso con dialogo, lo que yo ando buscando es como poner el Registro e Ingreso con dialogo en un Fs de Administracion (badmin) ese Fs de administracion ya tiene los comandos de Registro e Ingreso entonces me gustaria saber como ponerlos en dialogo simplemente eso D:.

Bueno ojala me puedan ayudar y quien tenga la intencion de ayudarme que me de su hotmail porfis

O simplemente que me ayuden desde aqui mismo

Los comandos del Registro e Ingreso son estos:

Код:
	if (strcmp("/registro", cmd, true) == 0)
	{
		new tmp[256], usuario[MAX_PLAYER_NAME], archivo[256], string[256];
		tmp = strtok(cmdtext, idx);
		GetPlayerName(playerid, usuario, sizeof(usuario));
		format(archivo, sizeof(archivo), "Badmin/Usuarios/%s.ini", usuario);
    if (dini_Exists(archivo)) return SendClientMessage(playerid, COLOR_ROJO, "Tu nombre ya se encuentra registrado. Usa /ingreso [contraseсa] para ingresar.");
    if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_ROJO, "Usa: /registro [Contraseсa].");
    if (strlen(tmp) < 4 || strlen(tmp) > 12) return SendClientMessage(playerid, COLOR_ROJO, "Su contraseсa debe contener entre 4 y 12 caracteres.");
		dini_Create(archivo);
		dini_Set(archivo, "Usuario", usuario);
		dini_Set(archivo, "Contraseсa", cmdtext[10]);
		dini_IntSet(archivo, "Baneado", 0);
		dini_IntSet(archivo, "NivelAdmin", 0);
		dini_IntSet(archivo, "Asesinatos", 0);
		dini_IntSet(archivo, "Muertes", 0);
		dini_IntSet(archivo, "Puntaje", GetPlayerScore(playerid));
		dini_IntSet(archivo, "Dinero", GetPlayerMoney(playerid));
		dini_IntSet(archivo, "PosGuardada(X)", 0);
		dini_IntSet(archivo, "PosGuardada(Y)", 0);
		dini_IntSet(archivo, "PosGuardada(Z)", 0);
		dini_IntSet(archivo, "PosGuardada(Angulo)", 0);
		format(string, sizeof(string), "Te has registrado correctamente! Usa /ingreso %s para ingresar.", cmdtext[10]);
		SendClientMessage(playerid, COLOR_VERDE_OSCURO, string);
		PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
		return 1;
	}
	if (strcmp("/ingreso", cmd, true) == 0)
	{
	  new tmp[256], archivo[256], usuario[MAX_PLAYER_NAME], comprobante1[256], comprobante2[256], string[256];
	  tmp = strtok(cmdtext, idx);
	  GetPlayerName(playerid, usuario, sizeof(usuario));
		format(archivo, sizeof(archivo), "Badmin/Usuarios/%s.ini", usuario);
    if (Ingreso[playerid] == 1) return SendClientMessage(playerid, COLOR_ROJO, "Ya te encuentras identificado.");
    if (!dini_Exists(archivo)) return SendClientMessage(playerid, COLOR_ROJO, "Tu nombre no se encuentra registrado. Usa /registro [contraseсa] para registrarte.");
    if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_ROJO, "Usa /ingreso [Contraseсa].");
		format(comprobante1, sizeof(comprobante1), "%s", cmdtext[9]);
		format(comprobante2, sizeof(comprobante2), "%s", dini_Get(archivo, "Contraseсa"));
		if (!strcmp(comprobante1, comprobante2))
		{
			if (dini_Int(archivo, "Baneado") == 0)
			{
				Ingreso[playerid] = 1;
				NivelAdmin[playerid] = dini_Int(archivo, "NivelAdmin");
				SetPlayerScore(playerid, dini_Int(archivo, "Puntaje"));
				GivePlayerMoney(playerid, dini_Int(archivo, "Dinero")-GetPlayerMoney(playerid));
				SendClientMessage(playerid, COLOR_VERDE_OSCURO, "Has ingresado correctamente!");
				PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
				if (NivelAdmin[playerid] == 1 || NivelAdmin[playerid] == 2 || NivelAdmin[playerid] == 3 || NivelAdmin[playerid] == 4 || NivelAdmin[playerid] == 5)
				{
				  EsAdmin[playerid] = 1;
				}
			}
			else
			{
				format(string, sizeof(string), "%s ha sido auto-kickeado. (Razon: Usuario baneado.)", usuario);
				SendClientMessageToAll(COLOR_NARANJA, string);
				Kick(playerid);
			}
		}
		else return SendClientMessage(playerid, COLOR_ROJO, "Contraseсa incorrecta.");
		return 1;
	}
Esos son los comando y les ruego que me expliquen como poner los dialogos en el registro tanto como en el ingreso y que debo poner en OnDialogResponse

De ante mano mushisimas gracias ^^
Reply
#2

Serнa algo asн en el /registrar:
pawn Код:
if(strcmp(cmdtext, "/registrar", true) == 0)
{
ShowPlayerDialog(playerid, [ID del Dialog(nъmero)], "Registro", "Introduzca una contraseсa para registrarte:", "Registrar", "Cancelar");
return 1;
}
El login serнa algo parecido, cambiбndo 4 cosas.
Y, en OnPlayerDialogResponse, deberнas poner йsto, o adaptarlo:
pawn Код:
if(dialogid == [ID del Dialog(nъmero)])
{
new tmp[256], usuario[MAX_PLAYER_NAME], archivo[256], string[256];
        tmp = strtok(cmdtext, idx);
        GetPlayerName(playerid, usuario, sizeof(usuario));
        format(archivo, sizeof(archivo), "Badmin/Usuarios/%s.ini", usuario);
    if (dini_Exists(archivo)) return SendClientMessage(playerid, COLOR_ROJO, "Tu nombre ya se encuentra registrado. Usa /ingreso [contraseсa] para ingresar.");
    if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_ROJO, "Usa: /registro [Contraseсa].");
    if (strlen(tmp) < 4 || strlen(tmp) > 12) return SendClientMessage(playerid, COLOR_ROJO, "Su contraseсa debe contener entre 4 y 12 caracteres.");
        dini_Create(archivo);
        dini_Set(archivo, "Usuario", usuario);
        dini_Set(archivo, "Contraseсa", cmdtext[10]);
        dini_IntSet(archivo, "Baneado", 0);
        dini_IntSet(archivo, "NivelAdmin", 0);
        dini_IntSet(archivo, "Asesinatos", 0);
        dini_IntSet(archivo, "Muertes", 0);
        dini_IntSet(archivo, "Puntaje", GetPlayerScore(playerid));
        dini_IntSet(archivo, "Dinero", GetPlayerMoney(playerid));
        dini_IntSet(archivo, "PosGuardada(X)", 0);
        dini_IntSet(archivo, "PosGuardada(Y)", 0);
        dini_IntSet(archivo, "PosGuardada(Z)", 0);
        dini_IntSet(archivo, "PosGuardada(Angulo)", 0);
        format(string, sizeof(string), "Te has registrado correctamente! Usa /ingreso %s para ingresar.", cmdtext[10]);
        SendClientMessage(playerid, COLOR_VERDE_OSCURO, string);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        return 1;
    }
    if (strcmp("/ingreso", cmd, true) == 0)
    {
      new tmp[256], archivo[256], usuario[MAX_PLAYER_NAME], comprobante1[256], comprobante2[256], string[256];
      tmp = strtok(cmdtext, idx);
      GetPlayerName(playerid, usuario, sizeof(usuario));
        format(archivo, sizeof(archivo), "Badmin/Usuarios/%s.ini", usuario);
    if (Ingreso[playerid] == 1) return SendClientMessage(playerid, COLOR_ROJO, "Ya te encuentras identificado.");
    if (!dini_Exists(archivo)) return SendClientMessage(playerid, COLOR_ROJO, "Tu nombre no se encuentra registrado. Usa /registro [contraseсa] para registrarte.");
    if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_ROJO, "Usa /ingreso [Contraseсa].");
        format(comprobante1, sizeof(comprobante1), "%s", cmdtext[9]);
        format(comprobante2, sizeof(comprobante2), "%s", dini_Get(archivo, "Contraseсa"));
        if (!strcmp(comprobante1, comprobante2))
        {
            if (dini_Int(archivo, "Baneado") == 0)
            {
                Ingreso[playerid] = 1;
                NivelAdmin[playerid] = dini_Int(archivo, "NivelAdmin");
                SetPlayerScore(playerid, dini_Int(archivo, "Puntaje"));
                GivePlayerMoney(playerid, dini_Int(archivo, "Dinero")-GetPlayerMoney(playerid));
                SendClientMessage(playerid, COLOR_VERDE_OSCURO, "Has ingresado correctamente!");
                PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                if (NivelAdmin[playerid] == 1 || NivelAdmin[playerid] == 2 || NivelAdmin[playerid] == 3 || NivelAdmin[playerid] == 4 || NivelAdmin[playerid] == 5)
                {
                  EsAdmin[playerid] = 1;
                }
            }
            else
            {
                format(string, sizeof(string), "%s ha sido auto-kickeado. (Razon: Usuario baneado.)", usuario);
                SendClientMessageToAll(COLOR_NARANJA, string);
                Kick(playerid);
            }
        }
        else return SendClientMessage(playerid, COLOR_ROJO, "Contraseсa incorrecta.");
}
Y loguear, serнa algo parecido.Usa otros FS ya creados para guiarte.
Reply
#3

Yo te recomendaria usar el LuxAdmin

es muy bueno (ya trae registro y logueo con dialogs)

suerte
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)