read file problem

Сообщения
50
Реакции
-1
Hi i need help with this line of read from file
read_file(TopSaveFile , 1 , sztopmin , charsmax( sztopmin ) ,iLen );
When im reading the file it only gives me 1 numeric of the saved line instead of two, for example when saving 04 i get 4 in return from the line
what is wrong?


Код:
new TopSaveFile[72],MapName[32];
    get_mapname(MapName,32);
    formatex(TopSaveFile,charsmax(TopSaveFile),"addons/amxmodx/configs/%s_save.ini",MapName);
    new sztopmin[ 32 ], iLen;
    if(file_exists(TopSaveFile))
    {
    read_file(TopSaveFile , 1 , sztopmin , charsmax( sztopmin ) ,iLen );
 
Сообщения
50
Реакции
-1
Код:
    new TopSaveFile[72],MapName[32];
    get_mapname(MapName,32);
    formatex(TopSaveFile,charsmax(TopSaveFile),"addons/amxmodx/configs/%s_save.ini",MapName);
    new sztopname[ 32 ] ,sztopmin[ 32 ], sztopsec[ 32 ], sztopmili[ 32 ], iLen1,iLen2,iLen3,iLen4;
    
    if(file_exists(TopSaveFile))
    {
        read_file(TopSaveFile , 0 , sztopname , charsmax( sztopname ) ,iLen1 );
        read_file(TopSaveFile , 1 , sztopmin , charsmax( sztopmin ) ,iLen2 );
        read_file(TopSaveFile , 2 , sztopsec , charsmax( sztopsec ) ,iLen3 );
        read_file(TopSaveFile , 3 , sztopmili , charsmax( sztopmili ) ,iLen4 );
    }
        
    
        
        
        if( (imin <= str_to_num(sztopmin)) && (isec <= str_to_num(sztopsec)) && (iMiliSeconds < str_to_num(sztopmili) )   )
        {
            
            
            TopScore = CombinedTime;
            formatex(TopName, charsmax(TopName), "%s", name);
            
            ColorChat(0,NORMAL,"^4[^1DeathRun^4] ^4%s ^1has just made new best score, type ^3/best ^1 In Chat to check it.",name);
            client_cmd(0, "spk woop");
            
            
                
            
            new MapName[32],TopSaveFile[72],FileSaveName[64],FileSavePlayerName[64],FileSaveMinutes[64],FileSaveSeconds[64],FileSaveMiliSeconds[64];
            
            get_mapname(MapName,32);
            
            
            formatex(TopSaveFile,charsmax(TopSaveFile),"addons/amxmodx/configs/%s_save.ini",MapName);
            
            new TopTopMin,TopTopSec,TopTopMili;
            
            TopTopMin = floatround(TopScore / 60.0, floatround_floor);
            TopTopSec = floatround(TopScore - TopTopMin * 60.0,floatround_floor);
            TopTopMili = floatround((TopScore - (TopTopMin * 60 + TopTopSec)) * 100, floatround_floor);
            
            formatex(FileSavePlayerName,charsmax(FileSavePlayerName),"%s",TopName);
            formatex(FileSaveMinutes,charsmax(FileSaveMinutes),"%02i",TopTopMin);
            formatex(FileSaveSeconds,charsmax(FileSaveSeconds),"%02i",TopTopSec);
            formatex(FileSaveMiliSeconds,charsmax(FileSaveMiliSeconds),"%02i",TopTopMili);
            
            write_file(TopSaveFile,FileSavePlayerName,0);
            write_file(TopSaveFile,FileSaveMinutes,1);
            write_file(TopSaveFile,FileSaveSeconds,2);
            write_file(TopSaveFile,FileSaveMiliSeconds,3);
            }
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу