Raised This Month: $ Target: $400
 0% 

Read_file and Write_file code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bumbastik
Member
Join Date: Jan 2007
Old 07-12-2007 , 09:19   Read_file and Write_file code
Reply With Quote #1

I need to read number from some cfg file.

For example I have %s/PlayerLOGs/plogs.cfg and in plogs.cfg first line contains number 5 (f.e) Number of lines - 1 line.

new plogspath[64]
get_configsdir( plogspath, 63 )
server_cmd("exec %s/PlayerLOGs/plogs.cfg", plogspath )

new filename[128]
new len
formatex(filename, 127, "%s/plogs.cfg", plogspath)
read_file(filename, 1, What I must write here, 63, And here)
bumbastik is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 07-12-2007 , 11:54   Re: Read_file and Write_file code
Reply With Quote #2

Read it like any other line then do a str_to_num()
_Master_ is offline
bumbastik
Member
Join Date: Jan 2007
Old 07-12-2007 , 12:44   Re: Read_file and Write_file code
Reply With Quote #3

read_file(filename, 1, What I must write here, 63, And here)
bumbastik is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-12-2007 , 12:59   Re: Read_file and Write_file code
Reply With Quote #4

http://www.amxmodx.org/funcwiki.php?...file&go=search
__________________
Arkshine is offline
bumbastik
Member
Join Date: Jan 2007
Old 07-13-2007 , 13:35   Re: Read_file and Write_file code
Reply With Quote #5

Muhhahahahah If you dint know I find it before ask!
bumbastik is offline
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 21:28.


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