Consulta sobre dialog y variables.
#1

Tengo una duda con esto, їcomo puedo ir guardando valores enteros y de tipo string del dialog para luego recuperarlos en una funcion?

EJ:

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Ingrese su clave", "Su clave debe contener letras y numeros.", "Siguiente", "");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            // їAqui deberia guardar la clave en una variable de tipo string?
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Ingrese su edad", "Pulsa siguiente.", "Siguiente", "");
        }
    }
    if(dialogid == 2)
    {
        if(response)
        {
            // їAqui deberia guardar la edad en una variable de tipo entero?
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Seleccione su genero", "Hombre\nMujer.", "Siguiente", "");
        }
    }
    if(dialogid == 3)
    {
        switch (listitem)
        {
            case 0:
            {
                // Es hombre
                // їAqui deberia guardar la edad en una variable de tipo entero?
                // Ejecuto una funcion
                GuardarDatos(playerid);
            }
            case 1:
            {
                // Es mujer
                // їAqui deberia guardar la edad en una variable de tipo entero?
                // Ejecuto una funcion
                GuardarDatos(playerid);
            }
        }
    }
    return 1;
}

stock GuardarDatos(playerid)
{
    // Aqui quiero recuperar los datos almacenados en las variables, luego pienso hacer un INSERT a una tabla de MYSQL con los datos de las variables
    // їComo podria hacer eso?
}
Agradezco algun ejemplo con SetPVar* y GetPVar* en int y string, tambiйn con Enum.

Gracias
Reply


Messages In This Thread
Consulta sobre dialog y variables. - by YazukiAkira - 01.07.2014, 21:15
Respuesta: Consulta sobre dialog y variables. - by Kemula - 01.07.2014, 23:01
Respuesta: Consulta sobre dialog y variables. - by YazukiAkira - 02.07.2014, 01:38
Respuesta: Consulta sobre dialog y variables. - by Kemula - 02.07.2014, 08:09

Forum Jump:


Users browsing this thread: 2 Guest(s)