[Ajuda] O que ta errado? Carregamento MYSQL
#1

O que estб errado com meu carregamento das casas, o login tambйm estб aprensentando o mesmo erro, ele estб funcioandno, mas fica dando isso:

pawn Код:
[20:35:08] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:35:08] [WARNING] cache_get_data - no active cache
[20:35:08] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:35:08] [WARNING] cache_get_data - no active cache
[20:35:08] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:35:08] [WARNING] cache_get_data - no active cache
[20:35:08] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:35:08] [WARNING] cache_get_data - no active cache
[20:35:08] [ERROR] "mysql_query" - invalid connection handle (id: 0)
[20:35:08] [WARNING] cache_get_data - no active cache
#define MAX_HOUSES 5
por isso repitiu 5 vezes

pawn Код:
CarregarCasas() {
    new string[128];
    for(new houseid; houseid < MAX_HOUSES; houseid++)
    {
        new query[1024], savestr[50], rows, fields;
        mysql_format(mysql, query, sizeof(query), "SELECT * FROM houses WHERE ID = %d", houseid);
        mysql_query(ConnectSQL,query);
        cache_get_data(rows, fields);
        if(rows)
        {
            cache_get_field_content(0, "ID", savestr);                  HouseInfo[houseid][ID] = strval(savestr);
            cache_get_field_content(0, "InPosX", savestr);              HouseInfo[houseid][InPosX] = strval(savestr);
            cache_get_field_content(0, "InPosY", savestr);              HouseInfo[houseid][InPosY] = strval(savestr);
            cache_get_field_content(0, "InPosZ", savestr);              HouseInfo[houseid][InPosZ] = strval(savestr);
            cache_get_field_content(0, "OutPosX", savestr);             HouseInfo[houseid][OutPosX] = strval(savestr);
            cache_get_field_content(0, "OutPosY", savestr);             HouseInfo[houseid][OutPosY] = strval(savestr);
            cache_get_field_content(0, "OutPosZ", savestr);             HouseInfo[houseid][OutPosZ] = strval(savestr);
            cache_get_field_content(0, "World", savestr);               HouseInfo[houseid][World] = strval(savestr);
            cache_get_field_content(0, "Price", savestr);               HouseInfo[houseid][Price] = strval(savestr);
            cache_get_field_content(0, "Owner", savestr);               HouseInfo[houseid][Owner] = strval(savestr);
            cache_get_field_content(0, "Locked", savestr);              HouseInfo[houseid][Locked] = strval(savestr);
            cache_get_field_content(0, "Dono", savestr);                HouseInfo[houseid][Dono] = strval(savestr);
            cache_get_field_content(0, "Money", savestr);               HouseInfo[houseid][Money] = strval(savestr);
            cache_get_field_content(0, "Maconha", savestr);             HouseInfo[houseid][Maconha] = strval(savestr);
            cache_get_field_content(0, "FHQ", savestr);                 HouseInfo[houseid][FHQ] = strval(savestr);
            cache_get_field_content(0, "Interior", savestr);            HouseInfo[houseid][Interior] = strval(savestr);
        }
   
        new casaavenda;
        if(HouseInfo[houseid][Owner] == 1) {
            casaavenda = 1272; // azul =  tem dono
        }
        else if(HouseInfo[houseid][Owner] == 0) {
            casaavenda = 1273; // verde =  a venda
        }
       
        new classhouse[30];
        if(HouseInfo[houseid][Interior] == 1) { classhouse = "Small House"; } // pequena
        else if(HouseInfo[houseid][Interior] == 8) { classhouse = "Average House"; } // media
        else if(HouseInfo[houseid][Interior] == 2) { classhouse = "Big House"; } // grande
        else if(HouseInfo[houseid][Interior] == 6) { classhouse = "Mansion"; } // mansгo
        else if(HouseInfo[houseid][Interior] == 5) { classhouse = "VIP"; }
        else { classhouse = "BUG"; }
       
        new door[30];
        if(HouseInfo[houseid][Locked] == 1) { door = "{ff0000}Locked"; }
        else if(HouseInfo[houseid][Locked] == 0) { door = "Open"; }
        else { door = "BUG"; }
       
        //new Pickup:casas[MAX_HOUSES];
        //new Text3D:casas[MAX_HOUSES];
        //DestroyPickup(Pickupcasas[houseid]);
        //Delete3DTextLabel(Text3Dcasas[houseid]);
       
        if(HouseInfo[houseid][Owner] == 0) {
            if(HouseInfo[houseid][Price] <= 10000) {
                format(string, sizeof(string), "House ID: %i\n{00ff00}For Sale!\n{FFFFFF}Class:%s\nValue:%iDPs\nDoor:%s",  HouseInfo[houseid][ID],  classhouse, HouseInfo[houseid][Price], door );
                Text3Dcasas[houseid] = Create3DTextLabel(string, 0xABDEACFF, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], 10.0, 0, 0);
            }
            if(HouseInfo[houseid][Price] > 10000) {
                format(string, sizeof(string), "House ID: %i\n{00ff00}For Sale!\n{FFFFFF}Class:%s\nValue:%i$\nDoor:%s",  HouseInfo[houseid][ID],  classhouse, HouseInfo[houseid][Price], door );
                Text3Dcasas[houseid] = Create3DTextLabel(string, 0xABDEACFF, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], 10.0, 0, 0);
            }
            Pickupcasas[houseid] = CreatePickup(casaavenda, 2, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], -1);
        }
        else if(HouseInfo[houseid][Owner] == 1) {
            if(HouseInfo[houseid][FHQ] == 1) {
                    new localFHQ = HouseInfo[houseid][FHQ];
                    format(string, sizeof(string), "Faction HQ\n id:%i %s", HouseInfo[houseid][FHQ], FactionInfo[localFHQ][facname] );
                    Text3Dcasas[houseid] = Create3DTextLabel(string, 0xABDEACFF, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], 10.0, 0, 0);
                    Pickupcasas[houseid] = CreatePickup(1254, 2, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], -1);
            }
            else {
                Pickupcasas[houseid] = CreatePickup(casaavenda, 2, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], -1);
                if(HouseInfo[houseid][Price] <= 10000) {
                    format(string, sizeof(string), "House ID: %i\nOwner:%s\nClass:%s\nValue:%iDPs\nDoor:%s", HouseInfo[houseid][ID],  HouseInfo[houseid][Dono], classhouse, HouseInfo[houseid][Price], door );
                    Text3Dcasas[houseid] = Create3DTextLabel(string, 0xABDEACFF, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], 10.0, 0, 0);
                }
                if(HouseInfo[houseid][Price] > 10000) {
                    format(string, sizeof(string), "House ID: %i\nOwner:%s\nClass:%s\nValue:%i$\nDoor:%s", HouseInfo[houseid][ID], HouseInfo[houseid][Dono], classhouse, HouseInfo[houseid][Price], door );
                    Text3Dcasas[houseid] = Create3DTextLabel(string, 0xABDEACFF, HouseInfo[houseid][OutPosX], HouseInfo[houseid][OutPosY], HouseInfo[houseid][OutPosZ], 10.0, 0, 0);
                }
            }
        }
    }
}
Reply


Messages In This Thread
O que ta errado? Carregamento MYSQL - by maikons - 08.01.2015, 22:17
Re: O que ta errado? Carregamento MYSQL - by valdirdd - 08.01.2015, 23:49
Re: O que ta errado? Carregamento MYSQL - by maikons - 09.01.2015, 02:43
Re: O que ta errado? Carregamento MYSQL - by valdirdd - 09.01.2015, 10:26
Re: O que ta errado? Carregamento MYSQL - by maikons - 09.01.2015, 23:00

Forum Jump:


Users browsing this thread: 2 Guest(s)