Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Grabbing current weather in RPH script

Featured Replies

Hi

 

Can anyone who is better at coding help me here? 

 

I am trying to get the current weather conditions in my script, but RPH has weather.set enabled, bnt weather.get throws exception "not implemented" so I cannot get the weather. 

 

I have found examples using Scripthook.net, but not RPH.  I read something about being able to use Rage.Natives, but did not really understand that. 

 

Can anyone help?

Is it possible?

 

Many thanks in advance. 

  • Author

Just in case someone else comes here looking for an answer here is an example of what I got working: 

Dictionary<int, string> LookupWeather = new Dictionary<int, string>()
        {
            { 669657108, "BLIZZARD" },
            { 916995460, "CLEAR" },
            { 1840358669, "CLEARING" },
            { 821931868, "CLOUDS" },
            { -1750463879, "EXTRASUNNY" },
            { -1368164796, "FOGGY" },
            { -921030142, "HALLOWEEN" },
            { -1530260698, "NEUTRAL" },
            { -1148613331, "OVERCAST" },
            { 1420204096, "RAIN" },
            { 282916021, "SMOG" },
            { -273223690, "SNOW" },
            { 603685163, "SNOWLIGHT" },
            { -1233681761, "THUNDER" },
            { -1429616491, "XMAS" },
        };

			string result;
           int GetWeather = NativeFunction.Natives.GetPrevWeatherTypeHashName<int>();
            if (.LookupWeather.TryGetValue(GetWeather, out result) )
            {
                // Result returned here, e.g. "RAIN"
            } else
            {
                // Catch all, weather is not in dictionary
            }

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.