Firing Modes (Single shot / Burst mode / Full auto & Safety toggle)

Appreciate the effort

Well I have fixed compiling issues, lets see if this works.

1 Like

Yeah I have fixed it.

[Edit:]

Iā€™m just adding the other weapons as there isnā€™t a safety on all the rifles.

@Vespura Do I have your permission to release my modified version of this?

If you take a look at the license in my project files youā€™ll know exactly what you can and cannot do.
In summary:

  • You are allowed to release a modified version of this, but only under the following conditions:
  • You must use the same license
  • You must make the source code available to everyone
  • You have to disclose the original source and credits
  • You must state all changes made

For more info about the license, look here: https://github.com/TomGrobbe/Firing-Modes/blob/master/LICENSE

2 Likes

Here you go mate - [Release] Single Shot Fire Mode & Safety Feature

Any plans to make it so that certain weapons are default set to single shot or full auto for a whole server and they canā€™t change it?

That means a LOT of configuration needs to be done by the user, and considering that in that case a lot of people will start complaining because the script is too complex for them to setup, itā€™ll be easier if you fork my GitHub repository and modify it in the cs files and recompile it.

Nice work loks cool thanks for sharing

Amazing! Possibly make it to where players are forced to use Single or Burst for some weapons, that would be great :). Keep up the amazing work by far my favorite FiveM Developer.

Is there an option to set it so the safety catch to safe by default, versus the current fire?

Just change the static variable for safety to true

1 Like

Thats work for esx server?

Thereā€™s no such thing as ā€œesx serverā€ā€¦ This works for FXServer, both with or without any framework (like esx).

Update

A small update was just released. Click here to download it: https://github.com/TomGrobbe/Firing-Modes/releases

Changes

There are now 3 new options available to change in the __resource.lua file.

  1. disableIcons 'false'
    Change this to ā€˜trueā€™ if you want to hide/disable the icon in the top right corner of your screen.
  2. safetyToggleKey '7'
    Change the '7' to any valid control id if you want to change the ā€œToggle Safety Modeā€ button.
  3. switchFiringModeKey '311'
    Change the '311' to any valid control id if you want to change the ā€œSwitch Firing Modeā€ button.

Is there any way to make this more compatible with controller? Many times, you have to press the fire button a few times for it to recognize (singlefire mode, etc)

If you press the button on the keyboard, while still using the controller at the same time, then the keyboard press wonā€™t be recognized. You have to stop using the controller and only use the keyboard if you want to use the controls.

The reason I disabled this for now, is because K and L are mapped to buttons that would conflict on the controller, like Right Stick (Cinematic camera slow motion toggle) for the L key for example.

I can make it so thereā€™s different controls for keyboard and controller, however. The controller is pretty much packed with a ton of features already. Itā€™d be really hard to find an unused button on the controller for 2 new featuresā€¦

But, itā€™s still possible and I might add it one day.

Feature request : To force a mode on players. Eg: Force all to use Burst mode and they cant change itā€¦?

Feature request: A config file where we can do the above mentioned by FAXES, and also set the standard firing mode so they do not start as stock (for example, by default a carbine rifle is set to automatic, but with the config file, youā€™d be able to change it to semi-auto by default)

1 Like

How can i modify the language of the script ?
Iā€™m new in programming :slight_smile: