Raised This Month: $ Target: $400
 0% 

Read File question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 12-13-2011 , 07:25   Read File question
Reply With Quote #1

Code:
	new auth = get_user_authid(id)
        format(holder, charsmax(holder), "%s", auth)

	new configdir[200]
	get_configsdir(configdir,199)

	new configfile1[200]

	format(configfile1,199,"%s/timer.ini",configdir)
	
	new text[512], len
	new pnum = file_size(configfile1,1)
	for(new i = 1; i < pnum; i++)
	{
		read_file(configfile1, i, text, 511, len)
		if ( contain(text, holder) != -1 ) 
		{
			//here is the problem, explained below
		}
	}
so in that ini file i have some authids and for each one an expiration date in format m%dd%dy%d, something like:
"authid" "pass" "flags" expiration date: m12d25y2011 ...
How can i read that part of the line that holds the date?
something like this:
if ( contain(text, "m%dd%dy%d") != -1 ){ // is this wrong also ?
new day = ?
new month = ?
new year = ?
client_print(id, print_chat, "your access expires on %d.%d.%d", day, month, year)
}

Last edited by EDUTz; 12-13-2011 at 07:35.
EDUTz 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:06.


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