Raised This Month: $ Target: $400
 0% 

How to remove HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-16-2012 , 13:04   Re: How to remove HUD
Reply With Quote #1

PHP Code:
//Crosshair Type
//Special thanks to <VeCo>

#include <amxmodx>
#include <engine>

#define PLUGIN "Crosshair Type"
#define VERSION "1.1"
#define AUTHOR "DavidJr"

// *restricted* sniper weapons
#define SNIPER_WEAPONS (1 << CSW_AWP | 1 << CSW_SCOUT | 1 << CSW_G3SG1 | 1 << CSW_SG550)
 
new sync
public plugin_init() {
    
register_plugin("PLUGIN","VERSION","DavidJr")
    
sync CreateHudSyncObj() // HUD sync object
 
    
new ent create_entity("info_target")
    
entity_set_string(ent,EV_SZ_classname,"dot_crosshair"// classname
    
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 1.0// think every second
    
    //console command
    
register_concmd("show_menu_ch","cmd_show_menu_ch")
    
    
//thinking entity
    
register_think("cross_crosshair","cross_crosshair_think"// call "cross_crosshair_think" function on think
    
register_think("dot_crosshair","dot_crosshair_think"// call "dot_crosshair_think" function on think
    
register_think("round_crosshair","round_crosshair_think"// call "round_crosshair_think" function on think
}
 
public 
cross_crosshair_think(ent// entity thinks...
{
    
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 1.0// continue thinking every second
 
    
if(!get_playersnum()) return // server is empty, there's no need to show HUD messages...
 
    
static players[32],numi,id
    get_players
(players,num,"a"// get all alive players in the server
 
    
for(i=0;i<num;i++) // loop trough them...
    
{
        
id players[i// store player index in a more convenient variable
 
        
if(<< get_user_weapon(id) & SNIPER_WEAPONS) continue // if this player is holding a sniper - continue with the next player
 
        // else, show the HUD message...
 
        
set_hudmessage(02550, -1.0, -1.0,  .holdtime 1.0// skip default values
        
ShowSyncHudMsg(id,sync"+"// show crosshair HUD
    
}
}  
public 
dot_crosshair_think(ent// entity thinks...
{
    
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 1.0// continue thinking every second
 
    
if(!get_playersnum()) return // server is empty, there's no need to show HUD messages...
 
    
static players[32],numi,id
    get_players
(players,num,"a"// get all alive players in the server
 
    
for(i=0;i<num;i++) // loop trough them...
    
{
        
id players[i// store player index in a more convenient variable
 
        
if(<< get_user_weapon(id) & SNIPER_WEAPONS) continue // if this player is holding a sniper - continue with the next player
 
        // else, show the HUD message...
 
        
set_hudmessage(02550, -1.0, -1.0,  .holdtime 1.0// skip default values
        
ShowSyncHudMsg(id,sync"*"// show crosshair HUD
    
}
}  
public 
round_crosshair_think(ent// entity thinks...
{
    
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 1.0// continue thinking every second
 
    
if(!get_playersnum()) return // server is empty, there's no need to show HUD messages...
 
    
static players[32],numi,id
    get_players
(players,num,"a"// get all alive players in the server
 
    
for(i=0;i<num;i++) // loop trough them...
    
{
        
id players[i// store player index in a more convenient variable
 
        
if(<< get_user_weapon(id) & SNIPER_WEAPONS) continue // if this player is holding a sniper - continue with the next player
 
        // else, show the HUD message...
 
        
set_hudmessage(02550, -1.0, -1.0,  .holdtime 1.0// skip default values
        
ShowSyncHudMsg(id,sync"o"// show crosshair HUD
    
}
}  
// Show Menu CH
public cmd_show_menu_ch(id)
{
    new 
menu menu_create("\yChoose Crosshair Type""menu_crosshair")
    
menu_additem(menu"Cross +""1"0)
    
menu_additem(menu"Dot *""2"0)
    
menu_additem(menu"Round o""3"0)
    
// Add more Options if you wish
    
    
menu_display(idmenu0)
}
// Menu CH
public menu_crosshair(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdata5iName63callback)
    
    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
    
}
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

I have give the menu but when i select it, the hud doesn't want to change

forget this:
case 1: register_concmd(cross,"cross_crosshair")
case 2: register_concmd(cross,"dot_crosshair")
case 3: register_concmd(cross,"round_crosshair")

it's slow hack part

Last edited by Randomize; 05-16-2012 at 13:08. Reason: remove slow hack part
Randomize 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