TextDraw Problems.
#1

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] == -1format(stringsizeof(string), "%s(ID: %d) \nEnter: %d$ \nFor Sale: %d$"Biz[i][Name], Biz[i][Enter], iBiz[i][Price]);
    else
    {
        if(
Biz[i][Price] != 0format(stringsizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s \nFor Sale: %d$"Biz[i][Name], Biz[i][Enter], iBiz[i][OwnerName], Biz[i][Price]);
        else 
format(stringsizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s"Biz[i][Name], Biz[i][Enter], iBiz[i][OwnerName]);
    }
    
Biz[i][Label] = Create3DTextLabel(stringINFOBiz[i][enterx], Biz[i][entery], Biz[i][enterz], 1201);
    
Biz[i][Pickup] = CreatePickup(12391Biz[i][enterx], Biz[i][entery], Biz[i][enterz], -1);
    
Biz[i][IntPickup] = CreatePickup(12391Biz[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], iBiz[i][OwnerName], Biz[i][Enter]);
    
    return 
1;

Reply
#2

Try use https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Reply
#3

You had the ID, Enter price switcher.

PHP код:
if(Biz[i][OwnerID] == -1format(stringsizeof(string), "%s(ID: %d) \nEnter: %d$ \nFor Sale: %d$"Biz[i][Name], iBiz[i][Enter], Biz[i][Price]);
    else
    {
        if(
Biz[i][Price] != 0format(stringsizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s \nFor Sale: %d$"Biz[i][Name], iBiz[i][Enter], Biz[i][OwnerName], Biz[i][Price]);
        else 
format(stringsizeof(string), "%s(ID: %d) \nEnter: %i$ \nOwner: %s"Biz[i][Name], Biz[i][Enter], iBiz[i][OwnerName]);
    } 
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)