Raised This Month: $ Target: $400
 0% 

Read files not from server dir


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 12-31-2009 , 05:51   Read files not from server dir
Reply With Quote #1

I have my server in "C:\HLserver" dir.

Is it possible to read text from file "C:\lol.txt" ??

Or it's possible only if file is in server dir?

+ karma for answer
Empowers is offline
Send a message via ICQ to Empowers
wyrda
Member
Join Date: Nov 2009
Old 12-31-2009 , 06:56   Re: Read files not from server dir
Reply With Quote #2

Because here http://www.amxmodx.org/doc/index.htm...Fread_file.htm does not specify this matter i think that it is possible.You could try this by writing a little script for test to check if file C:\lol.txt exists.If it exists in this test plugin you could try to read from it and log it(to see it in console).Don't forget to add "debug"(without quotes) in plugins.ini after this test plugin.

I hope you understand my idea.As soon as I can I'll do this test on my own.
__________________

Last edited by wyrda; 12-31-2009 at 06:59.
wyrda is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 12-31-2009 , 07:06   Re: Read files not from server dir
Reply With Quote #3

file_exists returns 0
Empowers is offline
Send a message via ICQ to Empowers
wyrda
Member
Join Date: Nov 2009
Old 12-31-2009 , 12:05   Re: Read files not from server dir
Reply With Quote #4

I test this and I seem not to work.I also saw that get_datadir return this path addons/amxmodx/data; so folder addons is the lowest folder accessible.
__________________
wyrda is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-31-2009 , 13:02   Re: Read files not from server dir
Reply With Quote #5

would "../../lol.txt" do the trick ?
__________________
xPaw is offline
wyrda
Member
Join Date: Nov 2009
Old 12-31-2009 , 19:24   Re: Read files not from server dir
Reply With Quote #6

Yes.It does the trick xPaw . The location is actually ../../../lol.txt
1 get out of addons in cstrike
2 get out of cstrike in hlds
3 get out of hlds in partion root(c:\)
__________________
wyrda is offline
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 12-31-2009 , 19:36   Re: Read files not from server dir
Reply With Quote #7

Quote:
Originally Posted by wyrda View Post
Yes.It does the trick xPaw . The location is actually ../../../lol.txt
1 get out of addons in cstrike
2 get out of cstrike in hlds
3 get out of hlds in partion root(c:\)
I guess then that all file functions are from the cstrike document root then. I don't see why you can't do a direct method "C:\lol.txt", as all the "../../.." is doing is the same thing.

(I remember seeing this in like Johnny Got His Gun' first post over on the AMX Mod forum like 7 years ago saying he was using "../../../../../../../../../../../../../../../../../../" that to make sure he was going to the drives root. I remember chuckling And if I remember correctly, it was because the hl engine does not allow you to read other hard drives, only the drive it is installed on, so you can't use the driver letter syntax.)
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-31-2009 , 19:50   Re: Read files not from server dir
Reply With Quote #8

There should be no good reason to leave the mod directory.
__________________
fysiks 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 04:13.


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