Jump to content

x[directory]xhow


Master_MTA

Recommended Posts

8 minutes ago, LopSided_ said:

need

if i wasn't wrong you can check that

  • filePath: The filepath of the file to be created in the following format: ":resourceName/path". 'resourceName' is the name of the resource the file is in, and 'path' is the path from the root directory of the resource to the file.

i tested it before and it doesn't work

that wasn't my mean i mean i wanna create folder out side the resource

Link to comment
  • Administrators

Well, that wasn't what you asked for :P

You can create a folder in another resource, by doing

fileCreate(":resourceName/path/file.lua")

Some examples of your code would help, too

Edited by LopSided_
Link to comment
3 minutes ago, LopSided_ said:

Well, that wasn't what you asked for :P

You can create a folder in another resource, by doing


fileCreate(":resourceName/path/file.lua")

Some examples of your code would help, too

i wasn't mean that also xD

i was mean i wanna create folder out side all resource i wanna create folder in mods or resource-chahe  does it possible? 

Link to comment
7 hours ago, LopSided_ said:

Not sure, it might be outdated. Don't know too much about it if I'm being honest

thx i am created my own function

function copyResourceIntoResource(res,tores)
local ta={}
local conf=xmlLoadFile( ':'..res..'/meta.xml' )
	local cildren=xmlNodeGetChildren(conf)
		local function isreg(value,msr)
			if #msr==0 then return false end
				for l,c in pairs(msr) do
					if c==value or (#split(c,',')>1 and split(c,',')[1]==value) then return l end
			end
		return false
	end
		for k=1,#cildren do
			local name=xmlNodeGetName(cildren[k])
				local jj=isreg(name,ta)
					if jj~=false then
					ta[jj]=ta[jj]..','..name
				else
					table.insert(ta,name)
			end
		end
	fileCopy(':'..res..'/'..'meta.xml', tores..'/'..res.."/meta.xml")
	for k,v in pairs(ta)do
		local spl=#split(v,',')
			for m=0,spl-1 do
				local chil=xmlFindChild (conf,split(v,',')[1],m)
				local at=xmlNodeGetAttribute(chil,'src')
				if at then
					 fileCopy(':'..res..'/'..at, tores..'/'..res.."/"..at)
					 if #ta==k then 	xmlUnloadFile(conf) return true end
				end
			end
		end
return false

end

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...