Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public fw_touch(bullet, ent)
- {
- 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;
- new my_pbgun = user_has_pbgun(owner);
- new damage = get_pcvar_num(damge);
- if (my_pbgun)
- {
- if (my_pbgun == 1)
- damage = 100;
- else if(my_pbgun == 2 || my_pbgun == 3)
- damage = 100;
- else if(my_pbgun == 4)
- damage = 100;
- else if(my_pbgun == 5)
- damage = 100;
- else if(my_pbgun == 6)
- damage = 100;
- else if(my_pbgun == 7)
- damage = 100;
- else if(my_pbgun == 8)
- damage = 100;
- else if(my_pbgun == 9)
- damage = 100;
- else if(my_pbgun == 10)
- damage = 100;
- }
- ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(damage), 4098);
- }
- if (!equali(class, class2))
- {
- set_pev(bullet, pev_velocity, Float:{0.0, 0.0, 0.0});
- set_pev(bullet, pev_classname, "pbPaint");
- set_pev(bullet, pev_solid, 0);
- set_pev(bullet, pev_movetype, 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/pb%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 (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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement