Hooking Console commands
Uh ... sorry for the previous misplacement of this topic :oops:, my bad
So generally I want to hook what a player wrights into his console ... and then work with what I hooked, It was suggested to recomply all my plugins but that is to inefficient and time consuming as there are a lot of plugins and many more may be added with ought me realizing ( my server is administered by me and a friend that may temper with the plugins ) So I wanted to make a plugin that will convert any console command that starts with amx_command to admin_command ( demanded by server admins ). I figured that it would be possible if i do this Code:
public plugin_init() { |
Re: Hooking Console commands
Try using the native client_command. You don't need to register anything new and you can do it using what you have right there. Just replace public handle_say(id) with public client_command(id). It should work fine, but I am not sure
|
Re: Hooking Console commands
PHP Code:
|
Re: Hooking Console commands
Why would you possibly want to edit?
I think you have to enter every one of them since "admin_" isn't a cmd... I belive register_clcmd isn't using containi()... |
Re: Hooking Console commands
I think you made a typo in your original code. You executed admin_%s instead of executing amx_%s - making your code do basically nothing.
Code:
|
Re: Hooking Console commands
it was not a typo i thought it was subliminal to express my intention as i made that up not via script editor
Ty for confirming it and helping me :D rep+ Quote:
|
Re: Hooking Console commands
hehe looks like i jumped the gun ... looks like i get error when exec command
runtime error 10 replace<> buffer not big enought <7>=6> |
Re: Hooking Console commands
Woops! make it replace(...7.... instead of 6
|
Re: Hooking Console commands
Hehehe i've done that b4 posting ... as i recall it didn't work ... allso the engclient_cmd didn't work either ... witch was cainda weard ... but I've made a working version of the script ( at least this works for me )
I guess ill post it here for other ppl (if they use search) Quote:
|
| All times are GMT -4. The time now is 01:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.