Thats not going to work because your not actually testing anything.

if ( "weapon_superfrag" )..... if weapon_superfrag WHAT? exactly?

I can't remember the exact code off my head but you need something like:

if ( strcmp( this.weapon_name, "weapon_superfrag") != 0)
{
...
}

So you'd be comparing the name of the weapon with a given string to
see if they match and then do something. Note the above ISNT real
code, just an example.

I still think you'd be better off just overriding the function that
plays the sound in each weapons own class.

- Jed



2008/7/30 Yorg Kuijs <[EMAIL PROTECTED]>:
> Been messing around for about 2 hours now and I think I almost got it
> currently using this code:
>    if ( "weapon_superfrag" )
>    {
>        EmitSound( "HolyGrenade.Explode" );
>    }
>    else if ( "weapon_frag" )
>    {
>        EmitSound( "BaseGrenade.Explode" );
>    }
>
>
> the problem I have is though that it seems to be ignoring the if's and
> just plays both sounds as if no if was specified at all.. so it just
> plays both HolyGrenade.Explode AND BaseGrenade.Explode for both grenades
> when it explodes. Any idea why it's completely ignoring the ifs?(it
> compiles without errors so it should be accepting the ifs, cause earlier
> it wasnt now doing it like this it didn't produce errors)
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to