Raised This Month: $ Target: $400
 0% 

Define Team to show HUD Message


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 08-29-2020 , 12:46   Define Team to show HUD Message
Reply With Quote #1

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 );   
   
  }
      
      
}
Ark_Procession 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 13:44.


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