leihebi 4 Posted January 20 Share Posted January 20 (edited) 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 January 27 by leihebi Link to post Share on other sites
LeeC22 623 Posted January 20 Share Posted January 20 (edited) 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 January 20 by LeeC22 Link to post Share on other sites
leihebi 4 Posted January 20 Author Share Posted January 20 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
LeeC22 623 Posted January 20 Share Posted January 20 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
leihebi 4 Posted January 20 Author Share Posted January 20 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
LeeC22 623 Posted January 20 Share Posted January 20 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
leihebi 4 Posted January 20 Author Share Posted January 20 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
LeeC22 623 Posted January 20 Share Posted January 20 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
leihebi 4 Posted January 20 Author Share Posted January 20 13 minutes ago, LeeC22 said: Show me the code you are using. https://github.com/hetuno/Dividing.Line/blob/main/屏幕截图 2021-01-21 014411.png 17 minutes ago, LeeC22 said: Show me the code you are using. int is something I added later, but it does not affect the loading internals. Link to post Share on other sites
LeeC22 623 Posted January 20 Share Posted January 20 (edited) 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 January 20 by LeeC22 Link to post Share on other sites
leihebi 4 Posted January 21 Author Share Posted January 21 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
LeeC22 623 Posted January 21 Share Posted January 21 (edited) 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 January 21 by LeeC22 Link to post Share on other sites