24.01.2018, 14:01
Simple issue, weird response.
Current log:
And how my house module is looking like:
Why isn't the first /printf/ being printed? I'm so lost.
Current log:
PHP Code:
[database] Connecting to the database..
[database] Connected to the database after (17ms)
[achievements] Loaded a total of 4 achievements..
Number of vehicle models: 0
[houses] Loaded 55 house wallpapers successfully.
[interiors] Loaded 4 doors successfully.
[objects] Loaded 0 objects from the database.
PHP Code:
enum houseWallpapersVariables {
hWP_ID,
Float:hWP_x,
Float:hWP_y,
Float:hWP_z,
Float:hWP_rotx,
Float:hWP_roty,
Float:hWP_rotz,
hWP_model,
hWP_txdModel,
hWP_txdTXD[32],
hWP_txdTexture[32],
hWP_type,
hWP_object
}
static houseWallpapersData[500][250][houseWallpapersVariables];
enum houseVariables {
houseID,
houseOwner[MAX_PLAYER_NAME],
houseAdress[64]
}
static houseData[500][houseVariables];
#include <YSI\y_hooks>
hook OnGameModeInit() {
inline OnHouseDataReceived() {
for(new i; i < cache_num_rows(); i++) {
cache_get_value_name_int(i, "id", houseData[i][houseID]);
cache_get_value_name(i, "adress", houseData[i][houseAdress], 64);
cache_get_value_name(i, "owner", houseData[i][houseOwner], MAX_PLAYER_NAME);
}
printf("[houses] Loaded %i houses successfully.", cache_num_rows());
}
mysql_tquery(databaseConnection, "SELECT * FROM houses");
inline OnHouseWallpapersReceived() {
for(new row; row < cache_num_rows(); row++) {
static id;
cache_get_value_name_int(row, "houseid", id);
cache_get_value_name_int(row, "model", houseWallpapersData[id][row][hWP_model]);
cache_get_value_name_int(row, "type", houseWallpapersData[id][row][hWP_type]);
cache_get_value_name_int(row, "txdModel", houseWallpapersData[id][row][hWP_txdModel]);
cache_get_value_name(row, "txdTXD", houseWallpapersData[id][row][hWP_txdTXD], 32);
cache_get_value_name(row, "txdTexture", houseWallpapersData[id][row][hWP_txdTexture], 32);
cache_get_value_name_float(row, "x", houseWallpapersData[id][row][hWP_x]);
cache_get_value_name_float(row, "y", houseWallpapersData[id][row][hWP_y]);
cache_get_value_name_float(row, "z", houseWallpapersData[id][row][hWP_z]);
cache_get_value_name_float(row, "rotx", houseWallpapersData[id][row][hWP_rotx]);
cache_get_value_name_float(row, "roty", houseWallpapersData[id][row][hWP_roty]);
cache_get_value_name_float(row, "rotz", houseWallpapersData[id][row][hWP_rotz]);
SetDynamicObjectMaterial((houseWallpapersData[id][row][hWP_object] = CreateDynamicObject(houseWallpapersData[id][row][hWP_model], houseWallpapersData[id][row][hWP_x], houseWallpapersData[id][row][hWP_y], houseWallpapersData[id][row][hWP_z], houseWallpapersData[id][row][hWP_rotx], houseWallpapersData[id][row][hWP_roty], houseWallpapersData[id][row][hWP_rotz])), 0, houseWallpapersData[id][row][hWP_txdModel], houseWallpapersData[id][row][hWP_txdTXD], houseWallpapersData[id][row][hWP_txdTexture], 0);
}
printf("[houses] Loaded %i house wallpapers successfully.", cache_num_rows());
}
mysql_tquery_inline(databaseConnection, "SELECT * FROM `house wallpapers` LIMIT 5000", using inline OnHouseWallpapersReceived);
}