Raised This Month: $ Target: $400
 0% 

[Extern file]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 09-01-2009 , 09:50   [Extern file]
Reply With Quote #1

Yeah, again.
I'm trying to modifie a extern file created by me.
I used fopen to open the file, fprintf to wrote in the file and then i used fclose to close the file.

But my questin is, how to delete a part of the file?
:/
Mxnn is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-01-2009 , 10:00   Re: [Extern file]
Reply With Quote #2

Something like:
PHP Code:
write_filesFileName""iLine ); 
SnoW is offline
Send a message via MSN to SnoW
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 09-01-2009 , 10:10   Re: [Extern file]
Reply With Quote #3

If i want to delete the var "name" i must to put something like this:
PHP Code:
write_filesFileName"%s",name iLine ); 
It's right?
Mxnn is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-01-2009 , 10:14   Re: [Extern file]
Reply With Quote #4

No, that wouldn't work. First you can't format like that inside of the native. That native actually replaces the line you specify, and when you set the replacing string to "", the line is obviously emptyed. Somehow if you want to delete/change some specific string istead of some line, you should read the file, then delete everything you want and after that write it back to the file.
SnoW is offline
Send a message via MSN to SnoW
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 09-01-2009 , 10:20   Re: [Extern file]
Reply With Quote #5

But if i want to delete "pedrito" i have to put this:
PHP Code:
write_filesFileName"pedrito"iLine ); 
But if have to write a name write by a admin in her console i what i have to do?
How must to put a string to delete it?
</span></span>
Mxnn is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-01-2009 , 10:24   Re: [Extern file]
Reply With Quote #6

I don't really understand you, but I already said that that doesn't work at all. What I were trying to say was that write_file replaces the line you specify with the text you pass.
SnoW is offline
Send a message via MSN to SnoW
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 09-01-2009 , 10:31   Re: [Extern file]
Reply With Quote #7

But how can i specify the line?
In the "" i must write the text that i want to replace or the text that i put in replace of the other?
I don't understand.. if you can put an example it would better.

EX: If i wan't to delete "pedrito" how can i put?
And then, if i want to delete the variable "name".. =(!
Mxnn is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-01-2009 , 10:41   Re: [Extern file]
Reply With Quote #8

To empty a specific line, use stock:
PHP Code:
empty_linefile_name[ ], line )
     
write_filefile_name""line ); 
If you want to remove some word from the file:
1. Read the file to memory.
2. Empty things you want. Natives for that exist already.
3. Write the modified text to the file.
SnoW is offline
Send a message via MSN to SnoW
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 09-01-2009 , 10:49   Re: [Extern file]
Reply With Quote #9

AAAAAAAAAAAAAAA i don't understand!.

I'm stupid sorry, jajaja,.
Look, i have to delete the word "pedro".
I have to put:
PHP Code:
empty_linefile_name[ ], line )
     
write_filefile_name"pedrito"line ); 
?

Or
PHP Code:
empty_linefile_name[ ], pedrito )
     
write_filefile_name""pedrito ); 
?

And if i have to delete the var "name" how i have to put?
Mxnn is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 11:55   Re: [Extern file]
Reply With Quote #10

I don't know about reading files, write files, etc... but, no... that is wrong...

PHP Code:
write_filefile_name"pedrito"line ); 
With this, you are writing the file to pedrito.... You should READ the file first, to search "pedrito" and then use like Snow said, the write_file:

PHP Code:
write_filefile_name""pedrito ); 
To read the file i dont know but maybe you have to use this read_file
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Reply



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 15:07.


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