public LoadBusiness()
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
for(new i = 0; i < rows; i++)
{
// Loading all of the stuff from the database, all fine.
// Just incase I reload the whole business
DestroyDynamicCP(BusinessInfo[i][bCP]);
DestroyDynamic3DTextLabel(BusinessInfo[i][bText]);
// Problems here
new string[94];
if(strcmp(BusinessInfo[i][bOwner], "None", true, 0))
{
format(string, sizeof(string),
"Name: %s",
BusinessInfo[i][bName]);
}
else
{
format(string, sizeof(string),
"Name: %s\n\
Price: %d",
BusinessInfo[i][bName],
BusinessInfo[i][bPrice]);
}
BusinessInfo[i][bCP] = CreateDynamicCP(BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ], 1);
BusinessInfo[i][bText] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ], 5.0);
}
// Problems end here
printf("Businesses Loaded: %d", rows), gBusiness = rows;
}
return 1;
}
Where are you using functions for get the query content?
cache_get_row..... |
new bizName[64], bizOwner[MAX_PLAYER_NAME];
BusinessInfo[i][bID] = cache_get_row_int(0, 0);
cache_get_row(0, 1, bizName), BusinessInfo[i][bName] = bizName;
cache_get_row(0, 2, bizOwner), BusinessInfo[i][bOwner] = bizOwner;
BusinessInfo[i][bPrice] = cache_get_row_int(0, 3);
BusinessInfo[i][bType] = cache_get_row_int(0, 4);
BusinessInfo[i][bMoney] = cache_get_row_int(0, 5);
BusinessInfo[i][bRobbed] = cache_get_row_int(0, 6);
BusinessInfo[i][bRobbedTimer] = cache_get_row_int(0, 7);
BusinessInfo[i][bEnterX] = cache_get_row_float(0, 8);
BusinessInfo[i][bEnterY] = cache_get_row_float(0, 9);
BusinessInfo[i][bEnterZ] = cache_get_row_float(0, 10);
BusinessInfo[i][bExitX] = cache_get_row_float(0, 11);
BusinessInfo[i][bExitY] = cache_get_row_float(0, 12);
BusinessInfo[i][bExitZ] = cache_get_row_float(0, 13);
BusinessInfo[i][bInt] = cache_get_row_int(0, 14);