Raised This Month: $51 Target: $400
 12% 

Sending and hooking client_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 12-30-2013 , 16:28   Sending and hooking client_cmd
Reply With Quote #1

When is the first moment after connecting on server to send client_cmd and hook it with concmd?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2013 , 16:30   Re: Sending and hooking client_cmd
Reply With Quote #2

You can test this on your own. Test all of the relevant forwards: client_connect() and client_putinserver().
__________________
fysiks is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 12-30-2013 , 17:23   Re: Sending and hooking client_cmd
Reply With Quote #3

Well, tested both of them, and weird output i have.
First one is not working at all, and second one is sometimes working.
I noticed when i have high ping to server, commands aren't working, and if my ping is low, commands are executed.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-31-2013 , 10:51   Re: Sending and hooking client_cmd
Reply With Quote #4

I think, but should be checked, that client_cmd is working from client_connect to client_putinserver (not when DLing via fastdownload), and at exact client_putinserver time it doesn't work (may be you can't send any message (client_cmd is sending in fine SVC_STUFFTEXT message to client)), and right after client_putinserver you can send again.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-31-2013 at 10:51.
ConnorMcLeod is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 01-02-2014 , 09:30   Re: Sending and hooking client_cmd
Reply With Quote #5

Hm, well i just noticed the same thing. What is "safe" time to send 3 client_cmd commands?
Problem is that one command can be sent in client_connect, after my command is sent, server sends me random things like:
Code:
echo "* Privileges set"
_I69fcOvuC2389648902
fullserverinfo "\*gamedir\cstrike"
And after that sometimes second and third commands are sent, and sometimes are not. I know that i can spam with commands until all are sent, but that is not the right way, i think. Does anyone have better idea?

Last edited by OvidiuS; 01-02-2014 at 09:36.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 01-02-2014 , 12:08   Re: Sending and hooking client_cmd
Reply With Quote #6

Sorry for double post, here is what i got:
Code:
#include < amxmodx > public plugin_init( ) {     register_concmd( "random_command", "console_commandRandom" );     register_concmd( "second_command", "console_commandSecond" ); } public client_connect( id )     client_cmd( id, "random_command 1" );     public console_commandRandom( id )     client_cmd( id, "second_command 1" );     public console_commandSecond( id )     client_cmd( id, "echo ^"* Executed: random_command^n * Executed: second_command^"" );

Client output:
Code:
random_command 1
echo "* Privileges set"
_o00r8OygM4227219129
fullserverinfo "\*gamedir\cstrike"
Server only executed "random_command 1" on client. Same output is with register_clcmd if that makes any difference.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-03-2014 , 01:36   Re: Sending and hooking client_cmd
Reply With Quote #7

It doesn't make any difference, but for client commands, do only use register_clcmd.
register_concmd is to register server + client commands at the same time.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 00:52.


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