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

amxclient_cmd bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-22-2017 , 18:38   amxclient_cmd bug?
Reply With Quote #1

Using read_argv + trim somehow stops the say command from sending the text when it's used with amxclient_cmd.

1. Use amx_test in console.
In chat it prints "Hello!".

2. Use amx_test 1
Nothing is printed.

Code:
#include <amxmodx> new bool:bToggle; public plugin_init() {     register_clcmd("say", "CMD_Say");     register_concmd("amx_test", "CMD_Test", ADMIN_ALL); } public CMD_Say(id) {     static Text[192];     if(bToggle)     {         read_args(Text, charsmax(Text));         trim(Text);     }     return PLUGIN_CONTINUE; } public CMD_Test(id) {     bToggle = read_argc() >= 2 ? true : false;     amxclient_cmd(id, "say", "Hello!");     return PLUGIN_HANDLED; }

Last edited by PartialCloning; 05-10-2017 at 14:45.
PartialCloning is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-29-2017 , 17:18   Re: amxclient_cmd bug?
Reply With Quote #2

This issue also occurs when using:
Code:
read_argv(1, Text, charsmax(Text));
However the chat message is not blocked when using:
Code:
read_argv(0, Text, charsmax(Text));
PartialCloning is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-10-2017 , 01:55   Re: amxclient_cmd bug?
Reply With Quote #3

BUMP! Can someone with 10 minutes to spare test the above plugin and confirm the bug is reproducible?
PartialCloning is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-10-2017 , 09:39   Re: amxclient_cmd bug?
Reply With Quote #4

Not sure to understand the issue.

If you mean that you don't see "Hello!" in the game, this means likely you have a plugin blocking say command or something.
__________________
Arkshine is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-10-2017 , 11:11   Re: amxclient_cmd bug?
Reply With Quote #5

Only the default amxmodx plugins and the above plugin were running.

1. When you run "amx_test" in console it prints in chat "Hello!".
2. When you run "amx_test 1" in console nothing is printed in chat.

Last edited by PartialCloning; 05-10-2017 at 14:45.
PartialCloning is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-10-2017 , 12:20   Re: amxclient_cmd bug?
Reply With Quote #6

PHP Code:
register_concmd("amxclient_cmd""CMD_AMXClientCMD"ADMIN_ALL); 
why this name couldn't you pick any name that is not confusing ? like :

PHP Code:
register_concmd("amx_test""CMD_AMXClientCMD"ADMIN_ALL); 
__________________

Last edited by JusTGo; 05-10-2017 at 12:20.
JusTGo is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-10-2017 , 14:46   Re: amxclient_cmd bug?
Reply With Quote #7

Quote:
Originally Posted by JusTGo View Post
PHP Code:
register_concmd("amxclient_cmd""CMD_AMXClientCMD"ADMIN_ALL); 
why this name couldn't you pick any name that is not confusing ? like :

PHP Code:
register_concmd("amx_test""CMD_AMXClientCMD"ADMIN_ALL); 
Good point. I have edited my previous posts and changed the command to amx_test to avoid confusion.
PartialCloning is offline
Flufly
Junior Member
Join Date: May 2017
Old 05-13-2017 , 07:56   Re: amxclient_cmd bug?
Reply With Quote #8

Flufly is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-13-2017 , 20:47   Re: amxclient_cmd bug?
Reply With Quote #9

Thank you Flufly for confirming the bug is reproducible. After several more tests I found out the bug occurs when we use any native that uses "get_amxstring" while running a amxclient_cmd command.

Test plugin:
Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say", "CMD_Say");     register_concmd("amx_test", "CMD_Test", ADMIN_ALL); } public CMD_Say(id) {     str_to_num("1");     return PLUGIN_CONTINUE; } public CMD_Test(id) {     amxclient_cmd(id, "say", "Hello!");     return PLUGIN_HANDLED; }

Expected result: Printing "Hello!" in chat.
Actual result: Printing "Unknown command: 1" in console.
PartialCloning is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-14-2017 , 07:34   Re: amxclient_cmd bug?
Reply With Quote #10

can you test if the same issue happens with engclient_cmd ?
__________________
JusTGo is offline
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 02:20.


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