Cherry / 3D2D-Textscreens

3D2D Textscreens Garry's Mod Workshop Addon
https://jross.me/3d2d-textscreens/
MIT License
27 stars 20 forks source link

Allowing the console to use the "SS_TextScreen" command #61

Closed FlorianLeChat closed 4 years ago

FlorianLeChat commented 4 years ago

Hi Cherry,

I am working on a small script that allows to save the textscreens every minute using the console.

At first, I had two issues:

These errors are due to the console being considered invalid and as a non-player, some functions such as PLAYER:ChatPrint() cannot work.

For the moment, I can't do otherwise than have this error every save, but it would be cool to make sure that executing the command through the console without error.

Thank you and have a good day!

Cherry commented 4 years ago

Hey, thanks for the detailed info!

This use-case is interesting. What's the need for saving all textscreens constantly? The feature was originally created so things like server rules, etc. could be persisted to world spawn - if the server is public and allows players to create textscreens, these are all going to end up being saved permanently to the map.

But anyway, I'm currently out of the country, but will take a look at this when I get back next week.

It should be as easy as detecting if ply is NULL, and then changing the permission detection at the top, and then the ChatPrint() call to a print() call. Would you like to submit a PR for this?

FlorianLeChat commented 4 years ago

I need to save the textscreens at regular intervals because my administrators regularly use the textscreens during events, most of the time they just forget to save them... I make their work easier!

I would like to do the PR but I really have no idea how to do this in the best way possible, so I think I'm waiting for your changes.

Cherry commented 4 years ago

This should now be implemented. Give it a try and let me know @FlorianLeChat!

FlorianLeChat commented 4 years ago

Everything is working perfectly well following the latest changes, thank you very much!