Raised This Month: $ Target: $400
 0% 

How to remove HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-16-2012 , 13:45   Re: How to remove HUD
Reply With Quote #1

Make a global variable like:

PHP Code:
new user_crosshair_type[33
Then change this:

PHP Code:
 menu_additem(menu"Cross +""1"0)
menu_additem(menu"Dot *""2"0)
menu_additem(menu"Round o""3"0
To this:

PHP Code:
 menu_additem(menu"Cross +""43"0// actually this 0 is set by default, you don't need to write it
menu_additem(menu"Dot *""42"0)
menu_additem(menu"Round o""111"0
Then change this:

PHP Code:
 switch(str_to_num(data))
{
case 
1register_concmd(cross,"cross_crosshair")
case 
2register_concmd(cross,"dot_crosshair")
case 
3register_concmd(cross,"round_crosshair")
// Add more Options if you wish

To this:

PHP Code:
user_crosshair_type[id] = str_to_num(data
Then change this:

PHP Code:
 set_hudmessage(02550, -1.0, -1.0, .holdtime 1.0// skip default values
ShowSyncHudMsg(id,sync"o"// show crosshair HUD 
To this

PHP Code:
 set_hudmessage(02550, -1.0, -1.0, .holdtime 1.0// skip default values
ShowSyncHudMsg(id,sync"%c",user_crosshair_type[id]) // show crosshair HUD 
And add:

PHP Code:
public client_connect(iduser_crosshair_type[id] = 111 // default crosshair is "o" 

So here is how does it works:

We set the "info" of the crosshair menu options as numbers 43, 42, 111. These numbers are actually character indexes that represent a character. In our case these are the indexes of the crosshair HUD characters - "+", "*" and "o".
When we select an option, the menu passes the "info" parameter of menu_additem to the "data" string in the menu handler. So, now we can set the selected character to the "user_crosshair_type" variable to store the user HUD crosshair character.
Then when we display the HUD message, we use "%c", which gets a character index and transfers it to a character. We get that index from our user_crosshair_type variable, so every player will see his own selected HUD crosshair.
On client connect we set the default HUD character for the player - that's 111 or the "o" character.

Here I made a simple program that displays the character ID by given character.
I also attached the source code (compiled with DEV C++), ready to use .exe file is in the bin folder. (That's not a virus, lol)
Attached Files
File Type: zip Character Index Displayer.zip (262.2 KB, 63 views)
__________________
<VeCo> 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 00:28.


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