Jump to content

File Watcher


snatvb

Recommended Posts

23 minutes ago, LoPollo said:

What do you mean?

if you mean functions to access files, then they do exist: they are the file functions
Edit: do you mean something like https://msdn.microsoft.com/it-it/library/system.io.filesystemwatcher(v=vs.110).aspx? So an event that get riggered when a file/directory gets an edit?

yes! i mean second, like frontend, when i edit file, then webpack compile all files in ome file, or like nodejs, etc

so, i can use something like?

example:

I have resource "hud", I edit file in the dir ("hud/client.lua") -> Server update resource (like command "restart hud")

Edited by snatvb
Link to comment

I'm sorry, but i don't think there's anything like that. Also note that restarting a resource like you said

11 minutes ago, snatvb said:

Server update resource (like command "restart hud")

will cause (obviously) the resource stop, and what about if the resource was doing something??? think about a "mission" resource, a player is in that mission and then.... the resource get restarted. No more mission... it's sad :)

I think that having to do it manually is the best option available. Remember also that there are other ways to restart a resource other than from the server console:

using the commands from an admin account, like /refresh and /restart someResource or with other resources like the admin panel

  • Like 1
Link to comment
1 minute ago, LoPollo said:

I'm sorry, but i don't think there's anything like that. Also note that restarting a resource like you said

will cause (obviously) the resource stop, and what about if the resource was doing something??? think about a "mission" resource, a player is in that mission and then.... the resource get restarted. No more mission... it's sad :)

I think that having to do it manually is the best option available. Remember also that there are other ways to restart a resource other than from the server console:

using the commands from an admin account, like /refresh and /restart someResource or with other resources like the admin panel

"will cause (obviously) the resource stop, and what about if the resource was doing something??? think about a "mission" resource, a player is in that mission and then.... the resource get restarted. No more mission... it's sad :)"

 

this need for develop, fast develop and comfort

you don't know how i can contact with developers for resolve this problem?

maybe with use third-party programs?

Link to comment

"bind 1 cleardebug"

"bind 1 restart my-resourcename"

Takes you 1 key press. Also, I like to save my scripts as I go and most of the times the script is broken/not finished while I save it, it would be pointless to restart it, wouldn't it? You can probably develop this feature yourself within MTA boundaries. 

Link to comment
8 hours ago, pa3ck said:

"bind 1 cleardebug"

"bind 1 restart my-resourcename"

Takes you 1 key press. Also, I like to save my scripts as I go and most of the times the script is broken/not finished while I save it, it would be pointless to restart it, wouldn't it? You can probably develop this feature yourself within MTA boundaries. 

no. it's bad idea, because will not be able to write "1" in console)

maybe "ctrl+r" and something like)

But i bad know C++ that write the function in server mta

Link to comment

Are you in the Admin ACL group? If not, open acl.xml and search for the group admin, then add your username like this:

<object name="user.USERNAME"></object>

4897be98d6574f2999f99e579dcb4150.png

If you don't have a user account registered on your server yet, create one with /register [on the server] or use 'addaccount' command in the server console.

Alternatively, you can also use MTA functions to put yourself in the admin group with aclGroupAddObject and this way you don't have to restart the server.

Once you added your account to the ACL group, all you have to do is login and you will be able to use commands like: 

/restart

/refresh

/stop

/start 

etc...

Then you will be able to bind commands like "/restart resource" 

  • Like 1
Link to comment
2 hours ago, pa3ck said:

Are you in the Admin ACL group? If not, open acl.xml and search for the group admin, then add your username like this:

<object name="user.USERNAME"></object>

4897be98d6574f2999f99e579dcb4150.png

If you don't have a user account registered on your server yet, create one with /register [on the server] or use 'addaccount' command in the server console.

Alternatively, you can also use MTA functions to put yourself in the admin group with aclGroupAddObject and this way you don't have to restart the server.

Once you added your account to the ACL group, all you have to do is login and you will be able to use commands like: 

/restart

/refresh

/stop

/start 

etc...

Then you will be able to bind commands like "/restart resource" 

oh, maaan, very-very thanks, u so help me!

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