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.

Invisible Vehicles

Featured Replies

When my callout starts it spawns a swift heli and warps the pilot inside, but for some reason if you're not in close proximity to the helicopter when it spawns, it turns invisible, and so does the Ped inside.

If you stop the callout the Ped suddenly becomes visible, sitting in mid-air, and you can run into the invisible helicopter. 
At a total loss here, so any ideas would be welcome.

            Chopper = new Vehicle("SWIFT", Helipad, 100.9656f);
            Chopper.IsPersistent = true;
            Chopper.PrimaryColor = Color.Black;
            Chopper.SecondaryColor = Color.Black;
            Rage.Native.NativeFunction.Natives.SET_VEHICLE_LIVERY(Chopper, 0);            
            Chopper.IsVisible = true;

 

  • Replies 20
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • No, i changed the vehicle to see if that was the problem, but it wasn't. It seems like it is finally fixed now, spawning it when the player is within 150m and NOT using a gamefiber, for some reas

  • Author
3 hours ago, alexguirre said:

That also happened to me, I'm not in my computer right now but I think I used the native SET_ENTITY_LOAD_COLLISION_FLAG.

NativeFunction.CallByName<uint>("SET_ENTITY_LOAD_COLLISION_FLAG", myVehicle, true);

Looks like that didn't do much to help.., the pilot is visible now and you can run into the vehicle but its still transparent.

Also tried NativeFunction.Natives.REQUEST_MODEL(Chopper.GetHashCode()); , no go

And now the pilot doesn't even spawn when you're not close enough..really strange

Edited by khorio

  • Author
43 minutes ago, ainesophaur said:

I wonder if it has to do with your in game drawing distance.. What is your in game graphic setting for it?

Maxed out. It's in one of my callouts and other people are having the same problem.

Are there any tasks you can assign to the ped like the drive around task? The invisible thing is hard for me to wrap my head around, but in the code you posted I don't see anything going on in terms of what the helicopter should do. I'd imagine the game wouldn't just let it fall out of the sky when it's spawned.

I'd try to just create a blip for the destination and check how far the player is.. Only once they're close enough should you spawn the helicopter

  • Author

I tried that too...the way it should work is this onbeforecallout spawns 2 peds and a chopper, oncalloutaccepted warps the pilot in seat -1, and when I arrive both me and the other ped get in, but the chopper isn't there (and it should be because of if(!chopper.exists())

When l stand near the spawn point and trigger the call out all is fine. I tried only spawning it in when the players distance <= 150f, still the same.

So in short, it shouldn't do anything before the player arrives

Edited by khorio

Try wrapping it in its own Gamefiber. I've had some real weird stuff go on when spawning peds/vehicles just as part of OnBeforeCallout where things just wouldn't even try and work till you got right up on them, I guess it has something to do with how GTA manages peds/vehicles in memory.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

  • Author
On 6/1/2016 at 3:40 AM, Darkmyre said:

Try wrapping it in its own Gamefiber. I've had some real weird stuff go on when spawning peds/vehicles just as part of OnBeforeCallout where things just wouldn't even try and work till you got right up on them, I guess it has something to do with how GTA manages peds/vehicles in memory.

I hoped that would work, just tried it, still the same :/

Only the one ped spawns, the pilot and helicopter are nowhere to be seen.

Edit: Looks like it did help a bit, doing a bit more testing now, it hasn't spawned 2 times and the pilot died (for some odd reason) 1 time.

Yup, seems like that did the trick :) Thanks a million @Darkmyre :)

 

Still the same issue, at a total loss now

Edited by khorio

  • Author

So I've narrowed it down to this: The Chopper (or any vehicle for that matter) will not spawn for some strange reason.

When i get the callout, and go to the location it's not there. if i end the call and start it again (from wherever on the map) it WILL spawn. It's like it won't spawn because the location is not in memory or something, i don't have this problem in any of my other calls and really don't know why this is happening. The 1st time it won't spawn, all the other times it will.

  • Author
4 minutes ago, LtFlash said:

ATM you create a new veh in OnCalloutAccepted(), right? You might try to spawn a vehicle when player is closer than x units to the spawn point. This shouldn't influence the performance at all (/much) and should solve your issue.

I did try that..it's the same thing, i really don't get it, tried it OnBefore, OnAccepted, even if(Game.LocalPlayer.Character.Position < 300f), all the same.

Logically speaking it doesn't make any sense and it looks like a coding issue somewhere but i can't seem to find it

Edited by khorio

Maybe try attaching a blip to it, if you're not getting exceptions when accessing its properties it seems like it exists, but maybe it's flying off or something?

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

  • Author
6 minutes ago, Darkmyre said:

Maybe try attaching a blip to it, if you're not getting exceptions when accessing its properties it seems like it exists, but maybe it's flying off or something?

Well that's the problem, it isn't spawning anymore, i do get exceptions now. It just will not spawn for some reason. (if i put it in a gamefiber). if i dont put it in a gamefiber i dont get exceptions but it isnt there.

case EState.SpawnChop:
                            if (Vector3.Distance(Game.LocalPlayer.Character.Position, Helipad) <= 250f)
                            {
                                GameFiber.StartNew(delegate
                                {
                                    Chopper = new Vehicle("WASHINGTON", Helipad, 100.9656f);
                                    Chopper.IsPersistent = true;
                                    Chopper.PrimaryColor = Color.Black;
                                    Chopper.SecondaryColor = Color.Black;
                                    NativeFunction.Natives.SET_VEHICLE_LIVERY(Chopper, 0);
                                    NativeFunction.Natives.SET_VEHICLE_FULLBEAM(Chopper, true);
                                    Chopper.AttachBlip();
                                });                               

                                Agent = new Ped("s_m_m_highsec_02", Chopper.FrontPosition, 0f);
                                Pilot = new Ped("s_m_y_pilot_01", Agent.GetOffsetPositionRight(2f), 0f);

                                Pilot.IsPersistent = true;
                                Pilot.BlockPermanentEvents = true;
                                Agent.IsPersistent = true;
                                Agent.BlockPermanentEvents = true;

 

  • Author
Just now, ToastinYou said:

The WASHINGTON and SWIFT are trying to spawn on the exact same point? Would that be interrupting them because they're both trying to spawn right at that exact spot? "Helipad, 100.9656f"

 

No, i changed the vehicle to see if that was the problem, but it wasn't.

It seems like it is finally fixed now, spawning it when the player is within 150m and NOT using a gamefiber, for some reason this blocked it from spawning aswell.

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.