TextDraw Problems. -
So I have a TextDraw for the businesses and the Enter Price is not showing it always shows 0$, the int for enterprice is loading from the data base. Other things are working that's the single thing that dosn't work. Sorry for bad english.
PHP код:
forward OnBizLoad(i);
public OnBizLoad(i)
{
Biz[i][ID] = i;
Biz[i][Enter] = cache_get_field_content_int(0, "EnterPrice");
Biz[i][OwnerID] = cache_get_field_content_int(0, "OwnerID");
Biz[i][Price] = cache_get_field_content_int(0, "Price");
new dest[24];
cache_get_field_content(0, "Name", dest);
format(Biz[i][Name], sizeof(dest), dest);
cache_get_field_content(0, "Owner", dest);
format(Biz[i][OwnerName], sizeof(dest), dest);
Biz[i][Money] = cache_get_field_content_int(0, "Money");
Biz[i][enterx] = cache_get_field_content_float(0, "enterx");
Biz[i][entery] = cache_get_field_content_float(0, "entery");
Biz[i][enterz] = cache_get_field_content_float(0, "enterz");
Biz[i][exitx] = cache_get_field_content_float(0, "exitx");
Biz[i][exity] = cache_get_field_content_float(0, "exity");
Biz[i][exitz] = cache_get_field_content_float(0, "exitz");
Biz[i][Interior] = cache_get_field_content_int(0, "Interior");
new string[255];
if(Biz[i][OwnerID] == -1) format(string, sizeof(string), "%s(ID: %d) \nEnter: %d$ \nFor Sale: %d$", Biz[i][Name], Biz[i][Enter], i, Biz[i][Price]);
else
{
if(Biz[i][Price] != 0) format(string, sizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s \nFor Sale: %d$", Biz[i][Name], Biz[i][Enter], i, Biz[i][OwnerName], Biz[i][Price]);
else format(string, sizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s", Biz[i][Name], Biz[i][Enter], i, Biz[i][OwnerName]);
}
Biz[i][Label] = Create3DTextLabel(string, INFO, Biz[i][enterx], Biz[i][entery], Biz[i][enterz], 12, 0, 1);
Biz[i][Pickup] = CreatePickup(1239, 1, Biz[i][enterx], Biz[i][entery], Biz[i][enterz], -1);
Biz[i][IntPickup] = CreatePickup(1239, 1, Biz[i][exitx], Biz[i][exity], Biz[i][exitz], i+1);
printf("Biz-ul %s s-a incarcat. ID: %d, Owner: %s, EnterPrice: %d", Biz[i][Name], i, Biz[i][OwnerName], Biz[i][Enter]);
return 1;
}
Re: TextDraw Problems. -
Re: TextDraw Problems. -
PHP код:
if(Biz[i][OwnerID] == -1) format(string, sizeof(string), "%s(ID: %d) \nEnter: %d$ \nFor Sale: %d$", Biz[i][Name], i, Biz[i][Enter], Biz[i][Price]);
else
{
if(Biz[i][Price] != 0) format(string, sizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s \nFor Sale: %d$", Biz[i][Name], i, Biz[i][Enter], Biz[i][OwnerName], Biz[i][Price]);
else format(string, sizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s", Biz[i][Name], Biz[i][Enter], i, Biz[i][OwnerName]);
}
Re: TextDraw Problems. -
Gosh, don't load them one by one. That puts an unnecessarily large load on the MySQL server. Don't loop through queries, loop through results.