#1

Something doesn't work properly:
Problem is in loading and I can't find out what is the problem:

GameModeInIt:

PHP код:
    /* Proredak */
    
new poruka[40],poruka2[256];
    for(new 
houseid 1houseid sizeof(HouseInfo); houseid++)
    {
        
format(poruka,sizeof(poruka),hPATH,houseid);
        
INI_ParseFile(poruka"LoadKuca_data_%d", .bExtra true, .extra houseid);
        
HouseInfo[houseid][hIkona] = CreateDynamicPickup(12731HouseInfo[houseid][hUlazX], HouseInfo[houseid][hUlazY], HouseInfo[houseid][hUlazZ],  HouseInfo[houseid][hSvijet]);
        if(
HouseInfo[houseid][hOwned] == 1)
        {
            
KucaPickupOwned[houseid] = CreateDynamicPickup(19522,1HouseInfo[houseid][hUlazX],HouseInfo[houseid][hUlazY],HouseInfo[houseid][hUlazZ],-1,-1,-1100);
            
KucaMapIconOwned[houseid] = CreateDynamicMapIcon(HouseInfo[houseid][hUlazX],HouseInfo[houseid][hUlazY],HouseInfo[houseid][hUlazZ],32,-1,-1,-1,-1,100);
            
format(poruka2,sizeof(poruka2),"{FFFFFF}TIP Kuce: %s\nVlasnik: %s\nCijena:"COLOR_ZELENA" $%d{FFFFFF}\n\nPritisnite 'f' ili 'enter' za ulazak.\nIzravan nacin -"COLOR_ZELENA" (/enter)",KucaType(houseid),HouseInfo[houseid][hVlasnik],HouseInfo[houseid][hCijena]);
            
Kuca3DOwned[houseid] = Create3DTextLabel(poruka,-1,HouseInfo[houseid][hUlazX],HouseInfo[houseid][hUlazY],HouseInfo[houseid][hUlazZ],30,0,0);
        }
        else
        {
            
KucaPickup[houseid] = CreateDynamicPickup(1273,1HouseInfo[houseid][hUlazX],HouseInfo[houseid][hUlazY],HouseInfo[houseid][hUlazZ],-1,-1,-1100);
            
KucaMapIcon[houseid] = CreateDynamicMapIcon(HouseInfo[houseid][hUlazX],HouseInfo[houseid][hUlazY],HouseInfo[houseid][hUlazZ], 31, -1, -,-1, -1100);
            
format(poruka2,sizeof(poruka2),""COLOR_SIVA"~{FFFFFF} Kuca na prodaju "COLOR_SIVA"~\n{FFFFFF}TIP Kuce: {FFF1AF}%s\n{FFFFFF}Cijena: "COLOR_ZELENA"$%d\n\n{FFFFFF}Ukoliko zelite kupiti kucu: /kupikucu",KucaType(houseid),HouseInfo[houseid][hCijena]);
            
Kuca3D[houseid] = Create3DTextLabel(poruka,-1,HouseInfo[houseid][hUlazX], HouseInfo[houseid][hUlazY], HouseInfo[houseid][hUlazZ], 30.0,0,0);
        }
    } 
Load:

PHP код:
public LoadKuca_data(houseidname[], value[])
{
    
INI_Int("Owned"HouseInfo[houseid][hOwned]);
    
INI_Int("Cijena"HouseInfo[houseid][hCijena]);
    
INI_String("Vlasnik"HouseInfo[houseid][hVlasnik], 32);
    
INI_Int("Zakljucano"HouseInfo[houseid][hZakljucan]);
    
INI_Int("House_Novac"HouseInfo[houseid][hNovac]);
    
INI_Int("House_Gun"HouseInfo[houseid][hGun]);
    
INI_Int("Tip"HouseInfo[houseid][hTip]);
    
INI_Float("UlazX",HouseInfo[houseid][hUlazX]);
    
INI_Float("UlazY",HouseInfo[houseid][hUlazY]);
    
INI_Float("UlazZ",HouseInfo[houseid][hUlazZ]);
    
INI_Float("UlazA",HouseInfo[houseid][hUlazA]);
    
INI_Float("IzlazX",HouseInfo[houseid][hIzlazX]);
    
INI_Float("IzlazY",HouseInfo[houseid][hIzlazY]);
    
INI_Float("IzlazZ",HouseInfo[houseid][hIzlazZ]);
    
INI_Float("IzlazA",HouseInfo[houseid][hIzlazA]);
    
INI_Int("Interijer",HouseInfo[houseid][hInterijer]);
    
INI_Int("Unutarnji_Interijer"HouseInfo[houseid][hUnutrasnjiInterijer]);
    
INI_Int("Svijet",HouseInfo[houseid][hSvijet]);
    
INI_Int("UnutarnjiSvijet",HouseInfo[houseid][hUnutarnjiSvijet]);
    
INI_Int("Ikona",HouseInfo[houseid][hIkona]);
    return 
1;

Save(modeexit):

PHP код:
    for(new houseid 1houseid sizeof(HouseInfo); houseid++)
    {
        if(
HouseInfo[houseid][hCijena] == 0) break;
        if(
HouseInfo[houseid][hOwned] == 1)
        {
            
Kuca3D[houseid] = Text3DINVALID_3DTEXT_ID;
            
SaveKuca(houseid);
        }
        else
        {
            
Kuca3DOwned[houseid] = Text3DINVALID_3DTEXT_ID;
            
SaveKuca(houseid);
        }
    } 
Save:

PHP код:
public SaveKuca(houseid)
{
    new 
hFile[40];
    
format(hFilesizeof(hFile), hPATHhouseid);
    new 
INI:File INI_Open(hFile);
    {
        
INI_SetTag(File,"data");
        
INI_WriteInt(File,"Owned",HouseInfo[houseid][hOwned]);
        
INI_WriteInt(File,"Cijena",HouseInfo[houseid][hCijena]);
        
INI_WriteString(File,"Vlasnik",HouseInfo[houseid][hVlasnik]);
        
INI_WriteInt(File,"Zakljucano",HouseInfo[houseid][hZakljucan]);
        
INI_WriteInt(File,"House_Sef",HouseInfo[houseid][hNovac]);
        
INI_WriteInt(File,"House_Gun",HouseInfo[houseid][hGun]);
        
INI_WriteInt(File,"Tip"HouseInfo[houseid][hTip]);
        
INI_WriteFloat(File,"UlazX",HouseInfo[houseid][hUlazX]);
        
INI_WriteFloat(File,"UlazY",HouseInfo[houseid][hUlazY]);
        
INI_WriteFloat(File,"UlazZ",HouseInfo[houseid][hUlazZ]);
        
INI_WriteFloat(File,"UlazA",HouseInfo[houseid][hUlazA]);
        
INI_WriteFloat(File,"IzlazX",HouseInfo[houseid][hIzlazX]);
        
INI_WriteFloat(File,"IzlazY",HouseInfo[houseid][hIzlazY]);
        
INI_WriteFloat(File,"IzlazZ",HouseInfo[houseid][hIzlazZ]);
        
INI_WriteFloat(File,"IzlazA",HouseInfo[houseid][hIzlazA]);
        
INI_WriteInt(File,"Interijer",HouseInfo[houseid][hInterijer]);
        
INI_WriteInt(File,"UnutarnjiInterijer"HouseInfo[houseid][hUnutrasnjiInterijer]);
        
INI_WriteInt(File,"Svijet",HouseInfo[houseid][hSvijet]);
        
INI_WriteInt(File,"UnutarnjiSvijet",HouseInfo[houseid][hUnutarnjiSvijet]);
        
INI_WriteInt(File,"Ikona",HouseInfo[houseid][hIkona]);
    }
    return 
1;

PATH:
PHP код:
#define hPATH "/Kuce/%d.ini" 
Thanks in advance.
Reply
#2

Maybe problem is in missing INI_Close in SaveKuca
Reply
#3

BUMP
Reply
#4

BUMP BUMP BUMP BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)