This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

client_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 10-17-2012 , 00:59   client_cmd
Reply With Quote #1

What is the difference between this

client_cmd(index,"command")

and that

engclient_cmd(index,"command")
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Bos93
Veteran Member
Join Date: Jul 2010
Old 10-17-2012 , 01:19   Re: client_cmd
Reply With Quote #2

client_cmd
(index,"command")
command by server
engclient_cmd
(index,"command")
command by client
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-17-2012 , 02:03   Re: client_cmd
Reply With Quote #3

That is not correct (opposite would be more correct).

First you have to know there are 2 types of clients commands.

'clientside' client commands (disconnect, reconnect, quit, ...)
'sent to server' client commands (buy, drop, status, ...)


For the first type, the only way you have to make client execute it is client_cmd.

client_cmd executes the command in player console.


For the 2nd type of client commands, we have to make a distinction between engine commands and dll commands.

First you have to know that server works with engine (hlds) and dll (cstrike).
engine sends things to dll, and dll sends things to engine.
Metamod intercepts those communications and that is what allows to make addons.

So, there are engine commands and dll commands.

Routine :
- client sends a command
- engine receives it
- if this command is not an engine command, engine sends that command to dll.

Exemple :

client type 'status' in his console

This is an engine command, engine receive, print status in client console.

client type 'rebuy' in his console

This is not an engine command, so once engine has received it, engine sends it to game dll, and this is that action that metamod can intercept.


So, for engine commands, engclient_cmd won't have any effect, you have to use it only for game dll commands.

client_cmd :
for clientside commands (quit, disconnect, ...)
for engine commands (status, ...)
for game dll commands (drop, +jump, nightvision, ...)

engclient_cmd :
for game dll commands (drop, +jump, nightvision, ...)


Note that command sent with engclient_cmd won't be cought by modules or amxx plugins, because that command is not sent to the dll by the engine, but by metamod.
If you want such commands to be hookable, then use client_cmd.

Last, engclient_cmd is sent when plugin sends it, client_cmd is sent to client and then the client sends it back so there is a ping delay.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-17-2012 at 02:05.
ConnorMcLeod is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 10-17-2012 , 02:12   Re: client_cmd
Reply With Quote #4

Thanks ConnorMcLeod
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 10-17-2012 , 09:59   Re: client_cmd
Reply With Quote #5

Very Thanks
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
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 21:11.


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