Raised This Month: $ Target: $400
 0% 

Question about read_argv / read_args


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Max3
Junior Member
Join Date: Sep 2015
Old 10-01-2015 , 02:58   Re: Question about read_argv / read_args
Reply With Quote #7

WHAT THE HELL!!!

Let's say we have 2 function that hook client_command.

First plugin:
PHP Code:
#include<amxmodx>

new new_laser_cmd[] = "+set_my_laser";

public 
plugin_init()
{
    
register_plugin("Plugin1 - Patch""1.0""");
}

public 
client_command(id)
{
    new 
command[32],

    
read_argv(0commandcharsmax(command));
    
    if (
equali(command"+setlaser"))
    {
        
// Patch that read_argv(0, _, _)
      // This function doesn't exists or I am not awared of it
      // This will set the first argument into new_laser_cmd ("+set_my_laser")
        
set_argv(0new_laser_cmdcharsmax(new_laser_cmd))
    }
    return 
PLUGIN_CONTINUE;

Second plugin:
PHP Code:
#include<amxmodx>

new new_laser_cmd[] = "+set_my_laser";

public 
plugin_init()
{
    
register_plugin("Plugin2 - The actual plugin""1.0""");
}

public 
client_command(id)
{
    new 
command[32],

    
read_argv(0commandcharsmax(command)); // now command is not +setlaser, it's +set_my_laser because we patched it in the first plugin
    
    
if (equali(commandnew_laser_cmd))
    {
        
set_laser(idcommand);
    }
    return 
PLUGIN_CONTINUE;

The first plugin replace "+setlaser" with "+set_my_laser" because that's why I wanted! The second one, the actual plugin, will not read "+setlaser" anymore, but instead of it will read "+set_my_laser" (because we replaced/patched it in first plugin).

This is just an example! So don't ask me to use client_cmd instead of patching!

I hope this time you will understand what I want!

So, there is such method or no? Doens't matter if I need to use orpheu to patch that. I really need a method to do that.
Max3 is offline
 



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 22:15.


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