AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need A Plugin Which Restricts Players to change their models (https://forums.alliedmods.net/showthread.php?t=250923)

bsparty 11-02-2014 05:30

Need A Plugin Which Restricts Players to change their models
 
For example :-
if we type in console model/models "xyz" (Name of the particular model) . He/She should not be able to change the model

claudiuhks 11-02-2014 06:45

Re: Need A Plugin Which Restricts Players to change their models
 
Frequently check whether or not the current player's model matches the required one, and if not, re-change. No way to just "block" that. It might be possible, but you need some hooks installed.

HamletEagle 11-02-2014 06:55

Re: Need A Plugin Which Restricts Players to change their models
 
Quote:

Originally Posted by claudiuhks (Post 2219133)
Frequently check whether or not the current player's model matches the required one, and if not, re-change. No way to just "block" that. It might be possible, but you need some hooks installed.

Just need to check in SetClientKeyValue...

claudiuhks 11-02-2014 07:10

Re: Need A Plugin Which Restricts Players to change their models
 
Quote:

Originally Posted by HamletEagle (Post 2219141)
Just need to check in SetClientKeyValue...

I'd say even more. Here's some Zombie Plague 4 code which would help.

PHP Code:

// Forward Client User Info Changed -prevent players from changing models-
public fw_ClientUserInfoChanged(id)
{
    
// Cache player's name
    
get_user_name(idg_playername[id], charsmax(g_playername[]))
    
    if (!
g_handle_models_on_separate_ent)
    {
        
// Get current model
        
static currentmodel[32]
        
fm_cs_get_user_model(idcurrentmodelcharsmax(currentmodel))
        
        
// If they're different, set model again
        
if (!equal(currentmodelg_playermodel[id]) && !task_exists(id+TASK_MODEL))
            
fm_cs_set_user_model(id+TASK_MODEL)
    }
}

// Forward Set ClientKey Value -prevent CS from changing player models-
public fw_SetClientKeyValue(id, const infobuffer[], const key[])
{
    
// Block CS model changes
    
if (key[0] == 'm' && key[1] == 'o' && key[2] == 'd' && key[3] == 'e' && key[4] == 'l')
        return 
FMRES_SUPERCEDE;
    
    return 
FMRES_IGNORED;



bsparty 11-02-2014 07:16

Re: Need A Plugin Which Restricts Players to change their models
 
Let me try !! Thank You

Fr33m@n 11-03-2014 14:59

Re: Need A Plugin Which Restricts Players to change their models
 
https://forums.alliedmods.net/showthread.php?t=68186

I used that to check that people don't use no smoke or modified smoke file.
You should try with your custom file.

hleV 11-06-2014 01:11

Re: Need A Plugin Which Restricts Players to change their models
 
PHP Code:

new const DESIRED_MODEL[] = "vip";

public 
OnSetClientKeyValue(client, const buffer[], const key[])
{
    if (!
equal(key"model"))
        return 
FMRES_IGNORED;
    
    
set_user_info(client"model"DESIRED_MODEL);
    
    return 
FMRES_SUPERCEDE;




All times are GMT -4. The time now is 17:46.

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