Problema con MySQL
#1

Hola a todos, he empezado mi modo de juego desde 0 y tengo un par de problemas con el cargado de datos el cual me estб rompiendo la cabeza. Aquн va el cуdigo:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_INGRESO:
        {
            switch(response)
            {
                case 0:
                {
                    Kick(playerid);
                }
                case 1:
                {
                    if(!strcmp(jDJ[playerid][jClave], inputtext, false))
                    {
                        if(strlen(inputtext) >= 1)
                        {
                            if(jDJ[playerid][jLlegado] == 1)
                            {
                                TogglePlayerSpectating(playerid, 0);
                                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
                                SpawnPlayer(playerid);
                            }
                            else
                            {
                                SetPlayerPos(playerid, -1975.2808, 294.2735, 35.1719); // Aquн me falta toggleplayerspectating, ya lo sй.
                                SelectTextDraw(playerid, 0x00FF00FF);
                                PlayerTextDrawShow(playerid, Textdraw0[playerid]);
                                PlayerTextDrawShow(playerid, Textdraw1[playerid]);
                                PlayerTextDrawShow(playerid, Textdraw2[playerid]);
                                PlayerTextDrawShow(playerid, Textdraw3[playerid]);
                                PlayerTextDrawShow(playerid, Textdraw4[playerid]);
                                PlayerTextDrawShow(playerid, Textdraw5[playerid]);
                                format(Query, 356, "SELECT * FROM `servidor`.jugadores WHERE nombres='%s'", NombreJugador(playerid));
                                mysql_function_query(ConexionMySQL, Query, true, "CargarDatos", "ii", playerid, 0);
                                SetPlayerHealth(playerid, jDJ[playerid][jVida]);
                                SetPlayerArmour(playerid, jDJ[playerid][jChaleco]);
                            }
                        }
                    }
                }
            }
        }
    }
    return 1;
}
Callback:
pawn Код:
public CargarDatos(playerid, resultado)
{
    new Filas, Campos;
    cache_get_data(Filas, Campos);
   
    if(Filas == 1)
    {
        switch(resultado)
        {
            case 0:
            {
                new contenido[24];

                cache_get_field_content(0, "vida", contenido); jDJ[playerid][jVida] = floatstr(contenido);
                cache_get_field_content(0, "chaleco", contenido); jDJ[playerid][jChaleco] = floatstr(contenido);
                cache_get_field_content(0, "RecienLlegado", jDJ[playerid][jLlegado]);
                cache_get_field_content(0, "clave", jDJ[playerid][jClave]);
                SendClientMessage(playerid, -1, "Usuario reconocido.");
            }
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "tatatatatatata");
    }
    return 1;
}
Bien, el problema es que no carga los datos o sea que ninguna variable es afectada y todas continъan en 0. Espero haber sido explicativo y sino, pнdanme para volver a explicarlo.

PD: uso mysql plugin R7.
Reply


Messages In This Thread
Problema con MySQL - by Malganys - 30.10.2013, 04:32
Respuesta: Problema con MySQL - by Parka - 30.10.2013, 05:09
Respuesta: Problema con MySQL - by OTACON - 30.10.2013, 05:31
Respuesta: Problema con MySQL - by Malganys - 30.10.2013, 06:01
Respuesta: Problema con MySQL - by OTACON - 30.10.2013, 06:07
Respuesta: Problema con MySQL - by Malganys - 30.10.2013, 06:09
Respuesta: Problema con MySQL - by OTACON - 30.10.2013, 06:19
Respuesta: Problema con MySQL - by Malganys - 30.10.2013, 06:30
Respuesta: Problema con MySQL - by OTACON - 30.10.2013, 06:37
Respuesta: Problema con MySQL - by Malganys - 30.10.2013, 06:40

Forum Jump:


Users browsing this thread: 1 Guest(s)