AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hiding HUD icons but only for a specific team (https://forums.alliedmods.net/showthread.php?t=272021)

Al3 09-22-2015 13:34

Hiding HUD icons but only for a specific team
 
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.

Hartmann 09-22-2015 16:02

Re: Hiding HUD icons but only for a specific team
 
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;



Al3 09-22-2015 16:30

Re: Hiding HUD icons but only for a specific team
 
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

Hartmann 09-23-2015 13:24

Re: Hiding HUD icons but only for a specific team
 
Nothing, write how you want.


All times are GMT -4. The time now is 22:12.

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