Jump to content

x[directory]xhow


Master_MTA

Recommended Posts

Posted

hey how i can create directory in lua?

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
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

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • MTA Team
Posted (edited)

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_
Posted
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? 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted (edited)
2 minutes ago, LopSided_ said:

It's not possible without creating your own server module (I think) 

Just out of interest why would you need to create a folder there?

i want to create a script which it will make you able to take backup of your resources +_+ nice idea right?  

Edited by Master_MTA

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
3 minutes ago, LopSided_ said:

Take a look at https://wiki.multitheftauto.com/wiki/Modules/FileSystem - I haven't used it myself so can't say whether it works or not.

 

thx a lot that's great 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
Just now, LopSided_ said:

No problem. Good luck ;)

thx but the download link doesn't work?

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • MTA Team
Posted

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

Posted
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

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

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...