AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Santa Hat, have model for custom steamid (https://forums.alliedmods.net/showthread.php?t=303544)

tarsisd2 12-11-2017 14:07

Santa Hat, have model for custom steamid
 
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 :)

https://image.ibb.co/mKsUXw/hatpink.png

thanks

Relaxing 12-11-2017 14:24

Re: Santa Hat, have model for custom steamid
 
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.

DjSoftero 12-11-2017 14:59

Re: Santa Hat, have model for custom steamid
 
sorry, totally misunderstood. Here is the working(hopefully) code:
Spoiler

tarsisd2 12-11-2017 15:05

Re: Santa Hat, have model for custom steamid
 
Quote:

Originally Posted by Relaxing (Post 2565665)
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

tarsisd2 12-11-2017 23:49

Re: Santa Hat, have model for custom steamid
 
Quote:

Originally Posted by DjSoftero (Post 2565675)
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

DjSoftero 12-12-2017 01:51

Re: Santa Hat, have model for custom steamid
 
you mean this kind of glow ?https://www.google.lt/search?q=amxx+...FTp2BHBNRtwVM:
or do you want them to emit light

tarsisd2 12-12-2017 10:03

Re: Santa Hat, have model for custom steamid
 
Quote:

Originally Posted by DjSoftero (Post 2565721)
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

https://image.ibb.co/ngtFPb/glowhat.png

DjSoftero 12-12-2017 11:20

Re: Santa Hat, have model for custom steamid
 
not tested:
Spoiler

tarsisd2 12-12-2017 20:31

Re: Santa Hat, have model for custom steamid
 
Quote:

Originally Posted by DjSoftero (Post 2565792)
not tested:
Spoiler

thanks very much

Fiji 08-09-2019 08:16

Re: Santa Hat, have model for custom steamid
 
Quote:

Originally Posted by tarsisd2 (Post 2565888)
thanks very much

поделись пожалуйста плагином с моделями)
давно такой хотел))
если не жалко конечно)


All times are GMT -4. The time now is 01:11.

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