PHP Code:
#include < amxmodx >
#include < engine >
#include < cstrike >
#include < hamsandwich >
new const g_szHatModel[] = "models/santahat_blue.mdl"
new g_iHats[ 33 ];
public plugin_init( ) {
register_plugin( "Santa Hat + Snow", "1.3", "xPaw" );
register_cvar( "santa_hat", "1.3", FCVAR_SERVER );
RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
}
public plugin_precache( ) {
create_entity( "env_snow" );
precache_model( g_szHatModel );
}
public client_disconnect( id )
if( is_valid_ent( g_iHats[ id ] ) )
remove_entity( g_iHats[ id ] );
public FwdHamPlayerSpawn( const id ) {
if( is_user_alive( id ) && cs_get_user_team(id) == CS_TEAM_CT) {
new iEntity = g_iHats[ id ];
if( !is_valid_ent( iEntity ) ) {
if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) )
return;
entity_set_model( iEntity, g_szHatModel );
entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW );
entity_set_edict( iEntity, EV_ENT_aiment, id );
}
}
}
__________________