Откроем ev_hldm.h, Где-то в конце добавим:
Code |
void EV_HLDM_MuzzleFlash( vec3_t pos, float amount ); |
Потом откроем ev_hldm.cpp, вставим где-то после этого:
Code |
// play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the // original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture. // returns volume of strike instrument (crowbar) to play float EV_HLDM_PlayTextureSound( int idx, pmtrace_t *ptr, float *vecSrc, float *vecEnd, int iBulletType ) |
Вот это:
Code |
void EV_HLDM_MuzzleFlash(vec3_t pos, float amount) { dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight(0); dl->origin = pos; dl->color.r = 255; // red dl->color.g = 255; // green dl->color.b = 128; // blue dl->radius = amount * 100; dl->die = gEngfuncs.GetClientTime() + 0.01; } |
Найдите функцию:
Code |
void EV_FireGlock1( event_args_t *args ) |
Найдите в ней:
Code |
EV_GetGunPosition( args, vecSrc, origin ); |
Прямо после неё вставте это:
Code |
EV_HLDM_MuzzleFlash( vecSrc, 1.0 + gEngfuncs.pfnRandomFloat( -0.2, 0.2 ) ); |
Интенсивность освещения ~1.0, умнажается на 100, и получается где от 80 до 120 радиус каждый раз по разному, для разнообразия. Можете ставить по больше чтобы была ярче вспышка, 1.0 это для Глока в самый раз а для автомата гдето 2.5 или 3.0