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-17-2012 , 06:03   Re: How to remove HUD
Reply With Quote #1

I named it wrong, that "cid" has nothing to do with the "cid" parameter when using ADMIN access in client commands.

What are these warnings? Show your code.
__________________

Last edited by <VeCo>; 05-17-2012 at 06:04.
<VeCo> is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-17-2012 , 06:18   Re: How to remove HUD
Reply With Quote #2

Here ^_^
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

new user_crosshair_type[33]  

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
    
    //server command
    
server_cmd("bind o show_menu_ch")
    
//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"+",user_crosshair_type[id]) // 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"*",user_crosshair_type[id]) // 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"%c",user_crosshair_type[id]) // 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 +""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)  
    
// 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)
    
    
user_crosshair_type[id] = str_to_num(data)  
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
public 
client_connect(iduser_crosshair_type[id] = 111 // default crosshair is "o" 
Randomize is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-17-2012 , 06:22   Re: How to remove HUD
Reply With Quote #3

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
new user_crosshair_type[33]  
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,"hud_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("hud_crosshair","hud_crosshair_think"// call "cross_crosshair_think" function on think
}
 
public 
hud_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"%c",user_crosshair_type[id]) // 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 +""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)  
    
// 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)
    
    
user_crosshair_type[id] = str_to_num(data)  
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
public 
client_connect(iduser_crosshair_type[id] = 111 // default crosshair is "o" 
They were showing, because the code wasn't properly indented, but this is just a warning, it doesn't affect the actual code.
I removed some unnecessary functions.
__________________
<VeCo> is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-17-2012 , 06:27   Re: How to remove HUD
Reply With Quote #4

Well, thank you so much ;) you are the kindness mand haha lol.. can i submit this?
Randomize is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 05-17-2012 , 19:24   Re: How to remove HUD
Reply With Quote #5

Quote:
Originally Posted by Randomize View Post
can i submit this?
Probably will be unapproved.
bazhenov93 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