Raised This Month: $ Target: $400
 0% 

Hud not showing variables


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blackops7799
Senior Member
Join Date: May 2006
Old 01-26-2007 , 19:06   Hud not showing variables
Reply With Quote #1

No matter what My hud will display everything as 0 even if i change it.

When I use another part of my mod and say /xp it says that my xp is like 400, but the hud is not showing this.

|Jake's Zombie Mod Server|

Level: 0
Exp: 0
Kills: 0

Code:
public plugin_init() {     register_cvar("zm_hud_pos_x","-1.9")     register_cvar("zm_hud_pos_y","0.55")     register_cvar("zm_hud_red","0")     register_cvar("zm_hud_green","175")     register_cvar("zm_hud_blue","0")     register_plugin("Zombie Mod","1","Jake")     set_task(6.0,"activehud",0,"",0,"b") } public activehud() {     new num, players[32]     get_players(players,num,"ac")     for( new i = 0;  i < num; i++ )     {         show_hudmessage(players[i], "|Jake's Zombie Mod Server| ^n^n Level: %i ^n Exp: %i ^n Kills: %i",level[i],xp[i],kills[i])         set_hudmessage(get_cvar_num("zm_hud_red"),get_cvar_num("zm_hud_green"),get_cvar_num("zm_hud_blue"),get_cvar_float("zm_hudhud_pos_x"),get_cvar_float("zm_hud_pos_y"),0,0.0,99.9,0.0,0.0,-1)     }     return PLUGIN_HANDLED }

Last edited by blackops7799; 01-26-2007 at 19:20.
blackops7799 is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-26-2007 , 19:10   Re: Hud overwriting other huds
Reply With Quote #2

You should hook the hud message, and check it, and return plugin_handled
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
blackops7799
Senior Member
Join Date: May 2006
Old 01-26-2007 , 19:18   Re: Hud overwriting other huds
Reply With Quote #3

well I made the hud show up but now it is just saying 0 for kills, exp, and level, even if its not.

EDIT: I fixed the plugin because i forgot to uncomment these

Code:
    register_cvar("zm_hud_pos_x","-1.9")     register_cvar("zm_hud_pos_y","0.55")     register_cvar("zm_hud_red","0")     register_cvar("zm_hud_green","175")     register_cvar("zm_hud_blue","0")
I forgot they were commented.. lol
blackops7799 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-26-2007 , 19:28   Re: Hud not showing variables
Reply With Quote #4

set_hudmessage has to go before show_hudmessage
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
blackops7799
Senior Member
Join Date: May 2006
Old 01-26-2007 , 19:31   Re: Hud not showing variables
Reply With Quote #5

nope, it works now, ill show you the code to show what i did.

Code:
public plugin_init() {     register_plugin("Zombie Mod","1","Jake")     register_cvar("zm_hud_pos_x","-1.9")     register_cvar("zm_hud_pos_y","0.55")     register_cvar("zm_hud_red","175")     register_cvar("zm_hud_green","0")     register_cvar("zm_hud_blue","0")     set_task(6.0,"activehud",0,"",0,"b") } public activehud() {     new num, players[32]     get_players(players,num,"ac")     for( new i = 0;  i < num; i++ )     {         show_hudmessage(players[i], "|Jake's Zombie Mod Server| ^n^n Level: %i ^n Exp: %i ^n Kills: %i",level[players[i]],xp[players[i]],kills[players[i]])         set_hudmessage(get_cvar_num("zm_hud_red"),get_cvar_num("zm_hud_green"),get_cvar_num("zm_hud_blue"),get_cvar_float("zm_hud_pos_x"),get_cvar_float("zm_hud_pos_y"),0,0.0,99.9,0.0,0.0,-1)     }     return PLUGIN_HANDLED }

I changed
Code:
level[i],xp[i],kills[i]
to
Code:
level[players[i]],xp[players[i]],kills[players[i]]
blackops7799 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-26-2007 , 19:40   Re: Hud not showing variables
Reply With Quote #6

Yes, I saw that but you suppose to use set_hudmessage before show_hudmessage. Which you have show_hudmessage then set_hudmessage. Which is backwards. So I told you that you need to use set_hudmessage before show_hudmessage.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
blackops7799
Senior Member
Join Date: May 2006
Old 01-26-2007 , 19:53   Re: Hud not showing variables
Reply With Quote #7

Ill do that anyway, even though it still works backward.

Thanks for the tips +Karma
blackops7799 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 22:23.


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