Raised This Month: $ Target: $400
 0% 

Solved Manipulate string in file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-16-2020 , 10:58   Re: Manipulate string in file
Reply With Quote #8

Our worst enemy is fatigue, taking into account all the help and even what was punctuated by the fysiks, we arrived at the code below which is apparently functional, thanks.

PHP Code:
new szConfigTemp[MAX_FMT_LENGTH];
new 
szConfig[MAX_FMT_LENGTH];
get_configsdir(szConfigcharsmax(szConfig))
add(szConfigcharsmax(szConfig), "/users.ini")
add(szConfigTempcharsmax(szConfigTemp), "/usersTemp.ini");

new 
iFile fopen(szConfig"r")
new 
iFile2 fopen(szConfigTemp"w")
if(
iFile && iFile2)
{
    new 
szData[120], szData1[120]

    while(
fgets(iFileszDatacharsmax(szData)))
    {
            switch(
szData[0])
            {
                case 
EOS';''/''['fputs(iFile2szData)
                default:
                {
                    
parse(szDataszData1charsmax(szData1))

                    if(!
equal(szData1playerinfo))
                    {
                        
fputs(iFile2szData)
                    }
                }
            }
    }

    
fclose(iFile)
    
fclose(iFile2)
}

delete_fileszConfig );
rename_fileszConfigTemp szConfig ); 
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
 



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 14:13.


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