AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deagle nail Launcher 2 questions (https://forums.alliedmods.net/showthread.php?t=163173)

avril-lavigne 07-27-2011 12:44

Deagle nail Launcher 2 questions
 
In this plugin http://forums.alliedmods.net/showthread.php?p=717029

I want to remove explosion sound.

Code:

what this func do

stock nail_take_damage(victim,damage,origin[3],bit)
{
        message_begin(MSG_ONE_UNRELIABLE, gMsgID,{0,0,0}, victim);
        write_byte(21);
        write_byte(20);
        write_long(bit);
        write_coord(origin[0]);
        write_coord(origin[1]);
        write_coord(origin[2]);
        message_end();
       
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
        write_byte(TE_LAVASPLASH);
        write_coord(origin[0]);
        write_coord(origin[1]);
        write_coord(origin[2]);
        message_end();
       
        fm_set_user_health(victim, get_user_health(victim) - damage);
}

and here
Code:

nail_radius_damage(ptr);
                               
                                message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin);
                                write_byte(TE_EXPLOSION);
                                write_coord(iOrigin[0]);
                                write_coord(iOrigin[1]);
                                write_coord(iOrigin[2]);
                                write_short(explode2);
                                write_byte(30);
                                write_byte(15);
                                write_byte(0);
                                message_end();
                       
                                message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
                                write_byte(TE_SMOKE);
                                write_coord(iOrigin[0]);
                                write_coord(iOrigin[1]);
                                write_coord(iOrigin[2]);
                                write_short(smokesZ2);
                                write_byte(40);
                                write_byte(5);
                                message_end();
                               
                                engfunc(EngFunc_RemoveEntity, ptr);

I need to remove explosion sound. not a sprite effect.....I have my own sound

avril-lavigne 07-27-2011 15:35

Re: Deagle nail Launcher 2 questions
 
ok or just here

Code:

public pfn_touch(ptr, ptd)
{       
       
                if(pev_valid(ptr))
                {       
                        new classname[32];
                        pev(ptr, pev_classname, classname, 31);
               
                        if(equal(classname, nail_classname))
                        {       
                                new Float:fOrigin[3];
                                new iOrigin[3];
                                pev(ptr, pev_origin, fOrigin);
                                FVecIVec(fOrigin,iOrigin);
                       
                                nail_radius_damage(ptr);
                               
                                message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin);
                                write_byte(TE_EXPLOSION);
                                write_coord(iOrigin[0]);
                                write_coord(iOrigin[1]);
                                write_coord(iOrigin[2]);
                                write_short(explode2);
                                write_byte(30);
                                write_byte(15);
                                write_byte(0);
                                message_end();                       
                               
                        emit_sound(0, CHAN_WEAPON, snd_hitwall[random_num(0, sizeof snd_hitwall - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

  How to determine  if  Entity touches (only) THE WALL & FLOOR




                        engfunc(EngFunc_RemoveEntity, ptr);
                               
                }
             
          }
     
       
}


avril-lavigne 07-27-2011 17:39

Re: Deagle nail Launcher 2 questions
 
ok found this

Code:

//-----------------------------------------------------------------------------
#define TE_EXPLOSION    3    //additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps

message_begin(MSG_ ,SVC_TEMPENTITY) //message begin
write_byte(TE_)
write_coord() // start position
write_coord()
write_coord() //
write_short() // sprite index
write_byte() // scale in 0.1's
write_byte() // framerate
write_byte() // flags
message_end()
//The Explosion effect has some flags to control performance/aesthetic features:
#define TE_EXPLFLAG_NONE    0  // all flags clear makes default Half-Life explosion
#define TE_EXPLFLAG_NOADDITIVE  1  // sprite will be drawn opaque ensure that the sprite you send is a non-additive sprite
#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights
#define TE_EXPLFLAG_NOSOUND  4  // do not play client explosion sound
#define TE_EXPLFLAG_NOPARTICLES 8  // do not draw particles



All times are GMT -4. The time now is 00:54.

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