Jump to content

Need help with "onClientWeaponFire"


THASMOG

Recommended Posts

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"

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...