Raised This Month: $51 Target: $400
 12% 

How to make hit wall effect?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 01-30-2013 , 23:07   How to make hit wall effect?
Reply With Quote #1

How to make a bullet hit wall effect?

splash smoke (wall puff)
splash clay
hit spark
....

Last edited by Leech_v2; 01-31-2013 at 04:22.
Leech_v2 is offline
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 01-31-2013 , 00:24   Re: How to make hit wall effect?
Reply With Quote #2

Is this to difficulty?
Leech_v2 is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-31-2013 , 13:08   Re: How to make hit wall effect?
Reply With Quote #3

Code:
public CBaseWeapon_TraceAttack_Post( pEntity, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
 new iDecal = GUNSHOT_DECALS[ random_num( 0 , sizeof( GUNSHOT_DECALS ) - 1 ) ];
 
 new Float:vecEnd[3], Float:vecPlane[3]
 
 get_tr2(ptr, TR_vecEndPos, vecEnd);
 get_tr2(ptr, TR_vecPlaneNormal, vecPlane);
 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
 write_byte(TE_GUNSHOTDECAL)
 write_coord_f(vecEnd[0])
 write_coord_f(vecEnd[1])
 write_coord_f(vecEnd[2])
 write_short(pEntity)
 write_byte(iDecal)
 message_end()

 pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))

 xs_vec_mul_scalar(vecPlane, 60.0, vecPlane);
 xs_vec_add(vecEnd, vecPlane, vecEnd);
 
 entity_set_origin(pEntity, vecEnd)
 entity_set_model(pEntity, WEAPON_TRACE_EFFECT)
 entity_set_int(pEntity, EV_INT_solid, SOLID_NOT)
 entity_set_int(pEntity, EV_INT_movetype, MOVETYPE_NOCLIP)
 
 entity_set_float(pEntity, EV_FL_animtime, get_gametime())
 entity_set_float(pEntity, EV_FL_framerate, 40.0) 
 set_pev(pEntity, pev_scale, 0.5) 

 set_pev(pEntity, pev_spawnflags, SF_SPRITE_ONCE)

 // Set velocity
 new Float:vecVelocity[3], Float:vecRight[3], Float:vecUp[3];
 engfunc(EngFunc_VecToAngles, vecPlane, vecPlane );
 vector_to_angle(vecPlane, vecPlane);
 angle_vector(vecPlane,ANGLEVECTOR_RIGHT,vecRight)
 angle_vector(vecPlane,ANGLEVECTOR_UP,vecUp)
 vecVelocity[0] *= 32.0;
 vecVelocity[1] *= 32.0;
 vecVelocity[2] *= 32.0;
 
 new Float:flRandomVec = random_float(0.0, 64.0) * random_float(-1.0, 1.0);
 
 vecRight[0] *= flRandomVec;
 vecRight[1] *= flRandomVec;
 vecRight[2] *= flRandomVec;
 
 flRandomVec = random_float(0.0, 64.0) * random_float(-1.0, 1.0);
 
 vecUp[0] *= flRandomVec;
 vecUp[1] *= flRandomVec;
 vecUp[2] *= flRandomVec;
 
 vecVelocity[0] += vecRight[0] + vecUp[0];
 vecVelocity[1] += vecRight[1] + vecUp[1];
 vecVelocity[2] += vecRight[2] + vecUp[2];
 set_pev(pEntity, pev_velocity, vecVelocity);
 DispatchSpawn(pEntity);
 entity_set_int(pEntity, EV_INT_movetype, MOVETYPE_NOCLIP)
 set_pev(pEntity, pev_rendermode,  kRenderTransAdd)
 set_pev(pEntity, pev_renderamt,   27.0)
 entity_set_float(pEntity, EV_FL_animtime, get_gametime())
 
 entity_set_float(pEntity, EV_FL_nextthink, get_gametime() + 0.025);
 return HAM_IGNORED;
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 01-31-2013 , 22:13   Re: How to make hit wall effect?
Reply With Quote #4

Quote:
Originally Posted by ironskillz1 View Post
Code:
public CBaseWeapon_TraceAttack_Post( pEntity, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
 new iDecal = GUNSHOT_DECALS[ random_num( 0 , sizeof( GUNSHOT_DECALS ) - 1 ) ];
 
 new Float:vecEnd[3], Float:vecPlane[3]
 
 get_tr2(ptr, TR_vecEndPos, vecEnd);
 get_tr2(ptr, TR_vecPlaneNormal, vecPlane);
 message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
 write_byte(TE_GUNSHOTDECAL)
 write_coord_f(vecEnd[0])
 write_coord_f(vecEnd[1])
 write_coord_f(vecEnd[2])
 write_short(pEntity)
 write_byte(iDecal)
 message_end()
 
 pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
 
 xs_vec_mul_scalar(vecPlane, 60.0, vecPlane);
 xs_vec_add(vecEnd, vecPlane, vecEnd);
 
 entity_set_origin(pEntity, vecEnd)
 entity_set_model(pEntity, WEAPON_TRACE_EFFECT)
 entity_set_int(pEntity, EV_INT_solid, SOLID_NOT)
 entity_set_int(pEntity, EV_INT_movetype, MOVETYPE_NOCLIP)
 
 entity_set_float(pEntity, EV_FL_animtime, get_gametime())
 entity_set_float(pEntity, EV_FL_framerate, 40.0) 
 set_pev(pEntity, pev_scale, 0.5) 
 
 set_pev(pEntity, pev_spawnflags, SF_SPRITE_ONCE)
 
 // Set velocity
 new Float:vecVelocity[3], Float:vecRight[3], Float:vecUp[3];
 engfunc(EngFunc_VecToAngles, vecPlane, vecPlane );
 vector_to_angle(vecPlane, vecPlane);
 angle_vector(vecPlane,ANGLEVECTOR_RIGHT,vecRight)
 angle_vector(vecPlane,ANGLEVECTOR_UP,vecUp)
 vecVelocity[0] *= 32.0;
 vecVelocity[1] *= 32.0;
 vecVelocity[2] *= 32.0;
 
 new Float:flRandomVec = random_float(0.0, 64.0) * random_float(-1.0, 1.0);
 
 vecRight[0] *= flRandomVec;
 vecRight[1] *= flRandomVec;
 vecRight[2] *= flRandomVec;
 
 flRandomVec = random_float(0.0, 64.0) * random_float(-1.0, 1.0);
 
 vecUp[0] *= flRandomVec;
 vecUp[1] *= flRandomVec;
 vecUp[2] *= flRandomVec;
 
 vecVelocity[0] += vecRight[0] + vecUp[0];
 vecVelocity[1] += vecRight[1] + vecUp[1];
 vecVelocity[2] += vecRight[2] + vecUp[2];
 set_pev(pEntity, pev_velocity, vecVelocity);
 DispatchSpawn(pEntity);
 entity_set_int(pEntity, EV_INT_movetype, MOVETYPE_NOCLIP)
 set_pev(pEntity, pev_rendermode,  kRenderTransAdd)
 set_pev(pEntity, pev_renderamt,   27.0)
 entity_set_float(pEntity, EV_FL_animtime, get_gametime())
 
 entity_set_float(pEntity, EV_FL_nextthink, get_gametime() + 0.025);
 return HAM_IGNORED;
}
thank ...
i find TE_STREAK_SPLASH to make spark...
how to make black soil spary....bad english
Leech_v2 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 00:21.


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