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.

Absolute NOOB modder questions

Featured Replies

After a while searching around on various modding sites looking for a mod that does what I want and not finding one, I decided to create it myself.  Since the sum-total of my C# experience can be measured in single-digit hours I realized I needed some help from the community.  The mod that I want to code will basically do one thing, I want to open the car's trunk on key up.  Searching around on various websites I think I've found the requisite lines of code but with my level of expertise I might just be attempting to code the dimensions for Playmate of the Month.

 

I think I need to get the vehicle's trunk status first, then compare the status and call for an open/close based on that comparison.  Not precisely sure how to code that.  Let me paste what I've got so far.

 

    void OnKeyUp(object sender, EventArgs e)
    {
        if (e.KeyCode == Keys.U)
        {
            VehicleDoor.Trunk;
            void SET_VEHICLE_DOOR_SHUT(Vehicle vehicle, int 4 bool openInstantly)
        }
    }

 

If I'm heading in the right direction great, if I'm barking up the wrong tree, please let me know.

If I'm understanding what you're wanting to do, here's what I would do..

 

        private static void OpenTrunk()
        {
            while (true)
            {
                if (Game.IsKeyDown(Keys.Up) && Game.LocalPlayer.Character.IsInAnyVehicle(false))
                {
                    Vehicle veh = Game.LocalPlayer.Character.CurrentVehicle;
                    var vehDoor = veh.Doors[5]; //index of 5 represents the vehicles trunk.

                    if (vehDoor.IsValid() && !vehDoor.IsOpen) vehDoor.Open(true); //open trunk if closed.
                    else if (vehDoor.IsValid() && vehDoor.IsOpen) vehDoor.Close(true); //close trunk if opened.
                }

                GameFiber.Yield();
            }
        }

 

  • Author
1 hour ago, ToastinYou said:

If I'm understanding what you're wanting to do, here's what I would do..

 


        private static void OpenTrunk()
        {
            while (true)
            {
                if (Game.IsKeyDown(Keys.Up) && Game.LocalPlayer.Character.IsInAnyVehicle(false))
                {
                    Vehicle veh = Game.LocalPlayer.Character.CurrentVehicle;
                    var vehDoor = veh.Doors[5]; //index of 5 represents the vehicles trunk.

                    if (vehDoor.IsValid() && !vehDoor.IsOpen) vehDoor.Open(true); //open trunk if closed.
                    else if (vehDoor.IsValid() && vehDoor.IsOpen) vehDoor.Close(true); //close trunk if opened.
                }

                GameFiber.Yield();
            }
        }

 

Thanks for the quick reply.  I threw that in and VisualStudio threw up a bunch of undefined terms and invalid terms.  I might be missing a reference because I'm only using ScriptHookVDotNet.  I have a feeling I have a long way to go with coding this.

Edited by greasemonkey98
Experimentation

9 hours ago, greasemonkey98 said:

Thanks for the quick reply.  I threw that in and VisualStudio threw up a bunch of undefined terms and invalid terms.  I might be missing a reference because I'm only using ScriptHookVDotNet.  I have a feeling I have a long way to go with coding this.

Well what I used above was RPH, not SHVDN.

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.