Raised This Month: $51 Target: $400
 12% 

Hiding HUD icons but only for a specific team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-22-2015 , 13:34   Hiding HUD icons but only for a specific team
Reply With Quote #1

Is it possible for one to hide HUD icons (such as radar, money, ammo, crosshair, weapon icons, health and flashlight), but only for a specific team ?

How could I achieve that?
Something makes me think that it's gonna be a nitpicking task.
Al3 is offline
Send a message via Skype™ to Al3
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-22-2015 , 16:02   Re: Hiding HUD icons but only for a specific team
Reply With Quote #2

Try...

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define HUD_HIDE_TIMER (1<<4)
#define HUD_HIDE_MONEY (1<<5)


public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
}

public 
fwHamPlayerSpawnPost(usr) {
    if (
is_user_alive(usr)) {
        if (
cs_get_user_team(usr) == CS_TEAM_T)
        {
            new 
hideflags GetHudHideFlags()
        
            if( 
hideflags )
            {
                
message_beginMSG_ONEget_user_msgid"HideWeapon" ), _usr )
                
write_bytehideflags )
                
message_end()
            }
        }
    }
}
stock GetHudHideFlags()
{
    new 
iFlags;
    
    
iFlags |= HUD_HIDE_TIMER;
    
iFlags |= HUD_HIDE_MONEY;
    
    return 
iFlags;

__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Al3
Member
Join Date: Sep 2015
Location: Bulgaria
Old 09-22-2015 , 16:30   Re: Hiding HUD icons but only for a specific team
Reply With Quote #3

Oh great! It even sets them back if you switch..
I am not much familiar with this side of amxx (messages, pev data, native registration and so forth)

Thank you for the help and even further, for the code snippet.
I work hardly on this one so thank you, really.

p.s: There is a "le", "ne" and "de" keyword in pawn, I mean what does that even mean

Last edited by Al3; 09-22-2015 at 16:34.
Al3 is offline
Send a message via Skype™ to Al3
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-23-2015 , 13:24   Re: Hiding HUD icons but only for a specific team
Reply With Quote #4

Nothing, write how you want.
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Reply



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 11:50.


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