AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sending and hooking client_cmd (https://forums.alliedmods.net/showthread.php?t=232455)

OvidiuS 12-30-2013 16:28

Sending and hooking client_cmd
 
When is the first moment after connecting on server to send client_cmd and hook it with concmd?

fysiks 12-30-2013 16:30

Re: Sending and hooking client_cmd
 
You can test this on your own. Test all of the relevant forwards: client_connect() and client_putinserver().

OvidiuS 12-30-2013 17:23

Re: Sending and hooking client_cmd
 
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.

ConnorMcLeod 12-31-2013 10:51

Re: Sending and hooking client_cmd
 
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.

OvidiuS 01-02-2014 09:30

Re: Sending and hooking client_cmd
 
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?

OvidiuS 01-02-2014 12:08

Re: Sending and hooking client_cmd
 
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.

ConnorMcLeod 01-03-2014 01:36

Re: Sending and hooking client_cmd
 
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.


All times are GMT -4. The time now is 10:13.

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