--DESCRIPTION: checks if player gun was fired g_fired_check = {} local oldweapon = -1 local oldammo = 0 local currentweaponindex = 0 local currentammo = 0 local shotsfired = 0 function fired_check_properties(e) end function fired_check_init(e) end function fired_check_main(e) local wid = GetPlayerWeaponID() -- no weapon equipped so do nothing if wid == 0 then return end -- check if player changes weapon if wid ~= oldweapon then for a = 0,9 do if wid == GetWeaponSlot (a) then currentweaponindex = a break end end oldweapon = wid oldammo = GetWeaponAmmo(currentweaponindex) shotsfired = 0 end -- ammo counter logic local shotfired = 0 local currentammo = GetWeaponAmmo(currentweaponindex) -- if ammo goes down we fired if currentammo < oldammo then shotfired = 1 shotsfired = shotsfired + 1 oldammo = currentammo -- if ammo goes up we reloaded elseif currentammo > oldammo then oldammo = currentammo end Prompt("gun fired = "..shotfired..", shots fired = "..shotsfired) end