|
BANNED
Join Date: May 2012
Location: in your heart
|

05-16-2012
, 13:04
Re: How to remove HUD
|
#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],num, i,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(1 << 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(0, 255, 0, -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],num, i,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(1 << 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(0, 255, 0, -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],num, i,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(1 << 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(0, 255, 0, -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(id, menu, 0) } // Menu CH public menu_crosshair(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new data[6], iName[64], access, callback menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback) switch(str_to_num(data)) { case 1: register_concmd(cross,"cross_crosshair") case 2: register_concmd(cross,"dot_crosshair") case 3: register_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
|
|