I have this code made by bugsy.
I tried to show the HUD to only terrorists and i don't seem to get it to work.
CT still can see the HUD message with this code:
I'm probably placing the if(cs_get_user_team(id) == CS_TEAM_T) on the wrong part.
Anyone care to show me how to do it correctly?
Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <dhudmessage>
new const Version[] = "0.1";
#define IsPlayer(%1) (1<=%1<=32)
public plugin_init()
{
register_plugin( "Bomb Spawn HUD" , Version , "bugsy" );
register_logevent( "SpawnedWithBomb" , 3 , "2=Spawned_With_The_Bomb" );
}
public SpawnedWithBomb()
{
set_task( 0.1 , "DelayC4" );
}
public DelayC4()
{
new szName[ 32 ] , iBomb , id;
iBomb = find_ent_by_class( -1 , "weapon_c4" );
id = entity_get_edict( iBomb , EV_ENT_owner );
if(cs_get_user_team(id) == CS_TEAM_T)
{
get_user_name( id , szName , charsmax( szName ) );
set_dhudmessage( 255 , 50 , 0 , 0 , 0.73 , 0 , 0.0 , 10.0 );
show_dhudmessage( 0 , "[ %s has the bomb ]" , szName );
}
}