Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward Car_Load();
- public Car_Load()
- {
- static
- rows,
- fields,
- str[128];
- cache_get_data(rows, fields, g_dbConnection);
- for (new i = 0; i < rows; i ++) if (i < MAX_DYNAMIC_CARS)
- {
- CarData[i][carExists] = true;
- CarData[i][carID] = cache_get_field_int(i, "carID");
- CarData[i][carModel] = cache_get_field_int(i, "carModel");
- CarData[i][carOwner] = cache_get_field_int(i, "carOwner");
- CarData[i][carPos][0] = cache_get_field_float(i, "carPosX");
- CarData[i][carPos][1] = cache_get_field_float(i, "carPosY");
- CarData[i][carPos][2] = cache_get_field_float(i, "carPosZ");
- CarData[i][carPos][3] = cache_get_field_float(i, "carPosR");
- CarData[i][carColor1] = cache_get_field_int(i, "carColor1");
- CarData[i][carColor2] = cache_get_field_int(i, "carColor2");
- CarData[i][carPaintjob] = cache_get_field_int(i, "carPaintjob");
- CarData[i][carLocked] = cache_get_field_int(i, "carLocked");
- CarData[i][carImpounded] = cache_get_field_int(i, "carImpounded");
- CarData[i][carImpoundPrice] = cache_get_field_int(i, "carImpoundPrice");
- CarData[i][carFaction] = cache_get_field_int(i, "carFaction");
- for (new j = 0; j < 14; j ++)
- {
- if (j < 5)
- {
- format(str, sizeof(str), "carWeapon%d", j + 1);
- CarData[i][carWeapons][j] = cache_get_field_int(i, str);
- format(str, sizeof(str), "carAmmo%d", j + 1);
- CarData[i][carAmmo][j] = cache_get_field_int(i, str);
- }
- format(str, sizeof(str), "carMod%d", j + 1);
- CarData[i][carMods][j] = cache_get_field_int(i, str);
- }
- Car_Spawn(i);
- }
- for (new i = 0; i < MAX_DYNAMIC_CARS; i ++) if (CarData[i][carExists]) {
- format(str, sizeof(str), "SELECT * FROM `carstorage` WHERE `ID` = '%d'", CarData[i][carID]);
- mysql_tquery(g_dbConnection, str, "OnLoadCarStorage", "d", i);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement