Problem with saving/loading
#9

Quote:
Originally Posted by kovac
Посмотреть сообщение
Try this

PHP код:
stock LoadBusiness()
{
    new 
DB_Query[228];
    new 
string[500];
    for(new 
i<= MAX_BUSINESSi++)
    {
        
mysql_format(DatabaseDB_Querysizeof(DB_Query), "SELECT * FROM `BUSINESS` WHERE `ID` = '%d' LIMIT 1"i);
        
mysql_query(DatabaseDB_Query);
        if(
cache_num_rows() > 0)
        {
            
cache_get_value(0"NAME"Business[i][Name], 128);
            
cache_get_value_int(0"TYPE"Business[i][Type]);
            
cache_get_value_int(0"PRODUCT"Business[i][Product]);
            
cache_get_value_int(0"FEE"Business[i][Fee]);
            
cache_get_value_int(0"SAFE"Business[i][Safe]);
            
cache_get_value_int(0"OWNER"Business[i][Owner]);
            
cache_get_value_int(0"VW"Business[i][Vw]);
            
cache_get_value_int(0"INT"Business[i][Int]);
            
cache_get_value_int(0"OWNER"Business[i][Owner]);
            
cache_get_value_int(0"PRICE"Business[i][Price]);
            
cache_get_value_name_float(0"PosX"Business[i][PosX]);
            
cache_get_value_name_float(0"PosY"Business[i][PosY]);
            
cache_get_value_name_float(0"PosZ"Business[i][PosZ]);
            
Business[i][Used] = true;
            if(
Business[i][Owner] != -1)
            {
                
format(stringsizeof(string),"\t ID : %d\nName : %s\nType : %s\nOwner : %s\nEntrance Fee : $ %d",i,Business[i][Name],GetBusinessType(Business[i][Type]),GetNameFromUniqueID(Business[i][Owner]),Business[i][Fee]);
                
Business[i][BizText] = Create3DTextLabel(stringCOLOR_ADMINBusiness[i][PosX], Business[i][PosX], Business[i][PosX], 10.0Business[i][Vw], Business[i][Int]);
            }
            else
            {
                
format(stringsizeof(string),"\t ID : %d\nName : NEW BUSINESS\nType : %s\nPrice : %d",i,GetBusinessType(Business[i][Type]),Business[i][Price]);
                
Business[i][BizText] = Create3DTextLabel(stringCOLOR_ADMINBusiness[i][PosX], Business[i][PosX], Business[i][PosX], 10.0Business[i][Vw], Business[i][Int]);
            }
        }
        else
        {
            
Business[i][Used] = false;
        }
    }
    return 
1;

Ow thank you the loading is now working but the saving I guess it still bugged +REP
Reply


Messages In This Thread
Problem with saving/loading - by Nru - 19.03.2018, 21:28
Re: Problem with saving/loading - by Chyakka - 19.03.2018, 23:24
Re: Problem with saving/loading - by Nru - 20.03.2018, 09:45
Re: Problem with saving/loading - by jasperschellekens - 20.03.2018, 10:03
Re: Problem with saving/loading - by Nru - 20.03.2018, 10:46
Re: Problem with saving/loading - by iKarim - 20.03.2018, 10:50
Re: Problem with saving/loading - by Nru - 20.03.2018, 10:56
Re: Problem with saving/loading - by kovac - 20.03.2018, 12:54
Re: Problem with saving/loading - by Nru - 20.03.2018, 13:23
Re: Problem with saving/loading - by Nru - 20.03.2018, 16:03

Forum Jump:


Users browsing this thread: 1 Guest(s)