THASMOG Posted March 27, 2014 Posted March 27, 2014 function weaponSwitch (weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2 (weapon) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getLocalPlayer(),ammoName,getElementData(getLocalPlayer(),ammoName)-1) end end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), weaponSwitch ) Simply i need to make a script that checks player ammo before fireing. Maybe onClientPlayerWeaponSwitch Why? Becose DayZ has a bug. When u drop mag and reconnect. Then you picup your dropped mag u have almost unlimited ammo (10000+).
Moderators IIYAMA Posted March 27, 2014 Moderators Posted March 27, 2014 https://forum.multitheftauto.com/viewtopic.php?f=91&t=73326 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now