AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Console Command (https://forums.alliedmods.net/showthread.php?t=260157)

asur 03-20-2015 12:01

Block Console Command
 
Is it possible to block client side model change command i.e model/etc
If yes pls provide the code for it (y)
Thanks :D

ironskillz1 03-20-2015 13:25

Re: Block Console Command
 
Quote:

Originally Posted by asur (Post 2276031)
Is it possible to block client side model change command i.e model/etc
If yes pls provide the code for it (y)
Thanks :D

Can you explain more please?

Is it a console command you need blocked? then which?

HamletEagle 03-20-2015 13:33

Re: Block Console Command
 
AFAIK, you can't block model command.

EpicKiller 03-20-2015 15:19

Re: Block Console Command
 
Quote:

Originally Posted by HamletEagle (Post 2276085)
AFAIK, you can't block model command.

But you can set the model back to whatever it was, so the command would be useless.

PHP Code:

#include < amxmodx >
#include < cstrike >
#include < fakemeta >

public plugin_init()
    
register_forward(FM_SetClientKeyValue"cmdSetClientKeyValue");
    
public 
cmdSetClientKeyValue(id, const infobuffer[], const key[])
{
    if(
equal(key"model"))
    {
        new 
sCurModel[32];
        
cs_get_user_model(idsCurModelcharsmax(sCurModel));
        
        if(!
equal(sCurModelPlayerChoice[id]))
            
cs_set_user_model(idPlayerChoice[id]);
            
        return 
FMRES_SUPERCEDE;
    }
        
    return 
FMRES_IGNORED;


PlayerChoice being the model he chose.

HamletEagle 03-20-2015 16:33

Re: Block Console Command
 
Quote:

Originally Posted by EpicKiller (Post 2276128)
But you can set the model back to whatever it was, so the command would be useless.

PHP Code:

#include < amxmodx >
#include < cstrike >
#include < fakemeta >

public plugin_init()
    
register_forward(FM_SetClientKeyValue"cmdSetClientKeyValue");
    
public 
cmdSetClientKeyValue(id, const infobuffer[], const key[])
{
    if(
equal(key"model"))
    {
        new 
sCurModel[32];
        
cs_get_user_model(idsCurModelcharsmax(sCurModel));
        
        if(!
equal(sCurModelPlayerChoice[id]))
            
cs_set_user_model(idPlayerChoice[id]);
            
        return 
FMRES_SUPERCEDE;
    }
        
    return 
FMRES_IGNORED;


PlayerChoice being the model he chose.

I know that, I was just answering his question.

EpicKiller 03-20-2015 17:03

Re: Block Console Command
 
Quote:

Originally Posted by HamletEagle (Post 2276146)
I know that, I was just answering his question.

I wasn't arguing with you, I was just offering him a solution, as you were right.


All times are GMT -4. The time now is 19:21.

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