Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Infinite ammo (resets ammo on reload & also when ammo runs out, just in case you activate it late)
- if not _onReload then _onReload = RaycastWeaponBase.on_reload end
- function RaycastWeaponBase:on_reload()
- if managers.player:player_unit() == self._setup.user_unit then
- self.set_ammo(self, 1.0)
- else
- _onReload(self)
- end
- end
- if not _fireWep then _fireWep = NewRaycastWeaponBase.fire end
- function NewRaycastWeaponBase:fire( from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
- local result = _fireWep( self, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit )
- if managers.player:player_unit() == self._setup.user_unit and self:get_ammo_total() == 0 then
- self.set_ammo(self, 1.0)
- end
- return result
- end
- -- Message on screen
- if managers.hud then
- managers.hud:show_hint( { text = "Infinite ammo" } )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement