CovidMask_HarveyFake

Created Diff never expires
51 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
73 lines
50 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
73 lines
#include < amxmodx >
#include < amxmodx >
#include < engine >
#include < engine >
#include < cstrike >
#include < cstrike >
#include < hamsandwich >
#include < hamsandwich >


new const g_szHatModel[ CsTeams ][ ] = {
new const g_szHatModel[ CsTeams ][ ] = {
"",
"",
"models/santahat.mdl",
"models/covid/covid19.mdl",
"models/santahat_blue.mdl",
"models/covid/covid19ct.mdl",
""
""
};
};


new g_iHats[ 33 ];
new g_iHats[ 33 ];


public plugin_init( ) {
public plugin_init( ) {
register_plugin( "Santa Hat + Snow", "1.3", "xPaw" );
register_plugin( "covid", "G5.3", "HarveyWNvm LLC" );
register_cvar( "santa_hat", "1.3", FCVAR_SERVER );
register_cvar( "covid", "G5.3", FCVAR_SERVER );
register_event( "TeamInfo", "EventTeamInfo", "a" );
register_event( "TeamInfo", "EventTeamInfo", "a" );
RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
}
}


public plugin_precache( ) {
public plugin_precache( ) {
// create_entity( "env_snow" );
precache_model( g_szHatModel[ CS_TEAM_T ] );
precache_model( g_szHatModel[ CS_TEAM_T ] );
precache_model( g_szHatModel[ CS_TEAM_CT ] );
precache_model( g_szHatModel[ CS_TEAM_CT ] );
}
}


public client_disconnect( id )
public client_disconnect( id )
if( is_valid_ent( g_iHats[ id ] ) )
if( is_valid_ent( g_iHats[ id ] ) )
remove_entity( g_iHats[ id ] );
remove_entity( g_iHats[ id ] );


public FwdHamPlayerSpawn( const id ) {
public FwdHamPlayerSpawn( const id ) {
if( is_user_alive( id ) ) {
if( is_user_alive( id ) ) {
new iEntity = g_iHats[ id ];
new iEntity = g_iHats[ id ];
if( !is_valid_ent( iEntity ) ) {
if( !is_valid_ent( iEntity ) ) {
if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) )
if( !( iEntity = g_iHats[ id ] = create_entity( "info_target" ) ) )
return;
return;
new CsTeams:iTeam = cs_get_user_team( id );
new CsTeams:iTeam = cs_get_user_team( id );
if( iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT )
if( iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT )
iTeam = CS_TEAM_T;
iTeam = CS_TEAM_T;
entity_set_model( iEntity, g_szHatModel[ iTeam ] );
entity_set_model( iEntity, g_szHatModel[ iTeam ] );
entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW );
entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_FOLLOW );
entity_set_edict( iEntity, EV_ENT_aiment, id );
entity_set_edict( iEntity, EV_ENT_aiment, id );
}
}
}
}
}
}


public EventTeamInfo( ) {
public EventTeamInfo( ) {
new id = read_data( 1 ), iEntity = g_iHats[ id ];
new id = read_data( 1 ), iEntity = g_iHats[ id ];
if( !is_valid_ent( iEntity ) ) {
if( !is_valid_ent( iEntity ) ) {
if( iEntity > 0 )
if( iEntity > 0 )
g_iHats[ id ] = 0;
g_iHats[ id ] = 0;
return;
return;
}
}
new szTeam[ 2 ];
new szTeam[ 2 ];
read_data( 2, szTeam, 1 );
read_data( 2, szTeam, 1 );
if( szTeam[ 0 ] == 'C' )
if( szTeam[ 0 ] == 'C' )
entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] );
entity_set_model( iEntity, g_szHatModel[ CS_TEAM_CT ] );
else
else
entity_set_model( iEntity, g_szHatModel[ CS_TEAM_T ] );
entity_set_model( iEntity, g_szHatModel[ CS_TEAM_T ] );
}
}