Raised This Month: $120 Target: $400
 30% 

Solved [Help] Remove Models viewer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Senior Member
Join Date: Apr 2017
Location: Brazil
Old 09-13-2018 , 22:12   [Help] Remove Models viewer
Reply With Quote #1

Hello .. Good evening. How can I remove the skins only from the "view" of those who disabled them, eg:
An admin entered the server and received his custom skin, but a player does not like this type of customization, and uses a command, which is for example "/ models", at this time the adm that previously had a custom skin has again the default CS skin (but only for this player that disabled them) for everyone else the model should continue ...

This is the plugin I'm currently using.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

enum _:ModelsInfo
{
    
Flag,
    
CTModel[32],
    
TModel[32]
}

new 
bool:bMatch[33]

new const 
g_eModels[][ModelsInfo] =
{
       { 
ADMIN_IMMUNITY"owner_ct""owner_t" }
       { 
ADMIN_LEVEL_B"admin_ct""admin_t" }
}

new 
bool:g_bHasCustomSkin[33]

public 
plugin_init()
{
    
register_plugin("Multiple Player Models""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
    
register_clcmd("say /models""ResetModels")
}

public 
plugin_precache()
{
    for(new 
isizeof(g_eModels); i++)
    {
        
precache_player_model(g_eModels[i][CTModel])
        
precache_player_model(g_eModels[i][TModel])
    }
}

public 
client_putinserver(id)
    
g_bHasCustomSkin[id] = false

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {    
        for(new 
iFlags get_user_flags(id), isizeof(g_eModels); i++)
        {
            if(
iFlags g_eModels[i][Flag])
            {
                switch(
cs_get_user_team(id))
                {
                    case 
CS_TEAM_CTset_model(idg_eModels[i][CTModel])
                    case 
CS_TEAM_Tset_model(idg_eModels[i][TModel])
                }
                
                
bMatch[id] = true
                
break
            }
        }
        
        if(!
bMatch[id] && g_bHasCustomSkin[id])
        {
            
g_bHasCustomSkin[id] = false
            cs_reset_user_model
(id)
        }
    }
}

set_model(const id, const szModel[])
{
    
cs_set_user_model(idszModel)
    
g_bHasCustomSkin[id] = true

__________________

Last edited by iceeedr; 09-14-2018 at 17:38.
iceeedr is offline
Send a message via Skype™ to iceeedr
E1_531G
Senior Member
Join Date: Dec 2017
Old 09-14-2018 , 06:50   Re: [Help] Remove Models viewer
Reply With Quote #2

Idk if it is possible, but i know that the client can use "cl_minmodels 1" to see only default models.
__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 09-14-2018 , 08:44   Re: [Help] Remove Models viewer
Reply With Quote #3

FM_AddToFullPack
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Feel free to check my work at https://conceptstrike.blogspot.com

Check my Aliens vs. Predator: currently offline
CrazY. is offline
iceeedr
Senior Member
Join Date: Apr 2017
Location: Brazil
Old 09-14-2018 , 09:46   Re: [Help] Remove Models viewer
Reply With Quote #4

Quote:
Originally Posted by CrazY. View Post
FM_AddToFullPack
I thought about this possibility, but I'm afraid the unnecessary CPU usage just for that ...
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 09-14-2018 , 10:41   Re: [Help] Remove Models viewer
Reply With Quote #5

Quote:
Originally Posted by iceeedr View Post
I thought about this possibility, but I'm afraid the unnecessary CPU usage just for that ...
It wont be harmful if the code was optimized.
__________________
@Jailbreak API MODE 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !

@Arena Mod 90% done !

Gaming Districts Community
Donate

Last edited by Natsheh; 09-14-2018 at 14:10.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-14-2018 , 13:59   Re: [Help] Remove Models viewer
Reply With Quote #6

Quote:
Originally Posted by iceeedr View Post
I thought about this possibility, but I'm afraid the unnecessary CPU usage just for that ...
Nothing will explode, chill.
__________________
HamletEagle is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 09-14-2018 , 17:26   Re: [Help] Remove Models viewer
Reply With Quote #7

First test, then make your observations about cpu usage. There is no other way to do this.
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Feel free to check my work at https://conceptstrike.blogspot.com

Check my Aliens vs. Predator: currently offline
CrazY. is offline
iceeedr
Senior Member
Join Date: Apr 2017
Location: Brazil
Old 09-14-2018 , 17:38   Re: [Help] Remove Models viewer
Reply With Quote #8

Quote:
Originally Posted by CrazY. View Post
First test, then make your observations about cpu usage. There is no other way to do this.
Thanks for the weights, I think I'm going through the "cl_minmodels" path, so I would not use any more resources, later if need be, I'll test them with fm_addtofullpack, thanks to everyone who helped.
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
Reply


Thread Tools
Display Modes

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 19:14.


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