Posts: 30
Threads: 9
Joined: Sep 2011
Reputation:
0
Hi!
I need a script,which disables firing if the ammo of the weapon is == 1.
Thanks
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Not really possible. Weapon firing is handled client-side.
Posts: 30
Threads: 9
Joined: Sep 2011
Reputation:
0
Will this work?If there is only 1 bullet in the weapon,the player is going to switch to hand?
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Not really, if they're lagging (even by like 5 MS) they will shoot the bullet before the server has a chance to detect it.
Posts: 937
Threads: 69
Joined: Dec 2009
Reputation:
0
Well I tested it with desert eagle. I had one bullet and it switched to hand. It's not really accurate, like if I'll do c-bug I can shot that ammo out.
However I think you can put that under a timer. So it will switch automatically if you'll hold a weapon with 1 bullet.
Posts: 30
Threads: 9
Joined: Sep 2011
Reputation:
0
No.On my server the players can hold the weapon with 1 bullet,because it's equal to a weapon without bullets(in the real life).So players can scare others players,even if there is no bullet in the weapon.(Roleplay Server)
If this isn't possible,how can I do that player can hold weapon with no ammo?
Posts: 930
Threads: 7
Joined: Jul 2010
Reputation:
0
Another thing that is yet impossible. Once a weapon reaches 0 ammo, it is automatically removed. There are some objects that you can attach using SetPlayerAttachedObject, like weapons, just search for them on the internet, and you can attach weapons once the weapon runs out of ammo.
Posts: 30
Threads: 9
Joined: Sep 2011
Reputation:
0
That's why I would like to do it with the 1 bullet system.But yes,if the player is lagging it isn't working