Krom Posted January 6, 2009 Share Posted January 6, 2009 Hello. Here's bit of simple client-side code: default_file = xmlLoadFile("default.xml") new_file = xmlCopyFile(default_file,"new.xml") xmlSaveFile(new_file) The idea is to obtain an exact copy of a "default.xml" file given, and to rename the copy into "new.xml". Both functions returns what they should, means not "false", but nothing named "new.xml" appears in client-side game mod directory. Where's mistake? It's very pity that some functions don't have according examples at MTA-wiki page, so I have to ask for help here. Hope someone can give me such a nice example. Link to comment
50p Posted January 6, 2009 Share Posted January 6, 2009 What folders did you check? It should be in a folder named the same as resource folder on the server. Also unload the file to save memory (after you save, xmlUnloadFile). Link to comment
Krom Posted January 6, 2009 Author Share Posted January 6, 2009 Resource folder is "..\MTA San Andreas\server\mods\deathmatch\resources\testmod" Just found that new.xml in "..\MTA San Andreas\mods\deathmatch", however it should be placed in "..\MTA San Andreas\mods\deathmatch\resources\testmod" as far as I understand. Still, can't see what's wrong. Don't have any Cyrillic in folders paths, if that matters. As for xmlUnloadFile - sure, simply missed that in code, it doesn't affect anything, right? Link to comment
DiSaMe Posted January 6, 2009 Share Posted January 6, 2009 So it's a client-side script, isn't it? Link to comment
50p Posted January 6, 2009 Share Posted January 6, 2009 This is weird... I never had problem with files being placed in "...\deathmatch\" directory. Might be an MTA bug. So it's a client-side script, isn't it? If you read carefully you'd see in the first post it's client-side Link to comment
DiSaMe Posted January 6, 2009 Share Posted January 6, 2009 So it's a client-side script, isn't it? If you read carefully you'd see in the first post it's client-side Oops, I didn't see that Link to comment
Krom Posted January 9, 2009 Author Share Posted January 9, 2009 Can't fight that, it keeps to create new file in "deathmatch" folder.. So there're "resources", Client.dll and that damn "localConfig.xml", which I need to be in other place. Can't believe that nobody ever faced with this. Am I the Chosen One? Link to comment
darkdreamingdan Posted January 13, 2009 Share Posted January 13, 2009 It sounds like an MTA bug. xmlCreateFile used to exhibit similar behaviour till it was reported and fixed (pre-dp1). Clearly no one tried xmlCopyFile. However, i am fairly sure that it is working serverside. Report this on our bugtracker and it can be fixed for 1.0. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now