Jump to content

Modifying scripts


Orrer

Recommended Posts

Posted

When I want to modify a .lua script and/or an accompanying .xml file (basic freeroam, for instance), the script cannot be loaded and started. If I change only one word or an image, MTA acts like the script doesnt exist. It only works normally untouched. Why is that so? Or I am doing something wrong...

  • MTA Team
Posted

Tried doing a 'refreshall' command on the server after modifying the resource?

Posted

Refreshall shouldn't really be necessary, for me, it's always been enough to save the file and restart the resource...

Posted (edited)

I don't even see the script in my admin panel, that's the point. And when starting the server, it doesn't load (number of loaded resources is smaller) and also says "Loading of resource '' failed".

Edited by Guest
Posted

Then there's either something wrong with the script (in which case you'd get an error in the server console or debugscript,) or you've simply put it in the wrong place.

Posted

Yes, now I've edited one image in the speedometer .zip resource and renamed the whole compressed file. Message "Loading of resource '' failed" popped up in the server console. Any ideas?

Posted

Personally, I detest working with zip files. If it were me, I'd uncompress all resources you think you'll modify, and throw out the zip files. This could also be the problem, if you accidentally compressed the folder into a format MTA doesn't recognize.

Posted

"Loading of failed" usually pops up when resource has problem with meta.xml or there is no meta.xml at all. If your resource is zipped but there is no meta.xml in the root then you will get that message.

If you're modifying a resource just unzip that resource and use the folder instead of the zip because if MTA finds a folder it is treated as resource and if there is zip with the same name as the folder then zip resource is ignored.

Posted (edited)
Maybe you zipped the folder not the contents?

Yes, when I was zipping the resource folder (after modifying it), I didn't directly compress all the files -- I zipped the folder into which the files were uncompressed; it was like this: .ZIP archive -> equally named folder -> files. In another words, there was an unnecessary folder containing the resource files, and that's why MTA didn't recognize it. _slaps_forehead__by_death_au.gif

Edited by Guest
Posted

That's why I explained it to you in detail 2 posts above... I wouldn't recommend you to use zipped resources if you're developing because you'd have to update the new file inside the zip every time you change something, so to speed up the progress use folder resource. When you save the changes you made the file is updated and all you have to do is just "restart ".

Posted

You can see why a resource failed to load by typing 'info ' in the console...

Posted
That's why I explained it to you in detail 2 posts above... I wouldn't recommend you to use zipped resources if you're developing because you'd have to update the new file inside the zip every time you change something, so to speed up the progress use folder resource. When you save the changes you made the file is updated and all you have to do is just "restart ".

That's a good idea, yes.

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