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

Santa Hat, have model for custom steamid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-11-2017 , 14:07   Santa Hat, have model for custom steamid
Reply With Quote #1

Hi i'm using santa hats Blue for ct and Red for t like its supposed to, but i was asked to put a pink one for the girls, and i made the change in the mdl file, i'm just not sure how to make those changes properly in the sma, it can be set on CUSTOM_LEVEL_B

the code i'm using is this one
PHP Code:
#include < amxmodx >
#include < engine >
#include < cstrike >
#include < hamsandwich >

new const g_szHatModelCsTeams ][ ] = {
    
"",
    
"models/santahat.mdl",
    
"models/santahat_blue.mdl",
    
""
};

new 
g_iHats33 ];

public 
plugin_init( ) {
    
register_plugin"Santa Hat + Snow""1.3""xPaw" );
    
    
register_cvar"santa_hat""1.3"FCVAR_SERVER );
    
    
register_event"TeamInfo""EventTeamInfo""a" );
    
    
RegisterHamHam_Spawn"player""FwdHamPlayerSpawn");
}

public 
plugin_precache( ) {
//  create_entity( "env_snow" );
    
    
precache_modelg_szHatModelCS_TEAM_T ] );
    
precache_modelg_szHatModelCS_TEAM_CT ] );
}

public 
client_disconnectid )
    if( 
is_valid_entg_iHatsid ] ) )
        
remove_entityg_iHatsid ] );

public 
FwdHamPlayerSpawn( const id ) {
    if( 
is_user_aliveid ) ) {
        new 
iEntity g_iHatsid ];
        
        if( !
is_valid_entiEntity ) ) {
            if( !( 
iEntity g_iHatsid ] = create_entity"info_target" ) ) )
                return;
            
            new 
CsTeams:iTeam cs_get_user_teamid );
            
            if( 
iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT )
                
iTeam CS_TEAM_T;
            
            
entity_set_modeliEntityg_szHatModeliTeam ] );
            
entity_set_intiEntityEV_INT_movetypeMOVETYPE_FOLLOW );
            
entity_set_edictiEntityEV_ENT_aimentid );
        }
    }
}

public 
EventTeamInfo( ) {
    new 
id read_data), iEntity g_iHatsid ];
    
    if( !
is_valid_entiEntity ) ) {
        if( 
iEntity )
            
g_iHatsid ] = 0;
        
        return;
    }
    
    new 
szTeam];
    
read_data2szTeam);
    
    if( 
szTeam] == 'C' )
        
entity_set_modeliEntityg_szHatModelCS_TEAM_CT ] );
    else
        
entity_set_modeliEntityg_szHatModelCS_TEAM_T ] );

pink santa hat



thanks
tarsisd2 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-11-2017 , 14:24   Re: Santa Hat, have model for custom steamid
Reply With Quote #2

How to detect if a client is a girl or not?
To make changes to the model you can do it without editing the script file. CUSTOM_LEVEL_B = ADMIN_LEVEL_B?
So you want admins to hold on pink santa hats, right?
- To guess the clients genter, create a menu after some seconds, called on client_putinserver, by asking its gender. Then connect the answer with the bool and do some magic stuff with it.

You're literally providing not enough information.
__________________
Relaxing is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-11-2017 , 14:59   Re: Santa Hat, have model for custom steamid
Reply With Quote #3

sorry, totally misunderstood. Here is the working(hopefully) code:
Spoiler
__________________
retired chump

Last edited by DjSoftero; 12-11-2017 at 15:19. Reason: correction
DjSoftero is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-11-2017 , 15:05   Re: Santa Hat, have model for custom steamid
Reply With Quote #4

Quote:
Originally Posted by Relaxing View Post
How to detect if a client is a girl or not?
To make changes to the model you can do it without editing the script file. CUSTOM_LEVEL_B = ADMIN_LEVEL_B?
So you want admins to hold on pink santa hats, right?
- To guess the clients genter, create a menu after some seconds, called on client_putinserver, by asking its gender. Then connect the answer with the bool and do some magic stuff with it.

You're literally providing not enough information.
it was my mistake, they will be set by ADMIN_LEVEL_B, so only them will have that hat

edit: they will have pink hat in both teams

Last edited by tarsisd2; 12-11-2017 at 15:05. Reason: teams color
tarsisd2 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-11-2017 , 23:49   Re: Santa Hat, have model for custom steamid
Reply With Quote #5

Quote:
Originally Posted by DjSoftero View Post
sorry, totally misunderstood. Here is the working(hopefully) code:
Spoiler
its working perfectly, thanks very much!!

is it hard to make the hats glow?
i saw that some where, i even found the plugin but its a diferent version and models
tarsisd2 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-12-2017 , 01:51   Re: Santa Hat, have model for custom steamid
Reply With Quote #6

you mean this kind of glow ?https://www.google.lt/search?q=amxx+...FTp2BHBNRtwVM:
or do you want them to emit light
__________________
retired chump
DjSoftero is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-12-2017 , 10:03   Re: Santa Hat, have model for custom steamid
Reply With Quote #7

Quote:
Originally Posted by DjSoftero View Post
you mean this kind of glow ?https://www.google.lt/search?q=amxx+...FTp2BHBNRtwVM:
or do you want them to emit light
i want glow only on the hats, not on the whole body, something like this updated earflaps hat

tarsisd2 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-12-2017 , 11:20   Re: Santa Hat, have model for custom steamid
Reply With Quote #8

not tested:
Spoiler
__________________
retired chump
DjSoftero is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-12-2017 , 20:31   Re: Santa Hat, have model for custom steamid
Reply With Quote #9

Quote:
Originally Posted by DjSoftero View Post
not tested:
Spoiler
thanks very much
tarsisd2 is offline
Fiji
New Member
Join Date: Aug 2019
Old 08-09-2019 , 08:16   Re: Santa Hat, have model for custom steamid
Reply With Quote #10

Quote:
Originally Posted by tarsisd2 View Post
thanks very much
поделись пожалуйста плагином с моделями)
давно такой хотел))
если не жалко конечно)
Fiji is offline
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 10:31.


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