Read File question
Code:
new auth = get_user_authid(id)"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) } |
Re: Read File question
Try looking at the code from this plugin:
https://forums.alliedmods.net/showthread.php?t=138273 It does something similar to what you want i believe. |
Re: Read File question
You need to parse the date string manually (break it down until you get "12", "25" and "2011") then you can use those to get numbers with str_to_num().
Also, make sure that if you have a single digit month or day that you prepend it with a zero so that the number is always two characters wide. Here is one I just came up with for parsing the date string: test "12252011" PHP Code:
|
Re: Read File question
that isn't good for me.
we have a text: j3jn34fb4im12d15y2011 how to read and save those numbers from this part of the text: j3jn34fb4im12d15y2011 i've searched for hours but i didn't find anything |
Re: Read File question
Quote:
Also, you could just use my user extra info plugin and then you can just put the expiration in users.ini. |
Re: Read File question
ok, i understand now what you're saying.
So its better to rewrite the lines in timer.ini to loook like this: "authid" "pass" "flags" Exp:25102011 What you said there is allright, but how to extract the date from a whole line ? it should read the line, search for the numbers and then date[32]="thosenumebers" ... i can't think at something else. |
Re: Read File question
Quote:
Code:
"STEAM_0:0:12345" "password" "abc" "12252011" |
Re: Read File question
Thanks for helping me :)
|
Re: Read File question
Quote:
|
| All times are GMT -4. The time now is 12:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.