AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Command Targeting Plus (https://forums.alliedmods.net/showthread.php?t=292897)

OciXCrom 01-19-2017 20:19

Re: Command Targeting Plus
 
Um, where did you see messages in the plugin? What's wrong with the defines? :)

edon1337 01-20-2017 07:01

Re: Command Targeting Plus
 
I meant, to add messages, because there's none.. And the define number LOL also you defined PLUGIN_HANDLED as KRAJ it seems weird :)

OciXCrom 01-20-2017 08:45

Re: Command Targeting Plus
 
What do you mean there's none? My plugin uses commands from other plugins, so those other plugins should provide the messages. amx_nick already has a message, it's a default command from AMXX. I don't think you understood how this plugin works.

edon1337 01-20-2017 13:48

Re: Command Targeting Plus
 
Oh my bad, I see now :P

HamletEagle 01-21-2017 09:25

Re: Command Targeting Plus
 
I wanted to do something like that and submit it for the next amxx version, but since I don't have much time and because I got bored I never finished it. Someone else tried to, but he failed. https://github.com/alliedmodders/amxmodx/pull/368

At some point, I'll probably start working on that again.

szArg[0] = EOS is not needed.

Usually I don't have a problem when people rename stuff to make it easier for them, but here it's a readability killer.

PHP Code:

#define KRAJ return PLUGIN_HANDLED; 

Don't do that.

return only one time, at the end of szArg[0] == '@' check.
Also I don't like the duplicated code from do_cmd_by_index, but that's not something terrible. Make a custom function and place the code there.

Other than that, looks fine.

Relaxing 01-21-2017 11:54

Re: Command Targeting Plus
 
Is your plugin the answer of my topic?
If I just keep adding commands to .ini file will it work for them too?

HamletEagle 01-21-2017 12:52

Re: Command Targeting Plus
 
Quote:

Originally Posted by Relaxing (Post 2488670)
Is your plugin the answer of my topic?
If I just keep adding commands to .ini file will it work for them too?

If you have a respawn plugin by command which works with a player index, yes. If you don't, no.

OciXCrom 01-22-2017 08:43

Re: Command Targeting Plus
 
Quote:

Originally Posted by HamletEagle (Post 2488626)
szArg[0] = EOS is not needed.

If I remove that, changing the value of szArg for just one command will set the same value to all commands below it - http://i.imgur.com/wGROx3B.jpg

Quote:

Originally Posted by HamletEagle (Post 2488626)
Usually I don't have a problem when people rename stuff to make it easier for them, but here it's a readability killer.

PHP Code:

#define KRAJ return PLUGIN_HANDLED; 

Don't do that.

return only one time, at the end of szArg[0] == '@' check.

My idea was to use PLUGIN_CONTINUE so the command's plugin will take over if there's no match in the '@' check, but I guess it's no big deal, so I did it like you asked.

Quote:

Originally Posted by HamletEagle (Post 2488626)
Also I don't like the duplicated code from do_cmd_by_index, but that's not something terrible. Make a custom function and place the code there.

Didn't notice it was the same. Fixed.

I also added @spec and @spectating from the github link.

HamletEagle 01-22-2017 09:43

Re: Command Targeting Plus
 
Fastly checked and all I see is that iPlayers[i] should be cached inside the loop. In OnCommand I would add a is_user_connected check.
Fix it please.
Other than that, it looks fine. Approved.

OciXCrom 01-22-2017 10:17

Re: Command Targeting Plus
 
You mean new iPlayer = iPlayers[i], right? Isn't selecting an entry from the array the same or I got it wrong?

About the is_user_connected check - these commands should also be available to execute through the server's console, so that check would make that impossible. I think that check should be added only on specific arguments - @aim, @me and @spectating, since these can't be possibly used through the console. I added that now.

Thanks for approving.


All times are GMT -4. The time now is 16:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.