Raised This Month: $12 Target: $400
 3% 

Solved [Help] Remove Models viewer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-13-2018 , 21: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

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 09-14-2018 at 16:38.
iceeedr is offline
Send a message via Skype™ to iceeedr
E1_531G
Senior Member
Join Date: Dec 2017
Old 09-14-2018 , 05: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: SP, Brazil
Old 09-14-2018 , 07:44   Re: [Help] Remove Models viewer
Reply With Quote #3

FM_AddToFullPack
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-14-2018 , 08: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 ...
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-14-2018 , 09: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 Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 09-14-2018 at 13: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 , 12: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 online now
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-14-2018 , 16: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.
__________________








CrazY. is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 09-14-2018 , 16: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.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
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 07:17.


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