MySQL: Vehicles don't load...
#1

Well, I'm having a problem similar to this. Just that my problem is, nothing after "Created Vehicle..." loads, but if I remove from 'Attach3DTextLabelToVehicle' up to the "Created Vehicle..." it works. I use a print to see what's going on (when I mean it works, I mean it prints the rest till the code ends)

pawn Код:
stock LoadDealers()
{
    mysql_query("SELECT * FROM dealers");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        if(mysql_num_rows())
        {
            print("------------------------- ");
            print("Dealer Vehicles Loading...");
            mysql_fetch_row_format(row, "|");
            explode(row, field, "|");
            new color1,color2,model,vehid;
            model = strval(field[2]);
            X = strval(field[3]);
            Y = strval(field[4]);
            Z = strval(field[5]);
            A = strval(field[6]);
            color1 = strval(field[7]);
            color2 = strval(field[8]);
            vehid = CreateVehicle(model,X,Y,Z,A,color1,color2,1);
            print("Created Vehicle...");
            DealerInfo[vehid][VehID] = strval(field[0]);
            format(DealerInfo[vehid][VehName],32,"%s",field[1]);
            DealerInfo[vehid][VehPrice] = strval(field[9]);
            DealerInfo[vehid][VehInsurance] = strval(field[10]);
            DealerInfo[vehid][DealerSpawnX] = strval(field[11]);
            DealerInfo[vehid][DealerSpawnY] = strval(field[12]);
            DealerInfo[vehid][DealerSpawnZ] = strval(field[13]);
            DealerInfo[vehid][DealerSpawnA] = strval(field[14]);
            format(String,sizeof(String),"Name: %s\nPrice: %i\nID: %i",DealerInfo[vehid][VehName],DealerInfo[vehid][VehPrice],DealerInfo[vehid][VehID]);
            DealerInfo[vehid][VehText] = Create3DTextLabel(String,White,X,Y,Z,50.0,0,0);
            Attach3DTextLabelToVehicle(DealerInfo[vehid][VehText],DealerInfo[vehid][Vehicle],0.0,0.0,0.0);
            print("Dealer Vehicles Loaded");
            print("------------------------- ");
            mysql_free_result();
        }
    }
    return 1;
}
Somehow I fixed it, not sure what I did yet but......I fixed it. And thanks to Sascha for enduring the pain with me too lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)