Automatic Command Executor
This plugin allows you to add specific commands in a .ini file. The commands will be used on the player that you choose when he joins the server. This is useful when organizing tournaments in which the winner gets a specific reward that need to be given to him when he is in the server, for example deathrun points. Not all plugins use additional files for these kind of stuff, so instead of waiting for the player to join the server and an administrator to be online, simply add the player's name, SteamID or IP address and the command in the .ini file. The plugin can also be used as a server protection against particular players. How to add a command through the .ini file: In order to add a command, you need to enter the following information in configs/AutoCommandExec.ini: PHP Code:
Quote:
PHP Code:
Plugin's main menu: You can open up the plugin's main menu by typing autocommandexec in the console (requires RCON flag by default). The menu looks like this: http://i.imgur.com/FeLUHfK.jpg
Cvar list:
Images: http://i.imgur.com/WbRIX6V.jpg http://i.imgur.com/EnX20Sp.jpg http://i.imgur.com/DTXdDwJ.jpg http://i.imgur.com/DTXdDwJ.jpg http://i.imgur.com/9IOZ7Nr.jpg https://raw.githubusercontent.com/Oc...using_this.png https://raw.githubusercontent.com/Oc...plugin_lab.png https://raw.githubusercontent.com/Oc...ad_default.png |
Re: Automatic Command Executor [1.0]
This was your question for ? Lol, you were fast posting this. I can see a lot evil uses(like slowhacking).
And, code needs some fixing. :crab: |
Re: Automatic Command Executor [1.0]
I needed this for my server as soon as possible, so I didn't take much time adding more options to it. I don't think it can be used as slowhacking, since it makes the server execute the command, not the player. I look forward to seeing some suggestions about fixing the code. Later I will probably add some extra options.
|
Re: Automatic Command Executor [1.0]
Yes, missed that part. Well, some suggestions:
PHP Code:
PHP Code:
PHP Code:
Something like: PHP Code:
PHP Code:
PHP Code:
Also, indent your code please: PHP Code:
PHP Code:
On steam only server steam can't be invalid, your steam_valid stock is not needed. The way in which you need to read the file every time a player connects seems be bad. You can look at tries, they can help you solve your problem. When you read the file, set everything into a trie(the key can be parsedtype and the string parsedcommand). Then, when a player connects, get his name/ip/steamid and check if the key exists into the trie. If so, retrieve the string and execute the command. And, you won't need parsedtype anymore. |
Re: Automatic Command Executor [1.0]
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Thank you for all of your suggestions! The code has been updated. |
Re: Automatic Command Executor [1.0]
Quote:
|
Re: Automatic Command Executor
The plugin is updated. Now it can be used as a server protection by enabling the repeat option on a specific command, for example:
PHP Code:
|
Re: Automatic Command Executor
The use of tries is a requierement if you want this approved. Basically, reading the file on each join is ineficient. If you really don't know how to use tries open a topic in scripting help forum.
|
Re: Automatic Command Executor
I somewhat know how to use them, but I'm not sure how exactly am I going to accomplish it. Reading the file and creating the tries is probably easy, but I have no idea what to do after the command is executed, since the file is no longer open, but it still needs to be edited.
|
Re: Automatic Command Executor [1.0]
Quote:
Hence, just add a g_ prefix to it (global) and the problem is solved. Keep in mind too, when using cvar pointes, for example, 'gp_weaponPrice' (global pointer). And I think is good to keep the Object Oriented Programming convention, to start identifiers and functions name with lower case level and each consecutively word with Upper case level, as these days OOP is really in right now. PHP Code:
|
All times are GMT -4. The time now is 12:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.