Raised This Month: $32 Target: $400
 8% 

Command Targeting Plus


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-19-2017 , 20:19   Re: Command Targeting Plus
Reply With Quote #21

Um, where did you see messages in the plugin? What's wrong with the defines?
__________________

Last edited by OciXCrom; 01-19-2017 at 20:20.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2017 , 07:01   Re: Command Targeting Plus
Reply With Quote #22

I meant, to add messages, because there's none.. And the define number LOL also you defined PLUGIN_HANDLED as KRAJ it seems weird
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-20-2017 , 08:45   Re: Command Targeting Plus
Reply With Quote #23

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.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2017 , 13:48   Re: Command Targeting Plus
Reply With Quote #24

Oh my bad, I see now
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-21-2017 , 09:25   Re: Command Targeting Plus
Reply With Quote #25

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

Last edited by HamletEagle; 01-21-2017 at 09:26.
HamletEagle is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-21-2017 , 11:54   Re: Command Targeting Plus
Reply With Quote #26

Is your plugin the answer of my topic?
If I just keep adding commands to .ini file will it work for them too?
__________________
Relaxing is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-21-2017 , 12:52   Re: Command Targeting Plus
Reply With Quote #27

Quote:
Originally Posted by Relaxing View Post
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.
__________________
HamletEagle is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-22-2017 , 08:43   Re: Command Targeting Plus
Reply With Quote #28

Quote:
Originally Posted by HamletEagle View Post
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 View Post
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 View Post
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.
__________________

Last edited by OciXCrom; 01-22-2017 at 08:52.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-22-2017 , 09:43   Re: Command Targeting Plus
Reply With Quote #29

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

Last edited by HamletEagle; 01-22-2017 at 09:44.
HamletEagle is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-22-2017 , 10:17   Re: Command Targeting Plus
Reply With Quote #30

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

Last edited by OciXCrom; 01-22-2017 at 10:53.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:21.


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