Snowballs!

snow
snowballs
reduceddamage
winter

#1

Snowballs! :snowman_with_snow: :snowflake: (v1.5)

Pickup snowballs like in GTA:O during xmas weather!

Features

  • Shows help message whenever you first spawn or get out of a vehicle to notify the player they can use either E or dpad-right while on foot, to pickup snowballs. The message shows the correct input depending on which device the user is currently using (keyboard/controller). The message will disappear after a few seconds.
    Keyboard message:
    image
    Controller message:
    image

  • You can only pickup snowballs if the weather is set to “XMAS” (you can configure this script to force the weather to be set to XMAS all the time).

  • You cannot pickup snowballs if you’re aiming (this is to prevent picking up snowballs if you’re trying to toggle the flashlight on your gun while aiming for example).

  • You cannot pickup snowballs while you’re inside a vehicle, obviously…

  • Every time you pickup snowballs you automatically get 2.

Video preview

Download

Click me!

Default Configuration

-- Configure this:
local enableWeatherControl = false
-- Set this to true if you want this resource to set the weather to xmas for you.
-- DO NOT SET THIS TO TRUE IF YOU HAVE ANOTHER RESOURCE ALREADY MANAGING/SYNCING THE WEATHER FOR YOU.

Changelog


Help with Christmas Tree and Snow - Permanent til removed
Snow & Snowballs?
#2

:snowflake:


#3

:snowflake::snowflake::snowflake:

:snowman::snowman::snowman:


#4

Nice share, can’t seem to remember now but, do they do any damage to players or are the snowballs harmless?


#5

Oddly enough, they do damage to ai peds as well as player peds, animals and even damage vehicles, however if you’re not using a vehicle damage script it wil take a shit ton of snow balls to actually destroy a car.


#6

If only that wasn’t the case but I’m running a RP server thus this would be really nice but I’ll feel like feeding the trolls with tools to ruin other people’s experience.

Will search around and see if there’s any way to block throwing them if aiming at ped.


#7

If there was a script to make snowballs do 0 damage or very minuscule damage i would be 100% up for using this for the season this year. Not so much worried about the cars but right now a 2 snowballs kills someone on our RP server lol!


#8

Maybe someone with some more knowledge about these natives might be able to run something like;
if weapon = snowball do; SET_PLAYER_WEAPON_DAMAGE_MODIFIER

I’ve found that in the natives here; https://runtime.fivem.net/doc/reference.html#_0xCE07B9F7817AADA3

According to the wiki:
void SET_PLAYER_WEAPON_DAMAGE_MODIFIER(Player player, float damageAmount);

This modifies the damage value of your weapon. Whether it is a multiplier or base damage is unknown.

Also according to: https://runtime.fivem.net/doc/reference.html#_0x3BE0BB12D25FB305

int GET_WEAPON_DAMAGE_TYPE(Hash weaponHash);
0=unknown (or incorrect weaponHash)
1= no damage (flare,snowball, petrolcan)


#9

Thats strange because it definitely does damage. I’ll try to look at the other natives and see if I can get it to work with snowballs :wink:


#10

Another way I was able to think of but I’m not sure if it would work is to stream a modified snowball.meta file to change the damage.

Check this out; weaponsnowball.meta (14.7 KB)


#11

You could also do something like this:

while true do
	Citizen.Wait(0)
	if GetSelectedPedWeapon(GetPlayerPed(-1)) == GetHashKey('WEAPON_SNOWBALL') then
		SetPlayerWeaponDamageModifier(PlayerId(), 0.0)
	end
end

Edit:
Just saw, I was too late… :smile:


#12

hope you’re not planning on running that :stuck_out_tongue_winking_eye: (no wait(0))
jk, i’ll see what I can do. Need to wait for my friend though cause I need to test it on players as well.


#13

I am always forgetting it ^^


#14

I’ve tried a lot of scenarios (with @shayan_doust) using SetPlayerWeaponDamageModifier(PlayerId(), 0.0) however none of them seemed to work. The only thing i could do was to increase the snowball damage, rather than remove or decrease it. Disabling headshots using SetPedSuffersCriticalHits link here made the damage less when throwing a snowball on someone’s head, however it still killed them eventually.
If anyone can help me figure out how to disable damage for just a single weapon that’d be great. Maybe i’m just using the wrong native but I can’t find one that seems to work any better than what i’ve tried so far…


#15

I wont be any help on the code side of things as im in the same boat and looking for a way. but if you need anyone to help test just let me know ill let you pound me with snowballs!!! :cloud_with_snow::snowflake::snowman:


#16

That’d be great tomorrow. Won’t have time anymore as it’s already 0:36 am :zzz:.


#17

Okay just let me know


#18

Update! Reduced snowball damage to players v1.1

A new update is on my github right now. It reduces snowball damage, it’s not fully disabled though. Instead of 2 or 3 hits = 1 kill, it’s now: A lot of hits = 1 kill.
Still kills you though :expressionless:
Check OP for the release.


#19

Love the idea for this time of year :slight_smile:


#20

yesss thanks !! i was trying to make a code too for no damage, but there was a bug… :frowning: lucky you are here :slight_smile: this was my wrong code :

local times = 1
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        snowball()
    end
end)

function snowball()
    SetPedInfiniteAmmo(GetPlayerPed(-1), true, GetHashKey("WEAPON_SNOWBALL"))
    if HasPedBeenDamagedByWeapon(GetPlayerPed(-1), GetHashKey("WEAPON_SNOWBALL"), -1537381064) then
        times = 2
    end
    if times == 2 then
        SetEntityHealth(GetPlayerPed(-1), 200)
        times = 1
    end
end

also maybe an issue:

We can take snowballs in buildins. maybe an option to disable it ?