Raised This Month: $ Target: $400
 0% 

Need A Plugin Which Restricts Players to change their models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bsparty
Member
Join Date: Sep 2014
Location: India
Old 11-02-2014 , 05:30   Need A Plugin Which Restricts Players to change their models
Reply With Quote #1

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
bsparty is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-02-2014 , 06:45   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #2

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.
__________________

Last edited by claudiuhks; 11-02-2014 at 06:46.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-02-2014 , 06:55   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #3

Quote:
Originally Posted by claudiuhks View Post
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...
__________________
HamletEagle is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-02-2014 , 07:10   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
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;

__________________

Last edited by claudiuhks; 11-02-2014 at 08:26.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
bsparty
Member
Join Date: Sep 2014
Location: India
Old 11-02-2014 , 07:16   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #5

Let me try !! Thank You
bsparty is offline
Old 11-02-2014, 07:36
HamletEagle
This message has been deleted by HamletEagle.
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-03-2014 , 14:59   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #7

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.
Fr33m@n is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-06-2014 , 01:11   Re: Need A Plugin Which Restricts Players to change their models
Reply With Quote #8

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;

__________________

Last edited by hleV; 11-06-2014 at 01:14.
hleV is offline
Reply



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 17:46.


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