[How to] Handle weapons (ex: Change snowball damage)

Hello !
I’m sharing today a way to modify any weapons and make them do whatever you want.

For this example we are going to handle the weaponsnowball.meta :

  • I want the snowball to do only 1 damage, default is 25 and be able to have up to 100 snowballs on me so i can use : GIVE_WEAPON_TO_PED(Ped ped, “WEAPON_SNOWBALL”, int ammoCount, BOOL isHidden, BOOL equipNow); and set the ammoCount up to 100.
  1. I open my best friend OpenIV and search for weaponsnowball.meta (change snowball by any other weapon, if you can’t find it, look for the default weapons.meta that contains some weapons) and copy it somewhere.

  2. Open the copy and edit whatever you want inside,

  • in this example i’m looking for damage, there is this :slight_smile: so i’ll edit it to 1.0, so we keep the ragdoll when doing headshot but damage is reduced to 1.
  • Now i need to change the max ammo, here we go :
<AmmoMax value="10" />
<AmmoMax50 value="10" />
<AmmoMax100 value="10" />
<AmmoMaxMP value="10" />
<AmmoMax50MP value="10" />
<AmmoMax100MP value="10" />

There is tons of other informations that you can change, but i’m not interested in this example i changed whatever i needed.

  1. Now we need to add it on the server, this is very simple, you need to create new resource or use an other one, so i’ll create folder called for example : mycustomweapons, inside of this folder you will place the weaponsnowball.meta and your resource.lua.

  2. Important, we now have to write the resource.lua :

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' 

files 
{
	'weaponsnowball.meta',
}

data_file 'WEAPONINFO_FILE_PATCH' 'weaponsnowball.meta'

Don’t forget to check what’s the latest "resource_manifest_version " so you are up to date !

  1. You are good to go, start your resource, you can edit this at runtime and have fun changing any properties.

Here is the example on the work : https://streamable.com/o1fp9

And here is the download/view : Github Link

Don’t hesitate to ask any question, if i can help you create your own idea !

8 Likes

where would we find the weapon meta for the revolver?

Search all files using “revolver” in openIV and you’ll find it, it’s either in the name or in the weapons.meta

well there is a lot of weapons.meta. not seeing anything revovler related for metas. ill have to start pulling them all out and looking at each one.

1 Like

er nvm i found it lol. weaponrevolver.meta in mpapartment

i updated the damage of it but there was no update to it. here is the weaponrevovler.meta
https://pastebin.com/DHHxq4cb

Resource.lua is this

resource_manifest_version ‘44febabe-d386-4d18-afbe-5e627f4af937’

files
{
‘weaponrevolver.meta’,
}

data_file ‘WEAPONINFO_FILE_PATCH’ ‘weaponrevolver.meta’

Your Damage is set at 60.0

yeah i got it working. had to do a restart. thanks for the info on this though!

No problem :slight_smile:
Glad you found the problem

1 Like

can you send me your script please!

for which?

Hello,

You know if its possible to create a differente ammo type name, and change it in the weapon?

Thanks :wink:

Use another one yes, create one i have no idea, never tried before.

1 Like

I was able to do it, i created a new AMMO (with CAmmoInfo) and just associated to the weapon i want
( with <AmmoInfo ref= )

Thanks for the response anyway :wink:

That’s really cool, good to know :slight_smile:
Happy that you found a way

Did you get it work by streaming your new revolver meta file in your stream folder ?

Can we change the velocity of snowball?

I suggest extracting all the weapon-related .meta files at once in a specific folder
image

Then open the folder in VS Code

Then you can easily find whatever you need by using the search feature
image