Jump to content

remove weapon when 0 bullets


orel56000

Recommended Posts

I'm no expert in modes other than race but you could test if holding a weapon with 0 ammo is even possible the following way:

Make a function which gives you a weapon and set it's ammo variable to 0 with this: https://wiki.multitheftauto.com/wiki/GiveWeapon via a command handler. 

If it doesn't disappear then there is a way to do what you want, otherwise it could be hardcoded to go away when out of ammo. 

You can also see if it has 0 ammo with this: https://wiki.multitheftauto.com/wiki/GetWeaponAmmo

And as long as your weapon has 0 ammo you give yourself a new weapon and set it's ammo to 0.

Probably onClientRender would be needed for this. 

Edited by koragg
Link to comment
6 minutes ago, koragg said:

I'm no expert in modes other than race but you could test if holding a weapon with 0 ammo is even possible the following way:

Make a function which gives you a weapon and set it's ammo variable to 0 in this function: https://wiki.multitheftauto.com/wiki/GiveWeapon

If it doesn't disappear then there is a way to do what you want, otherwise it could be hardcoded to go away when out of ammo. 

You can also see if it has 0 ammo with this: https://wiki.multitheftauto.com/wiki/GetWeaponAmmo

And as long as your weapon has 0 ammo you give yourself a new weapon and set it's ammo to 0.

it is not giving when i give a weapon with 0 bullets...

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...