Raised This Month: $ Target: $400
 0% 

[HELP] Weapons Hud Info !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-15-2015 , 05:15   [HELP] Weapons Hud Info !
Reply With Quote #1

Hi !

How do I make the client see the hud message when used a particular weapon?


I tried this ! it works but I want to disappear the hud message when uses another weapon

Is there another way to do this?

Code:
#include <amxmodx> public plugin_init() {     register_clcmd( "weapon_tripmine", "hud_info1" )     register_clcmd( "weapon_357", "hud_info2" )     register_clcmd( "weapon_crossbow", "hud_info3" )     register_clcmd( "weapon_gauss", "hud_info4" )     register_clcmd( "weapon_hornetgun", "hud_info5" )     register_clcmd( "weapon_rpg", "hud_info6" )     register_clcmd( "weapon_snark", "hud_info7" )     register_clcmd( "weapon_9mmAR", "hud_info8" )     register_clcmd( "weapon_crowbar", "hud_info9" )     register_clcmd( "weapon_glock", "hud_info10" )     register_clcmd( "weapon_mp5", "hud_info11" )     register_clcmd( "weapon_handgrenade", "hud_info12" )     register_clcmd( "weapon_egon", "hud_info13" )     register_clcmd( "weapon_shotgun", "hud_info14" )     register_clcmd( "weapon_9mmhandgun", "hud_info15" )         register_event("DeathMsg", "death_event", "a") } public hud_info1(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "Weapon Tripmine^nUse the following Buttons:^n1: MOUSE2 = Laser^n2: E + MOUSE1 = Freeze^n3: E + MOUSE2 = Flash^n4: R + MOUSE2 = Reverse^n5: R + MOUSE1 = Teleport") } public hud_info2(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info3(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info4(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info5(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info6(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info7(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info8(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info9(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info10(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info11(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info12(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info13(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info14(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public hud_info15(id) {     set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)     show_hudmessage(id, "") } public death_event() {   new id = read_data(2)   if(is_user_connected(id))   {       set_hudmessage(102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1)       show_hudmessage(id, "")   } }
__________________

Last edited by abdobiskra; 12-15-2015 at 05:17.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-16-2015 , 00:52   Re: [HELP] Weapons Hud Info !
Reply With Quote #2

i do that also !

but I want to disappear the hud message when uses another weapon ?

Code:
#include <AmxModx> #include <HamSandwich>   public plugin_init() { RegisterHam(Ham_Item_Deploy, "weapon_tripmine", "draw_hud") }   public draw_hud(const tripmine, id) { set_hudmessage(0, 255, 0, 0.75, 0.83, 0, 6.0, 10.0) show_hudmessage(id, "Weapon Tripmine ...bla bla bla !")   return HAM_IGNORED }
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 12-16-2015 , 07:03   Re: [HELP] Weapons Hud Info !
Reply With Quote #3

Use Ham_Item_Deploy and Ham_Item_Holster for that.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-17-2015 , 10:57   Re: [HELP] Weapons Hud Info !
Reply With Quote #4

Can you do this? I do not have enough experience in that?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-19-2015 , 02:26   Re: [HELP] Weapons Hud Info !
Reply With Quote #5

up !
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 12-19-2015 , 08:36   Re: [HELP] Weapons Hud Info !
Reply With Quote #6

Man when can it will solve
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-19-2015 , 08:57   Re: [HELP] Weapons Hud Info !
Reply With Quote #7

Quote:
Originally Posted by abdobiskra View Post
but I want to disappear the hud message when uses another weapon
Each HUD has a time out, override your HUD using another with 0.3 time out, for example.

Update:

Do not use names as "hud_info1" for "weapon_tripmine", they are cumbersome. Prefer: "hud_tripmine" for "weapon_tripmine".

Soon I will post a full code.

Last edited by addons_zz; 12-19-2015 at 09:01. Reason: spelling fixes
addons_zz is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-19-2015 , 09:30   Re: [HELP] Weapons Hud Info !
Reply With Quote #8

Quote:
Originally Posted by addons_zz View Post
Each HUD has a time out, override your HUD using another with 0.3 time out, for example.

Update:

Do not use names as "hud_info1" for "weapon_tripmine", they are cumbersome. Prefer: "hud_tripmine" for "weapon_tripmine".

Soon I will post a full code.
Im mean when using
Code:
#include <hamsandwich>
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-19-2015 , 10:03   Re: [HELP] Weapons Hud Info !
Reply With Quote #9

Quote:
Originally Posted by abdobiskra View Post
Im mean when using
Code:
#include <hamsandwich>
This is my ideia, but I cannot test it.

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define MAX_NAME_LENGTH       32 #define HUD_PICKUP_CONFIG    102, 102, 32, 0.0, 0.06, 2, 7.0, 10.0, 0.1, 0.1, 1 #define HUD_CHANGE_CONFIG    102, 102, 32, 0.0, 0.06, 2, 7.0, 0.3, 0.1, 0.1, 1 new g_weapons[][MAX_NAME_LENGTH] = {     "weapon_tripmine",     "weapon_357",     "weapon_crossbow",     "weapon_gauss",     "weapon_hornetgun",     "weapon_rpg",     "weapon_snark",     "weapon_hornetgun",     "weapon_rpg",     "weapon_snark",     "weapon_9mmAR",     "weapon_crowbar",     "weapon_glock",     "weapon_mp5",     "weapon_handgrenade",     "weapon_egon",     "weapon_shotgun",     "weapon_9mmhandgun" } public plugin_init() {     new function_name[MAX_NAME_LENGTH]     for( new index = 0; index < sizeof( g_weapons ); index++ )     {         formatex( function_name, charsmax(function_name), "hud_%s", g_weapons[index] )         register_clcmd( g_weapons[index], function_name )         RegisterHam( Ham_Item_Deploy, g_weapons[index], "hide_HUD", 1 )     }     register_event("DeathMsg", "death_event", "a") } public hide_HUD( ent ) {     static id     id = pev( ent, pev_owner )     if( is_user_alive(id) )     {         set_hudmessage( HUD_CHANGE_CONFIG )         show_hudmessage(id, "Changing...")     } } public hud_weapon_tripmine(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "Weapon Tripmine^nUse the following Buttons:^n1: \             MOUSE2 = Laser^n2: E + MOUSE1 = Freeze^n3: E + MOUSE2 = \             Flash^n4: R + MOUSE2 = Reverse^n5: R + MOUSE1 = Teleport") } public hud_weapon_357(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_crossbow(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_gauss(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_hornetgun(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_rpg(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_snark(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_9mmAR(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_crowbar(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_glock(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_mp5(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_handgrenade(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_egon(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_shotgun(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public hud_weapon_9mmhandgun(id) {     set_hudmessage( HUD_PICKUP_CONFIG )     show_hudmessage(id, "") } public death_event() {     new id = read_data(2)     if( is_user_connected(id) )     {         set_hudmessage( HUD_PICKUP_CONFIG )         show_hudmessage(id, "")   } }

Last edited by addons_zz; 12-19-2015 at 10:06. Reason: spelling fixes
addons_zz is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 12-19-2015 , 14:42   Re: [HELP] Weapons Hud Info !
Reply With Quote #10

addons zz
thx you get me idea

PHP Code:
#include <AmxModx>
#include <HamSandwich>

new weapons[][] = 

//"weapon_tripmine"
"weapon_357"
"weapon_crossbow"
"weapon_gauss"
"weapon_hornetgun"
"weapon_rpg"
"weapon_snark"
"weapon_hornetgun"
"weapon_rpg"
"weapon_snark"
"weapon_9mmAR"
"weapon_crowbar"
"weapon_glock"
"weapon_mp5"
"weapon_handgrenade"
"weapon_egon"
"weapon_shotgun"
"weapon_9mmhandgun" 
}

public 
plugin_init() {

RegisterHam(Ham_Item_Deploy"weapon_tripmine""draw_hud"1)

for(new 
0szcmd[20]; sizeof(weapons); i++)
{
formatex(szcmdcharsmax(szcmd), "%s"weapons[i][0])
register_clcmd(szcmd"hide_HUD")
}
}

public 
hide_HUD(id)
{
set_hudmessage(025500.750.8306.010.0)
show_hudmessage(id"")
}
public 
draw_hud(const tripmineid)
{
    
set_hudmessage(025500.750.8306.010.0)
show_hudmessage(id"Weapon Tripmine ...bla bla bla !")


__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 17:57.


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