How can I check for snow condition?

I have a script for picking up and using snowballs. Currently you can do it anywhere. I wish to set a condition for when the player is actually standing on snow. How could I implement this?

1 Like

I don’t think snow is a separate terrain type, but you could maybe check for that? I know there is a native for checking offroad road material for changing vehicle handling.

We just used GetSnowLevel to get the snow level when it showed up on the ground, but this of course would allow you to use it in in areas that wouldn’t be covered in snow (like inside of a house/ipl).

Noted thank you I will try this

Hmmm. I see

A little late to the party, but we use Globalstates to get the weather and then check if the ped is inside before allowing it:

if GlobalState.Weather == "XMAS" or GlobalState.Weather == "SNOWLIGHT" or 
     GlobalState.Weather == "SNOW" or GlobalState.Weather == "BLIZZARD" then
          if GetInteriorFromEntity(PlayerPedId()) == 0 then
               --how you get your snowballs here
          end
end

One thing to note is we have added snow on the ground to all of these winter weathers so if you don’t do that you could just use the weather you use.

1 Like

nice thank you. how do i add snow to the ground for the other weather types? it’s only for xmas by default I believe

Here’s that part of our client side:

if not weatherTransitioning then
     if GlobalState.Weather == "XMAS" or GlobalState.Weather == "SNOWLIGHT" or GlobalState.Weather == "SNOW" or GlobalState.Weather == "BLIZZARD" then
          ForceSnowPass(true)
          SetForceVehicleTrails(true)
          SetForcePedFootstepsTracks(true)
     else
           ForceSnowPass(false)
           SetForceVehicleTrails(false)
           SetForcePedFootstepsTracks(false)
     end
end