THASMOG Posted March 27, 2014 Posted March 27, 2014 So this script wont work. 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 ) I try to fix bug in MTA DayZ. If player tops a mag from weapon and reconnects. Picks it up he has over 10000 ammo. So i need to build check that checks ammo before shooting ? Maybe "onClientWeaponSwitch"
Moderators IIYAMA Posted March 27, 2014 Moderators Posted March 27, 2014 If you bought it then you should go back to them. We don't give support to leaked scripts. 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