Raised This Month: $ Target: $400
 0% 

hud is not displaying and sound is not playing...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-21-2006 , 00:29   hud is not displaying and sound is not playing...
Reply With Quote #1

could someone help me with this the hud msg is not showing up and no sound is playing..
Code:
new g_szHeSound[]= "misc/nade_kill.wav" public Death() {         if(get_pcvar_num(enabled) == 1)         {                 new id = read_data(2)                 new iWeapon                 new iAttacker = get_user_attacker(id, iWeapon)                   if(iWeapon == CSW_HEGRENADE && hasSomething[iAttacker])                 {                                         new VictimName[33]                         new AttackerName[33]                                         get_user_name(iAttacker, AttackerName, 32)                         get_user_name(id,VictimName,32)                                         new iRed   = random_num(1,255)                         new iGreen = random_num(1,255)                         new iBlue  = random_num(1,255)                         new Float:X = random_float(0.9, 0.98)                         new Float:Y = random_float(0.9, 0.98)                           set_hudmessage(iRed, iGreen, iBlue, X, Y, 0, 3.0, 6.0, 0.1, 0.2, 4)                         show_hudmessage(0,"%s Was naded! by %s Grenade!!!!",VictimName, AttackerName)                                         new Str[64]                         format(Str,63,"spk %s",g_szHeSound)                         client_cmd(0,Str)                                                         client_print(id,print_console,"%s has just Naded you with a  Grenade!!!", AttackerName)                 }                                                         }         return PLUGIN_CONTINUE   }
k007 is offline
Send a message via MSN to k007
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-21-2006 , 06:57   Re: hud is not displaying and sound is not playing...
Reply With Quote #2

Use:
play %s
not
spk %s
If that does still not work, try removing the ".wav".
If there is still no sound there is a Problem with the .wav it self.

0.85 or above is probably showing the Message out of screen. (under Bottom)
Use values between 0.01 and 0.8 for Y.
For X use small Values or -1.
(Note: 0.5 != -1, -1 will Center the Message on that axis,
0.5 will make Message start at the Center of that axis.)


__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-21-2006 at 06:59.
Silencer123 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-21-2006 , 10:29   Re: hud is not displaying and sound is not playing...
Reply With Quote #3

1) Using the spk command is perfectly ok, but try doing it this way.
Code:
new const testSound[] = "misc/test.wav"; client_cmd(id, "spk ^"%s^"", testSound);
2) Try using a hud generator to make sure your coords are right and/or make sure no other plugin is using that channel (disable all third party plugins).
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-21-2006 , 11:28   Re: hud is not displaying and sound is not playing...
Reply With Quote #4

spk is not "perfectly ok" because it will print you an error message.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-21-2006 , 12:08   Re: hud is not displaying and sound is not playing...
Reply With Quote #5

Only in console, which really doesn't do anything.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-21-2006 , 12:56   Re: hud is not displaying and sound is not playing...
Reply With Quote #6

Quote:
Originally Posted by Silencer123 View Post
spk is not "perfectly ok" because it will print you an error message.
Spk will only print an error message if the wav format is not pcm.

The audio format must be exactly what is accepted by the hl engine.

If your using spk and it gives you an error message....check your sound file and learn to alter it accordingly.

And then this:
Code:
new Str[64] format(Str,63,"spk %s",g_szHeSound) client_cmd(0,Str)

Should work better like this
Code:
new Str[64] format(Str,63,"%s", g_szHeSound) client_cmd(0, "spk %s", Str)
organizedKaoS is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-21-2006 , 13:08   Re: hud is not displaying and sound is not playing...
Reply With Quote #7

ok guys will do and ill tell u if it works
k007 is offline
Send a message via MSN to k007
anssik
Senior Member
Join Date: May 2006
Location: Suomi Finland Perkele
Old 10-21-2006 , 13:21   Re: hud is not displaying and sound is not playing...
Reply With Quote #8

You should change
Code:
if(get_pcvar_num(enabled) == 1)
to
Code:
if(get_pcvar_num(enabled))
Doesn't really matter, but makes the code cleaner.
__________________
anssik is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-21-2006 , 13:41   Re: hud is not displaying and sound is not playing...
Reply With Quote #9

It does matter, if the value you are checking is used with different values other than zero.

The second way you posted is acutally equal to this:

Code:
if (someVar != 0) {      // Code... } //Same way as: if (someVar) {     // Code... }

It will work in this case, but I just wanted to clarify that.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 10-22-2006 , 06:28   Re: hud is not displaying and sound is not playing...
Reply With Quote #10

Quote:
Originally Posted by organizedKaoS View Post
Should work better like this
Code:
new Str[64] format(Str,63,"%s", g_szHeSound) client_cmd(0, "spk %s", Str)
No. It's the same thing as client_cmd(0, "spk %s", g_szHeSound) only way more complicated.

you SHOULD use client_cmd(0, "spk ^"%s^"", g_szHeSound) like Zenith said.

the resuft with X: 0.9 and y: 0.9 is...
[ --<-@ ] Black Rose is offline
Reply


Thread Tools
Display Modes

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 04:46.


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