Snowballs!

snow
snowballs
reduceddamage
winter

#21

Define buildings? You mean anywhere with a roof above you or are you talking about scripted houses, garages etc? The latter one should be implemented in that specific script (as soon as they enter the script removes snowballs from inventory).
The first one is a bit trickier I think, not sure exactly how that’d work.


#22

You are changing the weapon assuming the snowballs are bullets yet in this wiki page; https://wiki.fivem.net/wiki/Weapons they are part of explosions.

Maybe instead adding explosion damage modifier like this; https://runtime.fivem.net/doc/reference.html#_0xFAEE099C6F890BB8

SetEntityProofs(GetPlayerPed(-1), explosionProof false)

I don’t know if that’s how it would work, am new to all this, but think it’s something like that.

If anyone can test.


#23

Nice find, didn’t notice that before.
I’ll have a go on that, will let you know if I can get it to work :slight_smile:


#24

Two suggestions, you could use text labels to print the instructions in the clients game language.

These are the used Labels:

	HELP_SNOW1 = When unarmed, press ~INPUT_DETONATE~ to pick up a snowball. You can carry 1 snowball at a time.
	HELP_SNOWM = When unarmed, press ~INPUT_DETONATE~ to pick up a snowball. You can carry ~1~ snowballs at a time.
	HELP_SNOWP = When unarmed, press ~INPUT_DETONATE~ to pick up ~1~ snowballs. You can carry ~1~ snowballs at a time.

Also, about the damage problem, you could try this:

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		
		local PlayerPed = PlayerPedId()
		local LastPedHealth = GetEntityHealth(PlayerPed)

		if HasPedBeenDamagedByWeapon(PlayerPed, GetHashKey("WEAPON_SNOWBALL"), 0) then
			SetEntityHealth(PlayerPed, LastPedHealth)
			ClearPedLastWeaponDamage(PlayerPed)
		end
	end
end)

#25

Yes, I’ve thought about that however I decided not use it because of the following small issues:

  1. I’m using another key to pickup snowballs.
  2. I’m allowing 2 snowballs per pickup instead of 1.
  3. You can pickup snowballs with a weapon in your hand, unlike in GTA:O.

I could change all of this but I’d rather keep it as is. Feel free to modify it for yourself and release it though :wink: .


I believe @tanbomxp tried something like this and it didn’t work? I’ll look into it again though.
Also this could create possible issues for people using scripts that alter your “death” state. Getting hit by a snowball while being “down/injured” could bring you back to life(?)


#26

Not really it just sets the health to the amount it was before you got hit. So it shouldn’t bring you back to life.


#27

I don’t have time to test it right now, did you test to make sure it works? if so I’ll add it to the script and release it.


#28

Wasn’t able to test, too :sweat_smile:


#29

Alright then it’ll have to wait until I can get someone on to test it with.


#30

well yea, my code was wrong because once i was hit by a snowball, the fuction was always true, so i was always heald . so when i was shot with a gun, i was heald too. that is why my code was wrong. i tried many different things, but no luck


#31

I didn’t thought about this Problem…

I updated the Code so this [hopefully] shouldn’t be a Problem know.


#32

Let me know! Very interested! )


#33

Unfortunately just worked for me…

[Don’t ask why, I don’t know]


#34

Tested it, still taking damage, two hits to die.


#35

Did you test my latest version or did you try the modification @Flatracer posted?


#36

That’s awesome! I’ll test it to make sure and then I’ll add it to the released version. :smiley:


#37

Tested Flatracers, It doesn’t reply to the correct person sometimes…


#38

Yeah I’m testing it now but it looks like it’s not working for me either :confused:
Edit: reloading the script gave me this thing :confused: not sure if the meta file you provided is 100% correct @Flatracer


#39

@Flatracer I noticed it gave me 2 slots of “snowballs” in the weapon select menu, can’t select 2 though because that just switches back to 1 right after… maybe it’s adding a new type of snowballs which are somewhat glitched but keeping the old snowballs untouched?


#40

That is strange, These are all problems I didn’t have.