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.

return ((Vector3)ref position).DistanceTo(((Entity)Game.LocalPlayer.Charact

Featured Replies

Hi there I am making a menu using RAGENativeUI and LSPDFR but I am trying to get the Ped that I have stopped to give the correct information.

 

public static void MainMenuOnItemSelected(UIMenu sender, UIMenuItem selectedItem, int index) => GameFiber.StartNew((ThreadStart)(() =>
        {
            if (selectedItem == AskForIDItem)
            {
                Ped ped = ((IEnumerable<Ped>)((IEnumerable<Ped>)World.GetAllPeds()).Where<Ped>((Func<Ped, bool>)(x => ((Entity)x).IsAlive && Entity.op_Inequality((Entity)x, (Entity)Game.LocalPlayer.Character) && x.IsHuman && !x.IsInAnyVehicle(false) && (double)Vector3.Distance(((Entity)x).Position, ((Entity)Game.LocalPlayer.Character).Position) < 12.5)).OrderBy<Ped, float>((Func<Ped, float>)(x =>
                {
                    Vector3 position = ((Entity)x).Position;
                    return ((Vector3)ref position).DistanceTo(((Entity)Game.LocalPlayer.Character).Position);
                }))).FirstOrDefault<Ped>();
                if (!EntityExtensions.Exists((IHandleable)ped))
                    return;
                ped.Tasks.AchieveHeading(((ISpatial)ped).GetHeadingTowards((ISpatial)Game.LocalPlayer.Character)).WaitForCompletion(2000);
                Object @object = new Object(Model.op_Implicit("hei_prop_hei_id_bank"), Vector3.Zero);
                ped.Tasks.PlayAnimation(AnimationDictionary.op_Implicit("mp_common"), "givetake1_a", 2.5f, (AnimationFlags)0);
                ((Entity)@object).AttachToEntity((Entity)ped, ped.GetBoneIndex((PedBoneId)28422), Vector3.Zero, new Rotator(0.0f, 180f, 0.0f));
                GameFiber.Sleep(1200);
            }
        }));

 

This is the code I have, but it keeps giving the "ref" is an invalid expresion term, how do I get around this

  • Author

It's a mixture of what I tried to get to work for me, from 2 open source code plugins, one is Wilderness calloits which is released on github and is open-source, and same as with Enhanced Stops, so I have not done anything wrong with borrowing and changing code to fot for myself

  • Management Team

What is with all the unnecessary casts and trying to manually call implicit operators those (op_Implicit)? That makes no sense. In any case, you can call DistanceTo on any Vector3, there is no need for ref.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

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.