Raised This Month: $ Target: $400
 0% 

Find out registered functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoD2.0
New Member
Join Date: Aug 2008
Old 03-21-2009 , 05:21   Find out registered functions
Reply With Quote #1

Hi

I would like to make a plugin that for each amx_ client console command registers another equivalent admin_ function which calls the same function as the amx_ function. For example, if if have the amx_kick console command the plugin would automatically register admin_kick and make it call the same function with the same parameters.

The problem i've ran into is that get_concmd do not tell you which function the call is mapped on to.
GoD2.0 is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 03-21-2009 , 07:04   Re: Find out registered functions
Reply With Quote #2

You can replace prefix admin_ with amx_ and then execute it from the clients console with it arguments.
PHP Code:
public CommandKickidlevelcid )
{
    if ( !
cmd_accessidlevelcid) )
        return 
PLUGIN_HANDLED

    
new szCommand16 ]
    
read_argv0szCommandsizeof szCommand ) - )

    if ( 
equaliszCommand"admin_") )
        
replace_allszCommandsizeof szCommand ) - 1"admin_""amx_" )

    
client_cmdid"%s"szCommand )
    return 
PLUGIN_HANDLED

TheRadiance is offline
Send a message via ICQ to TheRadiance
Reply


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 08:56.


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