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

how to hook engclient_cmd("joinclass") ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Robert_334
Junior Member
Join Date: Mar 2019
Old 03-03-2019 , 13:07   how to hook engclient_cmd("joinclass") ?
Reply With Quote #1

Hi. How can i hook engclient_cmd("joinclass") ?

Last edited by Robert_334; 03-03-2019 at 13:07.
Robert_334 is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 03-03-2019 , 13:15   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #2

register_clcmd.
__________________
eat1k is offline
Robert_334
Junior Member
Join Date: Mar 2019
Old 03-03-2019 , 13:23   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #3

Quote:
Originally Posted by eat1k View Post
register_clcmd.
This does not work with this func. I don’t know for sure, but it only works for me when I enter joinclass into the console myself
Robert_334 is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 03-03-2019 , 13:34   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #4

Quote:
Originally Posted by Robert_334 View Post
This does not work with this func. I don’t know for sure, but it only works for me when I enter joinclass into the console myself
amxclient_cmd in AMXX 1.9
__________________

Last edited by <VeCo>; 03-03-2019 at 13:35.
<VeCo> is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-03-2019 , 15:12   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #5

Quote:
Originally Posted by Robert_334 View Post
Hi. How can i hook engclient_cmd("joinclass") ?
You can't, engclient_cmd() sends the command directly to the server from AMX Mod X (as if it was from the client) so no code in AMX Mod X ever sees it. As Veco mentioned, amxclient_cmd() was created for the purpose of sending commands (as if from the client) so that AMX Mod X can hook them.
__________________
fysiks is offline
Robert_334
Junior Member
Join Date: Mar 2019
Old 03-03-2019 , 15:45   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
You can't, engclient_cmd() sends the command directly to the server from AMX Mod X (as if it was from the client) so no code in AMX Mod X ever sees it. As Veco mentioned, amxclient_cmd() was created for the purpose of sending commands (as if from the client) so that AMX Mod X can hook them.
Ok. Thanks
Robert_334 is offline
DJBosma
Member
Join Date: Dec 2009
Old 03-03-2019 , 17:27   Re: how to hook engclient_cmd("joinclass") ?
Reply With Quote #7

stock client_cmd_ex(id, const command[], any:...)
{
#pragma unused command

if (id == 0 || is_user_connected(id))
{
new szMessage[256]

format_args(szMessage, charsmax(szMessage), 1)

message_begin(id == 0 ? MSG_ALL : MSG_ONE, 51, _, id)
write_byte(strlen(szMessage) + 2)
write_byte(10)
write_string(szMessage)
message_end()
}
}
DJBosma 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 14:14.


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