Jump to content

[HELP] addEventHandler ( "onClientPlayerWeaponFire


THASMOG

Recommended Posts

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+).

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...