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:
Controller message:
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.
-- 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.
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.
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.
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!
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
while true do
Citizen.Wait(0)
if GetSelectedPedWeapon(GetPlayerPed(-1)) == GetHashKey('WEAPON_SNOWBALL') then
SetPlayerWeaponDamageModifier(PlayerId(), 0.0)
end
end
hope you’re not planning on running that (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.
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 SetPedSuffersCriticalHitslink 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…
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!!!
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
Check OP for the release.
yesss thanks !! i was trying to make a code too for no damage, but there was a bug… lucky you are here 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 ?