MYSQL R7 Loading problem
#1

pawn Код:
case THREAD_LOAD_FACVEHS:
        {
            for(new row = 0; row < szRows; ++row)
            {
                for(new iFac = 1; iFac < MAX_FACTION; iFac++)
                {
                    cache_get_field_content(0,"model_id", szResult); FactionVehicleInfo[iFac][row][fVI_ModelID] = strval(szResult);
                    cache_get_field_content(0,"colour_1", szResult); FactionVehicleInfo[iFac][row][fVI_Colours][0] = strval(szResult);
                    cache_get_field_content(0,"colour_2", szResult); FactionVehicleInfo[iFac][row][fVI_Colours][1] = strval(szResult);
                    cache_get_field_content(0,"upkeep", szResult); FactionVehicleInfo[iFac][row][fVI_upKeep] = strval(szResult);
                    cache_get_field_content(0,"rank_needed", szResult); FactionVehicleInfo[iFac][row][fVI_vehRank] = strval(szResult);
                    cache_get_field_content(0,"posX", szResult); FactionVehicleInfo[iFac][row][fVI_vPos][0] = floatstr(szResult);
                    cache_get_field_content(0,"posY", szResult); FactionVehicleInfo[iFac][row][fVI_vPos][1] = floatstr(szResult);
                    cache_get_field_content(0,"posZ", szResult); FactionVehicleInfo[iFac][row][fVI_vPos][2] = floatstr(szResult);
                    cache_get_field_content(0, "posA", szResult); FactionVehicleInfo[iFac][row][fVI_vPos][3] = floatstr(szResult);

                    FactionVehicleInfo[iFac][row][fVI_vID] = CreateVehicle(FactionVehicleInfo[iFac][row][fVI_ModelID], FactionVehicleInfo[iFac][row][fVI_vPos][0], FactionVehicleInfo[iFac][row][fVI_vPos][1], FactionVehicleInfo[iFac][row][fVI_vPos][2], FactionVehicleInfo[iFac][row][fVI_vPos][3], FactionVehicleInfo[iFac][row][fVI_Colours][0], FactionVehicleInfo[iFac][row][fVI_Colours][1], -1);
                }
                printf("%d Rows", szRows);
            }
            print("[SERVER]: Faction Vehicles have been loaded.");
        }
Okay, lemme explain the enumerator:

FactionVehicleInfo[MAX_FACTIONS (fac id basically)] [ MAX_FACTION_VEHICLES (veh slot in the max_fac_vehicles)]

Okay, I have 3 vehicles in the database - ONE FBI Rancher, a Sultan and a Bullet and when the vehicles load, it loads THREE FBI Ranchers, instead of the individual models and it also loads all THREE FBI Ranchers into faction slot 0 when the bullet is meant to be in 1 and the sultan is meant to be in 2

Appreciate anyone who trys to help, thank you!

Having this problem for awhile now
Reply
#2

You're always getting the first row (0).

pawn Код:
cache_get_field_content(row, const field_name[], dest[], connectionHandle = 1)
                // row!! /\
Reply
#3

How could I fix it then?
Reply
#4

The rows are like:

Row 0: Name
Row 1: Password
Row 2: Money
Row 3: Kills
Row 4: Deaths

Something like that, but you gotta edit the cache_get_field_contant with your own Row of your SQL table.
Reply
#5

All of that data loads fine, its just the vehicles messing up
Reply
#6

Anyone?
Reply
#7

Nobody?

Problem still occuring
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)