Jump to content

new weapon


><?

Recommended Posts

Hello i want some help in making the idea of ​​special

Is to add a new type of weapon to the game , for example, there are two types Sniper I want to add a new type and chose his properties

And features !!

Can I make the idea ... if I could please help me coded crisis and give a simple example , and thank you #

Link to comment
  • Discord Moderators

It is not possible to add truly new weapons to MTA: SA, because there are no scripting functions for that. However, it is possible to workaround that to a certain extent by creatively using the functions we currently have.

Firstly, you have to think about what kind of weapon do you want to "add". Is it a sniper rifle? Is it a rifle? Is it a shotgun? The most important thing here is that you select a weapon type you can emulate by using the weapons that GTA: SA already has. Thanks to the createWeapon function, you can create a dummy weapon with unique accuracy, damage and range which shoots like an existing one, but has different properties that can give the illusion of a new weapon.

Great! We have now a dummy weapon that is like a new weapon! But how do we make the player shoot it like a normal weapon? This is the most complicated part, but I don't think that is way difficult either. You can give the player an existing weapon to aim, but instead of letting him shoot it as normal, intercept that and shoot your dummy weapon instead. Of course, your dummy weapon must face the point the player is aming to and be in the player hands, and you can achieve this by using a similar approach to the bone-attach resource, for example; that is, some maths. If you want the player aiming reticle to look nice, you can play with skill levels and setWeaponProperty with the weapon that the player is really holding.

Now you may be wondering: Hey, but won't this look ugly? The player will hold like two weapons at the same time and in the same place! Yes, you're right, that will happen and it looks ugly indeed. But remember the TXD and DFF replacing functions that MTA has, in addition to shaders. You can make the weapon that the player is really holding invisible with them, and let the player hold a third weapon which is nothing more than an object which represents the desired new weapon you want the players to see. To make the dummy weapon invisible you don't even need these functions: setWeaponFlags is enough.

If you want to, you can script custom shoot modes or features for the new weapon, so in the end it will look pretty convincing.

But of course all of this is easier said than done, and you need a decent scripting ability to do something playable and nice. I exposed and answered the main questions you can came across when scripting this, but writing the code itself is up to you.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...