Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

      1. Court House
    3. Suggestions

[C#]Help: How to open a specified building [Resolved]


leihebi

Recommended Posts

I want to open LifeInvader offices now, but I don't want to rely on HKH191's Enable All Interiors (WIP) 4.4. How can I do this in c#? I have seen the open source version of Enable All Interiors (WIP) on github, but I can't find what I need in the code.

Edited by leihebi
Link to post
Share on other sites
3 hours ago, leihebi said:

I want to open LifeInvader offices now, but I don't want to rely on HKH191's Enable All Interiors (WIP) 4.4. How can I do this in c#? I have seen the open source version of Enable All Interiors (WIP) on github, but I can't find what I need in the code.

 

You will need to research these natives:

	void REQUEST_IPL(const char* iplName) { invoke<Void>(0x41B4893843BBDB74, iplName); } // 0x41B4893843BBDB74 0x3B70D1DB b323
	void REMOVE_IPL(const char* iplName) { invoke<Void>(0xEE6C5AD3ECE0A82D, iplName); } // 0xEE6C5AD3ECE0A82D 0xDF7CBD36 b323
	BOOL IS_IPL_ACTIVE(const char* iplName) { return invoke<BOOL>(0x88A741E44A2B3495, iplName); } // 0x88A741E44A2B3495 0xB2C33714 b323

 

This thread will probably be of use to you as well. 

 

Edited by LeeC22
Link to post
Share on other sites
2 hours ago, LeeC22 said:

 

您需要研究这些本地人:

	void REQUEST_IPL(const char* iplName) { invoke<Void>(0x41B4893843BBDB74, iplName); } // 0x41B4893843BBDB74 0x3B70D1DB b323
	void REMOVE_IPL(const char* iplName) { invoke<Void>(0xEE6C5AD3ECE0A82D, iplName); } // 0xEE6C5AD3ECE0A82D 0xDF7CBD36 b323
	BOOL IS_IPL_ACTIVE(const char* iplName) { return invoke<BOOL>(0x88A741E44A2B3495, iplName); } // 0x88A741E44A2B3495 0xB2C33714 b323

 

此线程可能也对您也大有用。

 

This line of code is reporting crazy errors and I'm not sure how to fix it. Can you please help me write the complete code? Thank you very much!

Link to post
Share on other sites
1 hour ago, leihebi said:

This line of code is reporting crazy errors and I'm not sure how to fix it. Can you please help me write the complete code? Thank you very much!

 

You have to write the code, I help with pointing you in the right direction. It's no good people just giving you code all the time, or you won't understand how (or why) the code works when you have to call a Native next time.

 

Those are Native Function calls, which you have to call with the SHVDN Function.Call(). The problem is that SHVDN has many ways of calling them.

 

Let's take the first one for instance, the first column says VOID, which means that native doesn't return a value, so you would call it like this:

Function.Call(Hash.REQUEST_IPL, "IPL Name Here");

 

Sometimes SHVDN doesn't have the full Native name, so if you get an error that says 'Hash' does not contain a definition for NATIVE_NAME_HERE, then you can try this:

Function.Call(Hash._0x41B4893843BBDB74, "IPL Name Here");

 

The number after the comment is the Hash value for that function and putting the _ before it sometimes works.

// 0x41B4893843BBDB74

 

If that fails as well, then as a last resort you can use this:

Function.Call((Hash)0x41B4893843BBDB74, "IPL Name Here");

 

That will always work in my experience.

 

If the first column says something other than VOID, like BOOL in the last one, then you call them like this:

bool returnVal = Function.Call<bool>(Hash.IS_IPL_ACTIVE, "IPL Name Here");

 

If it returned an INT, then it would be Function.Call<int> etc...

 

So when you have found the IPL name of Life invader, look through the OpenAllInteriors source to see how it uses those natives with the Lifeinvader IPL

 

You can find information about a lot of those Native Function calls on this site https://alloc8or.re/gta5/nativedb/

 

Learning how to call the Natives is an essential part of script modding, so it is something you will use a lot.

 

Link to post
Share on other sites
1 hour ago, LeeC22 said:

 

You have to write the code, I help with pointing you in the right direction. It's no good people just giving you code all the time, or you won't understand how (or why) the code works when you have to call a Native next time.

 

Those are Native Function calls, which you have to call with the SHVDN Function.Call(). The problem is that SHVDN has many ways of calling them.

 

Let's take the first one for instance, the first column says VOID, which means that native doesn't return a value, so you would call it like this:

Function.Call(Hash.REQUEST_IPL, "IPL Name Here");

 

Sometimes SHVDN doesn't have the full Native name, so if you get an error that says 'Hash' does not contain a definition for NATIVE_NAME_HERE, then you can try this:

Function.Call(Hash._0x41B4893843BBDB74, "IPL Name Here");

 

The number after the comment is the Hash value for that function and putting the _ before it sometimes works.

// 0x41B4893843BBDB74

 

If that fails as well, then as a last resort you can use this:

Function.Call((Hash)0x41B4893843BBDB74, "IPL Name Here");

 

That will always work in my experience.

 

If the first column says something other than VOID, like BOOL in the last one, then you call them like this:

bool returnVal = Function.Call<bool>(Hash.IS_IPL_ACTIVE, "IPL Name Here");

 

If it returned an INT, then it would be Function.Call<int> etc...

 

So when you have found the IPL name of Life invader, look through the OpenAllInteriors source to see how it uses those natives with the Lifeinvader IPL

 

You can find information about a lot of those Native Function calls on this site https://alloc8or.re/gta5/nativedb/

 

Learning how to call the Natives is an essential part of script modding, so it is something you will use a lot.

 

Can you please write a source file to enable the LifeInvader internals and send it to me? This is very important to me, thanks.

Link to post
Share on other sites
1 hour ago, leihebi said:

Can you please write a source file to enable the LifeInvader internals and send it to me? This is very important to me, thanks.

 

Check if this IPL is active "facelobbyfake"

 

If it is, remove it and then request this one "facelobby".

 

You have all the information required, this is a very simple task.

Link to post
Share on other sites
1 hour ago, LeeC22 said:

 

Check if this IPL is active "facelobbyfake"

 

If it is, remove it and then request this one "facelobby".

 

You have all the information required, this is a very simple task.

Dude, I did manage to load the internals, but I can't get to the inside

Link to post
Share on other sites
1 hour ago, leihebi said:

Dude, I did manage to load the internals, but I can't get to the inside

 

Show me the code you are using.

Link to post
Share on other sites
48 minutes ago, leihebi said:

https://github.com/hetuno/Dividing.Line/blob/main/屏幕截图 2021-01-21 014411.png

int is something I added later, but it does not affect the loading internals.

 

 

You can't just request the IPL like that, because there is already an IPL loaded for that location. As I posted above:

Quote

Check if this IPL is active "facelobbyfake"

 

If it is, remove it and then request this one "facelobby".

 

So the first thing you should be doing is using this to find out if the fake interior is loaded.

Function.Call<bool>(Hash.IS_IPL_ACTIVE, "facelobbyfake");

 

If that returns true (and only if that returns true), then you need to remove the "facelobbyfake" interior. Once you have removed that IPL, then you request the "facelobby" interior.

 

 

Edited by LeeC22
Link to post
Share on other sites
9 hours ago, LeeC22 said:

 

 

You can't just request the IPL like that, because there is already an IPL loaded for that location. As I posted above:

 

So the first thing you should be doing is using this to find out if the fake interior is loaded.

Function.Call<bool>(Hash.IS_IPL_ACTIVE, "facelobbyfake");

 

If that returns true (and only if that returns true), then you need to remove the "facelobbyfake" interior. Once you have removed that IPL, then you request the "facelobby" interior.

 

 

Thank you my dear friend, you have successfully solved my problem. May you be happy every day that follows and let go of what used to bother you.

 

The code should be like this, I was confused and didn't understand your words.

 

Function.Call<bool>(Hash.REMOVE_IPL, "IPL Name");  //Remove
            
Function.Call((Hash)0x41B4893843BBDB74, "IPL Name");  //Request

 

Link to post
Share on other sites
6 hours ago, leihebi said:

The code should be like this, I was confused and didn't understand your words.

 

No it shouldn't... REMOVE_IPL does not return a bool, that's what the word VOID means at the beginning of this line.

 

void REMOVE_IPL(const char* iplName)

 

The correct way to use that native is like this

 

Function.Call(Hash.REMOVE_IPL, "IPL Name");  //Remove

 

The only native that returns a bool is IS_IPL_ACTIVE:

 

if (Function.Call<bool>(Hash.IS_IPL_ACTIVE, "IPL Name")) // Is the IPL active?
{
    // Do something here if the IPL is active
}

 

Edited by LeeC22
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.