Family Save Help
#1

Could someone tell me whats wrong with this code it aint saving

PHP код:
FamilyInfo[idx][FamilySkins
PHP код:
public LoadFamilies()
{
    new 
arrCoords[30][64];
    new 
strFromFile2[512];
    new 
Filefile fopen("families.cfg"io_read);
    if(
file)
    {
        new 
idx;
        while (
idx sizeof(FamilyInfo))
        {
            
fread(filestrFromFile2);
            
split(strFromFile2arrCoords'|');
            
FamilyInfo[idx][FamilyTaken] = strvalEx(arrCoords[0]);
            
strmid(FamilyInfo[idx][FamilyName], arrCoords[1], 0strlen(arrCoords[1]), 255);
            
strmid(FamilyInfo[idx][FamilyMOTD], arrCoords[2], 0strlen(arrCoords[2]), 255);
            
strmid(FamilyInfo[idx][FamilyLeader], arrCoords[3], 0strlen(arrCoords[3]), 255);
            
FamilyInfo[idx][FamilyBank] = strvalEx(arrCoords[4]);
            
FamilyInfo[idx][FamilyCash] = strvalEx(arrCoords[5]);
            
FamilyInfo[idx][FamilySafe] = strvalEx(arrCoords[6]);
            
FamilyInfo[idx][FamilySafePos][0] = floatstr(arrCoords[7]);
            
FamilyInfo[idx][FamilySafePos][1] = floatstr(arrCoords[8]);
            
FamilyInfo[idx][FamilySafePos][2] = floatstr(arrCoords[9]);
            
FamilyInfo[idx][FamilyPot] = strvalEx(arrCoords[10]);
            
FamilyInfo[idx][FamilyCrack] = strvalEx(arrCoords[11]);
            
FamilyInfo[idx][FamilyMats] = strvalEx(arrCoords[12]);
            
strmid(FamilyRank[idx][0], arrCoords[13], 0strlen(arrCoords[13]), 255);
            
strmid(FamilyRank[idx][1], arrCoords[14], 0strlen(arrCoords[14]), 255);
            
strmid(FamilyRank[idx][2], arrCoords[15], 0strlen(arrCoords[15]), 255);
            
strmid(FamilyRank[idx][3], arrCoords[16], 0strlen(arrCoords[16]), 255);
            
strmid(FamilyRank[idx][4], arrCoords[17], 0strlen(arrCoords[17]), 255);
            
strmid(FamilyRank[idx][5], arrCoords[18], 0strlen(arrCoords[18]), 255);
            
FamilyInfo[idx][FamilyMembers] = strvalEx(arrCoords[19]);
            
FamilyInfo[idx][FamilySkins] = strvalEx(arrCoords[20]);
            
FamilyInfo[idx][FamilySkin1] = strvalEx(arrCoords[21]);
            
FamilyInfo[idx][FamilySkin2] = strvalEx(arrCoords[22]);
            
FamilyInfo[idx][FamilySkin3] = strvalEx(arrCoords[23]);
            
FamilyInfo[idx][FamilySkin4] = strvalEx(arrCoords[24]);
            
FamilyInfo[idx][FamilySkin5] = strvalEx(arrCoords[25]);
            
FamilyInfo[idx][FamilySkin6] = strvalEx(arrCoords[26]);
            
FamilyInfo[idx][FamilySkin7] = strvalEx(arrCoords[27]);
            
FamilyInfo[idx][FamilySkin8] = strvalEx(arrCoords[28]);
            
FamilyInfo[idx][FStrikes] = strval(arrCoords[29]);
            
printf("Family:%d Taken:%d Name:%s MOTD:%s Leader:%s Bank:%d Cash:%d Safe:%d SafeX:%f SafeY:%f SafeZ:%f Pot:%d Crack:%d Mats:%d Rank1:%s Rank2:%s Rank3:%s Rank4:%s Rank5:%s Rank6:%s Members:%d",
            
idx,FamilyInfo[idx][FamilyTaken],FamilyInfo[idx][FamilyName],FamilyInfo[idx][FamilyMOTD],
            
FamilyInfo[idx][FamilyLeader],FamilyInfo[idx][FamilyBank],
            
FamilyInfo[idx][FamilyCash],FamilyInfo[idx][FamilySafe],FamilyInfo[idx][FamilySafePos][0],
            
FamilyInfo[idx][FamilySafePos][1],FamilyInfo[idx][FamilySafePos][2],FamilyInfo[idx][FamilyPot],
            
FamilyInfo[idx][FamilyCrack],FamilyInfo[idx][FamilyMats],FamilyRank[idx][0],FamilyRank[idx][1],
            
FamilyRank[idx][2],FamilyRank[idx][3],FamilyRank[idx][4],FamilyRank[idx][5],FamilyInfo[idx][FamilyMembers]);
            
printf("Skins:%d Skin1:%d Skin2:%d Skin3:%d Skin4:%d Skin5:%d Skin6:%d Skin7:%d Skin8:%d",
            
FamilyInfo[idx][FamilySkins],FamilyInfo[idx][FamilySkin1],FamilyInfo[idx][FamilySkin2],FamilyInfo[idx][FamilySkin3],FamilyInfo[idx][FamilySkin4],
            
FamilyInfo[idx][FamilySkin5],FamilyInfo[idx][FamilySkin6],FamilyInfo[idx][FamilySkin7],FamilyInfo[idx][FamilySkin8]);
            
idx++;
        }
        
fclose(file);
    }
    return 
1;
}
public 
SaveFamilies()
{
    new 
idx;
    new 
Filefile2;
    while (
idx sizeof(FamilyInfo))
    {
        new 
coordsstring[512];
        
format(coordsstringsizeof(coordsstring), "%d|%s|%s|%s|%d|%d|%d|%f|%f|%f|%d|%d|%d|%s|%s|%s|%s|%s|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
        
FamilyInfo[idx][FamilyTaken],
        
FamilyInfo[idx][FamilyName],
        
FamilyInfo[idx][FamilyMOTD],
        
FamilyInfo[idx][FamilyLeader],
        
FamilyInfo[idx][FamilyBank],
        
FamilyInfo[idx][FamilyCash],
        
FamilyInfo[idx][FamilySafe],
        
FamilyInfo[idx][FamilySafePos][0],
        
FamilyInfo[idx][FamilySafePos][1],
        
FamilyInfo[idx][FamilySafePos][2],
        
FamilyInfo[idx][FamilyPot],
        
FamilyInfo[idx][FamilyCrack],
        
FamilyInfo[idx][FamilyMats],
        
FamilyRank[idx][0],
        
FamilyRank[idx][1],
        
FamilyRank[idx][2],
        
FamilyRank[idx][3],
        
FamilyRank[idx][4],
        
FamilyRank[idx][5],
        
FamilyInfo[idx][FamilyMembers],
        
FamilyInfo[idx][FamilySkins],
        
FamilyInfo[idx][FamilySkin1],
        
FamilyInfo[idx][FamilySkin2],
        
FamilyInfo[idx][FamilySkin3],
        
FamilyInfo[idx][FamilySkin4],
        
FamilyInfo[idx][FamilySkin5],
        
FamilyInfo[idx][FamilySkin6],
        
FamilyInfo[idx][FamilySkin7],
        
FamilyInfo[idx][FamilySkin8],
        
FamilyInfo[idx][FStrikes]);
        if(
idx == 0)
        {
            
file2 fopen("families.cfg"io_write);
        }
        else
        {
            
file2 fopen("families.cfg"io_append);
        }
        
fwrite(file2coordsstring);
        
idx++;
        
fclose(file2);
    }
    return 
1;

Reply
#2

bump
Reply
#3

If you would like some help, i can try to help you as much as i can send me a PM on the forums!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)