Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
How always know when weapon reach 0 ammo? i need to write into variable that weapon have 0 ammo.
I don't understand you quite well.But still, why do you wan't to know if a weapon reached 0 ammo?Whats the purpose?
Posts: 723
Threads: 366
Joined: Jun 2016
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Use the callback OnPlayerWeaponShot.
Posts: 723
Threads: 366
Joined: Jun 2016
Yes, but not all weapons like spraycan, grenade call that.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Then detect when a player presses LEFT CLICK. Set a timer and when they release it, get the ammo and kill the timer a while after.
Posts: 723
Threads: 366
Joined: Jun 2016
But i just need when reach 0, i update when ammo is smaller, in onplayerupdate, but weapon where ammo fast changes, now always onplayerupdate, can write to variable 0
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
You can still achive that, with that method.
Posts: 723
Threads: 366
Joined: Jun 2016
But if weapon change, and player not release key?
Posts: 170
Threads: 10
Joined: Sep 2011
GetPlayerWeaponData or GetPlayerAmmo.