Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local actor_reload
- local actor_scope
- -- put in bind_stalker update
- function actor_on_update(se_actor,delta)
- local wpn = db.actor:active_item()
- if (wpn) then
- if (alun_utils.item_is_fa(wpn)) then
- local inmag = wpn:get_ammo_in_magazine()
- if (inmag == 0) then
- if not (actor_reload) then
- actor_reload = true
- actor_on_weapon_no_ammo(wpn)
- end
- else
- actor_reload = nil
- end
- end
- if (wpn:section() == "wpn_binoc" or alun_utils.addon_attached(wpn,"sc")) then
- if (device().fov < 50) then
- if not (actor_scope) then
- actor_scope = true
- actor_on_weapon_zoom_in(wpn)
- end
- else
- if (actor_scope) then
- actor_scope = nil
- actor_on_weapon_zoom_out(wpn)
- end
- end
- else
- if (actor_scope) then
- actor_scope = nil
- actor_on_weapon_zoom_out(wpn)
- end
- end
- end
- end
- -------------------
- -- actor_on_weapon_no_ammo(wpn)
- -------------------
- function actor_on_weapon_no_ammo(wpn)
- for i=1, #intercepts.actor_on_weapon_no_ammo do
- intercepts.actor_on_weapon_no_ammo[i](wpn)
- end
- end
- -------------------
- -- actor_on_weapon_zoom_in(wpn)
- -------------------
- function actor_on_weapon_zoom_in(wpn)
- for i=1, #intercepts.actor_on_weapon_zoom_in do
- intercepts.actor_on_weapon_zoom_in[i](wpn)
- end
- end
- -------------------
- -- actor_on_weapon_zoom_out(wpn)
- -------------------
- function actor_on_weapon_zoom_out(wpn)
- for i=1, #intercepts.actor_on_weapon_zoom_out do
- intercepts.actor_on_weapon_zoom_out[i](wpn)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement