Drathian Posted February 11, 2015 Share Posted February 11, 2015 (edited) I'm not sure if this is the right place to ask this but is it even possible in lua (i know some programing langauges have restrictions on that) to access the console command line from other scripts, ie: type something in console (server and/or client) at runtime or toggle? For instance I have a few things that are settings that I don't wish to edit the script to make them defaults, but would rather enter commands at startup or toggle. Or is there a way to send commands via a text file kinda like: run file.txt Thank you for reading, even more if you can provide any solution! Edited February 14, 2015 by Guest Link to comment
Dealman Posted February 11, 2015 Share Posted February 11, 2015 Not entirely sure what you're talking about, but do you mean settings for specific resources? You can use getResourceConfig to name one of the ways. There are more, but this is probably the most common. You can edit the settings of resources via the admin panel. Link to comment
Drathian Posted February 11, 2015 Author Share Posted February 11, 2015 I mean settings as in console commandline settings. Say I have a mod that makes all cars pink by typing: /pinky and another script that has sky green: /skygreen How would i get them to auto type that at launch in the console: aka mta-startup..... /pinky /skygreen Link to comment
.:HyPeX:. Posted February 11, 2015 Share Posted February 11, 2015 Make a resource to execute the function on resource start and make the server start the resource when it starts Link to comment
Drathian Posted February 11, 2015 Author Share Posted February 11, 2015 Yeah i was checking to see if that could be done, I didn't think scripts could share local variables globally. What about a solution for client start? Link to comment
Drathian Posted February 14, 2015 Author Share Posted February 14, 2015 So you can execute functions from other scripts directly hmm that is useful. I was thinking of reading commands from a list of some sort like a txt file. I guess that would have something to do with arrays which i'm terrible at. 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