22.09.2013, 02:53
I have dynamic faction vehicle system and the loading is messy..
(the veh_slot is the slot it should load into)
My database looks like this:
http://puu.sh/4x79W/1fddf4f0b5.png
and ingame it looks like this:
http://puu.sh/4x7dP/45ba472afc.jpg
(so that vehicle is supposed to load into vehicle slot 1 but it loads into 1 instead)
MYSQL Loading code:
And also, if I have more than one vehicle only one of them will load and spawn etc, I tried printing the ID's that load and whatever and only one of them loads?
ALL HELP APPRECIATED <3
(the veh_slot is the slot it should load into)
My database looks like this:
http://puu.sh/4x79W/1fddf4f0b5.png
and ingame it looks like this:
http://puu.sh/4x7dP/45ba472afc.jpg
(so that vehicle is supposed to load into vehicle slot 1 but it loads into 1 instead)
MYSQL Loading code:
pawn Код:
case THREAD_LOAD_FACVEHS:
{
if(szRows)
{
for(new f = 1; f < MAX_FACTION; f++) {
cache_get_field_content(0, "fac_id", szResult); FactionVehicleInfo[f][szRows][fVI_facID] = strval(szResult);
cache_get_field_content(0, "model_id", szResult); FactionVehicleInfo[f][szRows][fVI_ModelID] = strval(szResult);
cache_get_field_content(0, "colour_1", szResult); FactionVehicleInfo[f][szRows][fVI_Colours][0] = strval(szResult);
cache_get_field_content(0, "colour_2", szResult); FactionVehicleInfo[f][szRows][fVI_Colours][1] = strval(szResult);
cache_get_field_content(0, "upkeep", szResult); FactionVehicleInfo[f][szRows][fVI_upKeep] = strval(szResult);
cache_get_field_content(0, "rank_needed", szResult); FactionVehicleInfo[f][szRows][fVI_vehRank] = strval(szResult);
cache_get_field_content(0, "posX", szResult); FactionVehicleInfo[f][szRows][fVI_vPos][0] = floatstr(szResult);
cache_get_field_content(0, "posY", szResult); FactionVehicleInfo[f][szRows][fVI_vPos][1] = floatstr(szResult);
cache_get_field_content(0, "posZ", szResult); FactionVehicleInfo[f][szRows][fVI_vPos][2] = floatstr(szResult);
cache_get_field_content(0, "posA", szResult); FactionVehicleInfo[f][szRows][fVI_vPos][3] = floatstr(szResult);
FactionVehicleInfo[f][szRows][fVI_vID] = CreateVehicle(FactionVehicleInfo[f][szRows][fVI_ModelID], FactionVehicleInfo[f][szRows][fVI_vPos][0], FactionVehicleInfo[f][szRows][fVI_vPos][1], FactionVehicleInfo[f][szRows][fVI_vPos][2], FactionVehicleInfo[f][szRows][fVI_vPos][3], FactionVehicleInfo[f][szRows][fVI_Colours][0], FactionVehicleInfo[f][szRows][fVI_Colours][1], -1);
break;
}
printf("[SERVER]: %d faction vehicles were loaded.", szRows);
szRows++;
}
else print("[SERVER]: 0 faction vehicles were loaded.");
}
ALL HELP APPRECIATED <3