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.

[SOLVED]Character's selected apartment and saved personal vehicle

Featured Replies

Hey, I have a few questions I was hoping to get some answers for before I add further features to my plugin.

 

How does LSPDFR handle the character's apartment and the personal vehicle?

I'd like it if my plugin could retrieve the adress name of the current selected apartment. Does the API allow this?

If not, as there are (currently) only 4 apartements available, I suppose I could make it so the plugin checks where the BlipSprite is in the game world, and manually add the coords to a list with strings by myself. But that'll take some extra work and I'm looking for easy solutions.

 

Also, the same goes for the personal vehicle. Does the API allow me to retrieve the model your character currently has saved outside the garage?

Edited by ZPhDevs

5 hours ago, ZPhDevs said:

Hey, I have a few questions I was hoping to get some answers for before I add further features to my plugin.

 

How does LSPDFR handle the character's apartment and the personal vehicle?

I'd like it if my plugin could retrieve the adress name of the current selected apartment. Does the API allow this?

If not, as there are (currently) only 4 apartements available, I suppose I could make it so the plugin checks where the BlipSprite is in the game world, and manually add the coords to a list with strings by myself. But that'll take some extra work and I'm looking for easy solutions.

 

Also, the same goes for the personal vehicle. Does the API allow me to retrieve the model your character currently has saved outside the garage?

Not sure but i think you cannot use the API but LSPDFR allow you to see the apartment in the LSPDFR Companion App or in game LSPDFR Menu

Thanks

  • Author

I figured, because I've been scanning the API document up and down for any clues. I might have to do a work around by making the plugin search the game world for a certain blip, get the coords from there and match the result against a list with the 4 apartments in it. Then display the one that is chosen on the UI.

14 minutes ago, ZPhDevs said:

I figured, because I've been scanning the API document up and down for any clues. I might have to do a work around by making the plugin search the game world for a certain blip, get the coords from there and match the result against a list with the 4 apartments in it. Then display the one that is chosen on the UI.

Yeah it would be great

Edited by Dark Devil

  • Author

Unfortunately that didn't work as espected.

 

I was trying

Blip safehouseBlip = NativeFunction.Natives.GET_FIRST_BLIP_INFO_ID(40)
safehouseCoords = NativeFunction.Natives.GET_BLIP_COORDS(safehouseBlip)

but the log tells me that safehouseCoords wasn't set to an instance of an object. Which makes me think that the first native didn't work properly.

ID 40 is supposed to be the Safehouse blipSprite.

 

EDIT

 

This worked, however.

private static Vector3 safehouseVector()
        {
            int blip = NativeFunction.Natives.GET_FIRST_BLIP_INFO_ID<int>(40);
            return NativeFunction.Natives.GET_BLIP_COORDS<Vector3>(blip);
        }

Now I "only" need to figure out the exact coords of the apartments so I have something to compare it to. 🙂

 

SECOND EDIT:

I resolved the issue by doing this work-around. I got the blip coords using the code above, compared the result to a string which contains the X,Y and Z of the blip. If it matches either of the 4 apartments, it will display the one currently selected on the plugin UI.

Edited by ZPhDevs

  • The title was changed to [SOLVED]Character's selected apartment and saved personal vehicle
  • Author

That's a useful tool! However in this case the string needs to be exactly the coords of the blip, so I made it so the blip vector looks for either of the 4 apartment strings.

 

Like this

private static Vector3 safehouseVector()
        {
            int blip = NativeFunction.Natives.GET_FIRST_BLIP_INFO_ID<int>(40); //Safehouse blip sprite
            return NativeFunction.Natives.GET_BLIP_COORDS<Vector3>(blip); //Blip to vector3
        }

...

var safehouseCoords = safehouseVector(); // the actual vector3 of the selected apartment through LSPDFR Interaction menu

...

if (safehouseCoords.ToString().Contains("X:-48.8711 Y:-589.5564 Z:37.958"))
                {
                    apartmentName = "4 Integrity Way";
                }

 

9 minutes ago, ZPhDevs said:

That's a useful tool! However in this case the string needs to be exactly the coords of the blip, so I made it so the blip vector looks for either of the 4 apartment strings.

 

Like this


private static Vector3 safehouseVector()
        {
            int blip = NativeFunction.Natives.GET_FIRST_BLIP_INFO_ID<int>(40); //Safehouse blip sprite
            return NativeFunction.Natives.GET_BLIP_COORDS<Vector3>(blip); //Blip to vector3
        }

...

var safehouseCoords = safehouseVector(); // the actual vector3 of the selected apartment through LSPDFR Interaction menu

...

if (safehouseCoords.ToString().Contains("X:-48.8711 Y:-589.5564 Z:37.958"))
                {
                    apartmentName = "4 Integrity Way";
                }

 

Yeah that's good

  • Author

I'm not sure if I could do the same for the personal vehicle though, because I think LSPDFR uses BlipSprite ID 1 for the personal vehicle. That blip sprite is also shared with your character's last vehicle. GTA uses blip id 225 for the personal vehicle, which is unique.

52 minutes ago, ZPhDevs said:

I'm not sure if I could do the same for the personal vehicle though, because I think LSPDFR uses BlipSprite ID 1 for the personal vehicle. That blip sprite is also shared with your character's last vehicle. GTA uses blip id 225 for the personal vehicle, which is unique.

Yeah, it is not easy to do same for the vehicle

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.