How to add the weapon:

first you will need Zpatch and Zmenu, if you are using Zpatch 7.3 or newer you will need IV tweaks

1.1. for Zpatch older than 7.3 you will need to open ZolikaPatch.ini and find the two lines below:

; increase weaponinfo.xml to 256 weapons (after ANYWEAPON, the weapon names are ADDONWEAPON_(number)) (patch 5 and up only)
IncreaseWeaponLimit=0
; increase the amount of WTDs that can be in the game files
IncreaseWTDLimit=0

change both 0s to 1s

if you are using FLA open fastman92limitAdjuster_GTAIV.ini and find the line below:

; Weapon Models (100)
Weapon Models = 100

increase the number

1.2. for Zpatch 7.3 or newer you will need to open IVTweaker.ini and find the lines below:

; after ANYWEAPON, the weapon names are ADDONWEAPON_1, ADDONWEAPON_2, etc
MaxWeapons=60

; max amount of models in the weap .ide section
MaxWeaponModels=100

increase both numbers

2. drag and drop files below to common/data in your GTA IV folder

newanimgrp.dat
newdef.ide
newweaponinfo.xml

3. drag and drop the file below to pc/model/cdimages in your GTA IV folder

newwep.img

4. drag and drop the file below to pc/anim in your GTA IV folder

newanim.img

5.1. open gta.dat in your common/data folder and add the line below to the "occluders" section below the IPL common:/DATA/MAPS/OCCLU.IPL line

IDE common:/data/newdef.ide

5.2. open default.dat in your common/data folder and add the lines below at the bottom before HTML http:

WEAPONINFO common:/data/neweaponinfo.xml
ANIMGRP common:/data/newanimgrp.dat

5.3. open images.txt in your common/data folder and add the lines below before the #map xref line

platformimg:/models/cdimages/newwep  1
platformimg:/anim/newanim            1

6.to add sounds you will need RAGE Audio Toolkit, open GAME.DAT16, find W_M4 (or any other weapon you want the sounds of), right click and select "duplicate", then rename the copied line to W_PKM (must be in capitals)

7. done, youre ready to kill