Posts: 1,648
Threads: 482
Joined: Jun 2010
Title says all.
I'm trying to do different ammo types for guns so if they use one kind, I'd rather they didn't destroy the gun so they can load in new ammo?
Posts: 1,648
Threads: 482
Joined: Jun 2010
I don't follow? All I need to know is if when ammo = 0 is there a way to make them keep the gun with 0 ammo?
Posts: 1,648
Threads: 482
Joined: Jun 2010
Alright, thank you.
Anyone else have an idea how I can do this also?
Posts: 1,938
Threads: 16
Joined: Feb 2007
Reputation:
0
I don't think this is possible with the way GTA handles the guns themselves. If a gun is empty, it is tossed away. What you CAN do is (note that it is a little hacky) always keep 1 bullet in the gun and then make it so that the gun cannot be shot when it only has one bullet left.
Posts: 1,336
Threads: 30
Joined: Aug 2010
Reputation:
0
Since 0.3z you can detect weapon firing state using OnPlayerWeaponShot. So using this you can check like if ammo is like near to or less than 2 ( if(ammo < 2) { ammo about to over } ). Because i am guessing that this callback count every single shot fired.
So maybe this might come usefull.
Else you can use a very quick timer or OnPlayerUpdate which aint the best thing to do though.
Posts: 1,648
Threads: 482
Joined: Jun 2010
What I can do is:
If the ammo type runs out in the gun, automatically set it to the standard rounds.
Posts: 160
Threads: 16
Joined: Mar 2012
Reputation:
0
I've seen this kind of system in another server , just make a inventroy system and when it dedects the gun have 0 ammo its sends it to the inventory and you cant take it out untill you combine it with the ammo it needs.