AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register "lastinv" command doesn't work (https://forums.alliedmods.net/showthread.php?t=101467)

Alucard^ 08-24-2009 07:22

register "lastinv" command doesn't work
 
PHP Code:

public plugin_init()   
    
register_clcmd("lastinv""HookLastInv")

public 
HookLastInv(id)
    
client_print(idprint_chat"I'am a debug message. And I dont work :("

Why this doesn't work? this is not the correct method to detect the "lastinv" command?

Arkshine 08-24-2009 07:54

Re: register "lastinv" command doesn't work
 
If it doesn't work, it means you can't hook it, after all it's a client-side command.

Alucard^ 08-24-2009 08:21

Re: register "lastinv" command doesn't work
 
Yes Arkshine, before when i posted this i saw a thread... where connor said "You can't hook that command".

BUT.....

PHP Code:

new gi_rcslotnum

new gs_rcarray[42][] =
{
    
"attack",
    
"attack2",
    
"reload",
    
"use",
    
"impulse100",
    
"impulse201",
    
"buyequip",
    
"chooseteam",
    
"cl_autobuy",
    
"cl_setautobuy",
    
"coverme",
    
"drop",
    
"enemydown",
    
"enemyspot",
    
"fallback",
    
"followme",
    
"getinpos",
    
"getout",
    
"go",
    
"holdpos",
    
"inposition",
    
"lastinv",
    
"needbackup",
    
"negative",
    
"nightvision",
    
"radio1",
    
"radio2",
    
"radio3",
    
"regroup",
    
"report",
    
"reportingin",
    
"roger",
    
"say",
    
"say_team",
    
"sectorclear",
    
"sticktog",
    
"stormfront",
    
"takepoint",
    
"takingfire",
    
"weapon_knife",
    
"weapon_c4",
    
"immunity"
}

...

    for ( 
gi_rcslotnum 6gi_rcslotnum 41gi_rcslotnum++ )
    {
        
register_clcmd gs_rcarray[gi_rcslotnum], "fn_hookclcmds" )
    }

...

public 
fn_hookclcmds id )
{
    
read_argv 0gs_clcmdarg014 )
    
    if ( ! 
fn_player_is_immuned id ) && fn_find_and_get_pcvar gs_clcmdarg0 ) || ! fn_player_is_immuned id ) && fn_find_clcmdflag idgs_clcmdarg0 ) )
    {
        
fn_printmessage id )
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE


From this plugin: http://forums.alliedmods.net/showthread.php?t=27089

What i understand of that code is the "same" as mine but with more commands. My understand is wrong? how this plugin detect the lastinv and block it?

Alka 08-24-2009 08:27

Re: register "lastinv" command doesn't work
 
The command it's just listed but it won't block it , because isn't hookable.

Alucard^ 08-24-2009 08:39

Re: register "lastinv" command doesn't work
 
Ok, thx, so... i tried this:

PHP Code:

public client_command(id)
{
    new 
arg[32]
    
read_argv(idargcharsmax(arg) )
    
    if(
equali(arg"lastinv") )
        
client_print(0print_chat"Debug Message")


But doesn't work when i added the condition... this is wrong method or i writed something wrong?

Arkshine 08-24-2009 08:47

Re: register "lastinv" command doesn't work
 
Quote:

because isn't hookable.

joaquimandrade 08-24-2009 08:48

Re: register "lastinv" command doesn't work
 
That command is not networked so, the server can't know when a player execute it.

Alucard^ 08-24-2009 08:59

Re: register "lastinv" command doesn't work
 
So it's imposible to do something when a player execute that command?

Alka 08-24-2009 09:23

Re: register "lastinv" command doesn't work
 
Exactly.

hleV 08-24-2009 10:11

Re: register "lastinv" command doesn't work
 
It was hookable in SoccerJam plugin. It might no longer be hookable in newer AMXX versions or CS updates, but it was for sure.


All times are GMT -4. The time now is 15:12.

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