Witam, próbuję dojść do efektu realistycznego odbicia kulki z paintballmoda.
Patrząc na kod podany poniżej wygląda to aktualnie tak: https://iv.pl/images...23538167076.png
Czyli nieważne pod jakim kątem ent uderza w ścianę to i tak odbija się prostopadle do ściany.
Moim celem jest osiągniecie takiego efektu: https://iv.pl/images...97323586857.png
Czyli żeby tor odbicia kuli był zależny od kontu pod jakim uderza on w ścianę.
Próbowałem to robić sam ale nic nie wychodziło, jest ktoś w stanie pomóc bądź nakierować jak to napisać?
public fw_touch(bullet, ent, id) { new class[20]; pev(bullet, pev_classname, class, 19); if (!equali(class, "pbBullet")) return FMRES_IGNORED; new Float:origin[3], class2[20], owner = pev(bullet, pev_owner), is_ent_alive = is_user_alive(ent); pev(ent, pev_classname, class2, 19); pev(bullet, pev_origin, origin); if (is_ent_alive) { if (owner == ent || pev(ent, pev_takedamage) == DAMAGE_NO) return FMRES_IGNORED; if (get_user_team(owner) == get_user_team(ent)) if (!get_pcvar_num(friendlyfire)) return FMRES_IGNORED; ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(get_pcvar_num(damge)), 4098); } if (!equali(class, class2)) { set_pev(bullet, pev_classname, "pbPaint"); set_pev(bullet, pev_solid, 0); set_pev(bullet, pev_waterlevel, 1); set_pev(bullet, pev_movetype, MOVETYPE_BOUNCE); set_pev(bullet, pev_velocity, Float:{0.0,150.0,0.0}); //engfunc(EngFunc_SetModel, bullet, "sprites/paintball.spr"); new a, findpb = 0; while (a++ < g_pbcount && !findpb) if (g_paintballs[a] == bullet) findpb = g_pbstatus[a] = 2; remove_task(bullet); remove_task(bullet+TASK_PB_RESET); if (get_pcvar_num(sound)) { static wav[20]; formatex(wav, 20, is_ent_alive ? "player/pl_pain%d.wav" : "misc/ag%d.wav", is_ent_alive ? random_num(4,7) : random_num(1,4)); emit_sound(bullet, CHAN_AUTO, wav, 1.0, ATTN_NORM, 0, PITCH_NORM); } new bool:valid_surface = (is_ent_alive || containi(class2, "door") != -1) ? false : true; if (pev(ent, pev_health) && !is_ent_alive) { ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(pev(ent, pev_health)), 0); valid_surface = false; } if (valid_surface) { //paint_splat(bullet); set_task(float(get_pcvar_num(blife)), "paint_reset", bullet+TASK_PB_RESET); } else paint_reset(bullet+TASK_PB_RESET); return FMRES_HANDLED; } return FMRES_IGNORED; }