Raised This Month: $ Target: $400
 0% 

How to update a line in a file & file help.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-08-2018 , 07:48   How to update a line in a file & file help.
Reply With Quote #1

Hello, can someone explain me why it always writes the same line in the file when I connect back? It shouldn't write after I am already registered in the file. It seems it doesn't execute ''if(equal(steamid,parsedsteamid))'' this line in the code because it always creates a new line in the file with the same SSID.

PS: Also would be glad if anyone tell me how to update my line after writing something there.

PHP Code:
    new fsize file_size(filename,1);
    for (new 
line=0;line<=fsize;line++)
    {
        
        
read_file(filename,line,readdata,127,txtlen);        
        
parse(readdata,parsedsteamid,31parsedCompletedFiveKills31);
        
get_user_authid(id,steamid,31);
        
        if(
equal(steamid,parsedsteamid))
        {
            
hasCompletedKills[id] = parsedCompletedFiveKills;
            
            break;            
        }
        else if(!
equal(steamid,parsedsteamid))
        {
            new 
writedata[128];
            new 
steamid[32], bool:completedFiveKills;
            
            
get_user_authid(id,steamid,31);
            
completedFiveKills false;
            
            
formatex(writedata,127,"%s %d",steamidcompletedFiveKills)
            
write_file(filename,writedata);
            
            break;
        }
    } 
LemoNSK is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode