Raised This Month: $ Target: $400
 0% 

HUD How to hide stuff properly?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Multiply
Member
Join Date: Jun 2006
Location: Denmark
Old 09-05-2009 , 02:45   HUD How to hide stuff properly?
Reply With Quote #1

My problem is that I need to hide health/armor/money/ammo, and sometimes even the radar, depending on the users team and current effects applied to the user.

How do I do this in a proper way?

Using (1<<0) in the following code, makes you unable to change weapon, using slot1, and so on. (weapon_knife in console works, for example). I might be able to fix this issue, by setting pev_weapons?

At the moment I use this method to hide stuff:
PHP Code:
new gmsgHideWeapon;
new 
giHardcore;

..

gmsgHideWeapon get_user_msgid("HideWeapon");
giHardcore 1// This is normally a cache of the pcvar, which is reset on every roundend.

register_message(gmsgHideWeapon"eventPlayerHudHide");

..

public 
eventPlayerHudHide()
    if (
giHardcore)
        
set_msg_arg_int(1ARG_BYTEget_msg_arg_int(1) | (1<<0) | (1<<1) | (1<<3) | (1<<4) | (1<<5)); 
You can hide different stuff like this:
PHP Code:
  1   (1<<0)  -  crosshairammoweapons list
  
2   (1<<1)  -  flashlight, +
  
4   (1<<2)  -  ALL
  8   
(1<<3)  -  radarhealtharmor, +
 
16   (1<<4)  -  timer, +
 
32   (1<<5)  -  money, +
 
64   (1<<6)  -  crosshair
128   
(1<<7)  -  + 
EDIT:
I found a solution, not regarding hiding the stuff, more about fixing the hud.
__________________
Wah?

Last edited by Multiply; 09-08-2009 at 07:46. Reason: Found a temporary solution myself
Multiply is offline
Send a message via MSN to Multiply Send a message via Skype™ to Multiply
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 09:23.


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