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

Santa Hat, have model for custom steamid


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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:55.


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