Raised This Month: $ Target: $400
 0% 

Hooking Console commands


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RaYden
Member
Join Date: Sep 2007
Old 10-19-2007 , 10:11   Hooking Console commands
Reply With Quote #1

Uh ... sorry for the previous misplacement of this topic , 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() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("cmd", "handle_say") <<- is this wright?
  }

public handle_say(id)
{
    new sayz[256],good[256]
    read_args(sayz,255)
    if( containi(sayz, "admin_") != -1 && strlen(sayz) > 6 )
        {
        format(good,255,sayz[6])    
        console_cmd(id,"admin_%s",good)
        }
    return PLUGIN_CONTINUE
}

Last edited by RaYden; 10-19-2007 at 10:20.
RaYden is offline
 


Thread Tools
Display Modes

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 01:20.


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