BigChungus Posted December 26, 2018 Share Posted December 26, 2018 So whenever i try to spawn a vehicle from the Arena War DLC in Singeplayer i get kicked out of the vehicle and it despawns, anyone know how to fix this? Link to comment Share on other sites More sharing options...
_CP_ Posted December 26, 2018 Share Posted December 26, 2018 Use this trainer: https://www.gta5-mods.com/scripts/simple-trainer-for-gtav Link to comment Share on other sites More sharing options...
BigChungus Posted December 26, 2018 Author Share Posted December 26, 2018 1 hour ago, _CP_ said: Use this trainer: https://www.gta5-mods.com/scripts/simple-trainer-for-gtav I am trying to make my own menu Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2018 Share Posted December 27, 2018 (edited) 16 hours ago, BigChungus said: I am trying to make my own menu Mafins posted some info on 5Mods about setting a Global variable. I have made that info into a small script that sets the variable then unsubscribes the Tick event. I used this, spawned the Clique and then drove round the complete map and the car didn't despawn, so that was about 12 minutes worth of driving. I unloaded Simple Trainer while I tried this, so I had no other mods that could perform this function. Just copy this code into a file called mpdespawndisabler.cs or something you can recognise and drop the file into your scripts folder. The UI.Notify and UI.ShowSubtitle are just there to show what is happening. As I say, the Global variable was provided by Mafins, so I have no idea how reliable this method is, it's the first time I have ever used a Global variable from the game. Try it and see anyway, if it works you have the solution, instead of installing a 12MB trainer you don't want to use. using System; using GTA; namespace MPDespawnDisable { public class MPDespawnDisabler : Script { public MPDespawnDisabler() { Tick += onTick; Interval = 0; } private void onTick(object sender, EventArgs e) { if (Game.IsLoading) return; if (Game.Globals[4266905].GetInt() != 1) { Game.Globals[4266905].SetInt(1); UI.Notify("Setting Despawn Global"); } else { Tick -= onTick; UI.ShowSubtitle("Global is set", 1000); } } } } Edited December 27, 2018 by Guest Link to comment Share on other sites More sharing options...
sjaak327 Posted December 27, 2018 Share Posted December 27, 2018 6 hours ago, LeeC2202 said: Mafins posted some info on 5Mods about setting a Global variable. I have made that info into a small script that sets the variable then unsubscribes the Tick event. I used this, spawned the Clique and then drove round the complete map and the car didn't despawn, so that was about 12 minutes worth of driving. I unloaded Simple Trainer while I tried this, so I had no other mods that could perform this function. Just copy this code into a file called mpdespawndisabler.cs or something you can recognise and drop the file into your scripts folder. The UI.Notify and UI.ShowSubtitle are just there to show what is happening. As I say, the Global variable was provided by Mafins, so I have no idea how reliable this method is, it's the first time I hav ever used a Global variable from the game. Try it and see anyway, if it works you have the solution, instead of installing a 12MB trainer you don't want to use. using System; using GTA; namespace MPDespawnDisable { public class MPDespawnDisabler : Script { public MPDespawnDisabler() { Tick += onTick; Interval = 0; } private void onTick(object sender, EventArgs e) { if (Game.IsLoading) return; if (Game.Globals[4266905].GetInt() != 1) { Game.Globals[4266905].SetInt(1); UI.Notify("Setting Despawn Global"); } else { Tick -= onTick; UI.ShowSubtitle("Global is set", 1000); } } } } This is indeed correct, however use version logial, as with the next patch there is a good chance the global changes, and setting 4266905 might very well crash the game, or at the very least the script. The global can be found on any new patch by decompiling the shop controller script. Link to comment Share on other sites More sharing options...
AdryaNN53 Posted December 27, 2018 Share Posted December 27, 2018 C++ void SPBypass(bool toggle) { globalHandle(4266905).As<BOOL>() = toggle ? 1 : 0; globalHandle(0x41183A).As<BOOL>() = toggle ? 1 : 0; } Link to comment Share on other sites More sharing options...
BigChungus Posted December 27, 2018 Author Share Posted December 27, 2018 Thank you everyone! Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2018 Share Posted December 27, 2018 (edited) 8 hours ago, sjaak327 said: This is indeed correct, however use version logial, as with the next patch there is a good chance the global changes, and setting 4266905 might very well crash the game, or at the very least the script. The global can be found on any new patch by decompiling the shop controller script. I had a feeling that might be the case but I posted this because I was tired of seeing people asking the same question and just getting told to "use this or that mod". The only version of the decompiled scripts I have seen for this version was full of hash_ values instead of the native names, which is the same as I got when I tried to use the script decompiler. But there's no point is asking the question on how to use it properly (the decompiler that is), because it won't get answered. The usual suppliers of decompiled scripts don't seem to be around this time for some reason. But the whole reason people want to create mods, is so that they can create their own, that just do what they want... that's the joy of modding. There is obviously information out there about things like these globals but because this community is so focused on keeping its secrets, it takes something extreme to get that info out into the open. I mean, you have lots of knowledge and are a highly respected member of this community but I bet if you wanted to add a feature to your trainer that was in another mod (like the addon vehicle section that auto-populates itself) and had to ask a question to do it, you wouldn't get told to "use the other mod that does that feature", you'd be given the answer. When I see how active the community is for the older GTA games, and then see how defensive and anti-modder this one is, it makes me despair. Edit: That all probably sounded a bit ranty but please understand something, my afternoon was spent sat in a quiet area of a zoo, talking to myself in front of the patch of ground where my wife's ashes were scattered 7 years ago. It's not something I was looking forward to and it probably influenced the tone of this comment. It wasn't meant to offend anyone and I apologise if it did. Edited December 27, 2018 by Guest Link to comment Share on other sites More sharing options...
sjaak327 Posted December 27, 2018 Share Posted December 27, 2018 (edited) 9 hours ago, LeeC2202 said: I had a feeling that might be the case but I posted this because I was tired of seeing people asking the same question and just getting told to "use this or that mod". The only version of the decompiled scripts I have seen for this version was full of hash_ values instead of the native names, which is the same as I got when I tried to use the script decompiler. But there's no point is asking the question on how to use it properly (the decompiler that is), because it won't get answered. The usual suppliers of decompiled scripts don't seem to be around this time for some reason. But the whole reason people want to create mods, is so that they can create their own, that just do what they want... that's the joy of modding. There is obviously information out there about things like these globals but because this community is so focused on keeping its secrets, it takes something extreme to get that info out into the open. I mean, you have lots of knowledge and are a highly respected member of this community but I bet if you wanted to add a feature to your trainer that was in another mod (like the addon vehicle section that auto-populates itself) and had to ask a question to do it, you wouldn't get told to "use the other mod that does that feature", you'd be given the answer. When I see how active the community is for the older GTA games, and then see how defensive and anti-modder this one is, it makes me despair. Edit: That all probably sounded a bit ranty but please understand something, my afternoon was spent sat in a quiet area of a zoo, talking to myself in front of the patch of ground where my wife's ashes were scattered 7 years ago. It's not something I was looking forward to and it probably influenced the tone of this comment. It wasn't meant to offend anyone and I apologise if it did. https://forum.jvangent.com/download/awar.rar I am sorry to hear about your wife. And you did not offend me in any way, shape or form. However, I do take issue with keeping secrets. I have Always shared my findings with anyone that asked. There are quite a few people in this community that do the same, but maybe that's just because I'm asking, but I tend to believe it doesn't really matter how's asking. Then there are the assholes that indeed want to try and keep secrets. In the case of the global we are discussing, let's look at the part of the code that does this: if (STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS()) { return 0; } if (Global_4266905) { return 0; } if (Global_4266906) { return 1; } if (((func_276() || func_743()) || func_744()) || HUD::_IS_LOADING_PROMPT_BEING_DISPLAYED()) { return 0; } if (func_148() != 999) { return 0; } if (NETWORK::_0x4237E822315D8BA9()) { This in shop_controller, which makes it fairly easy to find when the next patch comes along, it probably won't be 4266905 anymore, but I think the rest of the stuff around it, gives you a fair good deal of information how to find it next time. As to getting rid of the hashes whilst using zorg's decompiler, you would need a hash map translation, which people do post, then adjust x64natives.dat and get the new hashes with the names. I use excel to match the old hashes and new hashes, as my old x64natives.dat has the hashes from previous patch. In this instance, I did not even bother, someone gave me the scripts.rar I linked to earlier, as it takes a long time to decompile all of those on my system, and the version of zorg's decompiler craps out on some scripts (most notably the mod_shop script) which is vital to some information I need, to prevent that from happening, I forgot which parts needs to be commented out, but I just ran the thing in debug, and commented out the line that it excepted on In any case, my comment was just in the interest of preventing crashes and backward compatiblity. For your information, this is how I handle this global: eGameVersion version = getGameVersion(); if (version < 20) { *getGlobalPtr(2558120) = 1; } if ((version < 22 && version > 19)) { *getGlobalPtr(2562051) = 1; } if (version < 26 && version > 21) { *getGlobalPtr(2566708) = 1; } if ((version > 25) && (version < 28)) { *getGlobalPtr(2576573) = 1; } if ((version > 27) && (version < 30)) { *getGlobalPtr(2593910) = 1; } if ((version > 29) && (version < 34)) { *getGlobalPtr(2593970) = 1; } if ((version > 33) && (version < 36)) { *getGlobalPtr(2599337) = 1; } if ((version > 35) && (version < 38)) { *getGlobalPtr(2606794) = 1; } if ((version > 37) && (version <42)) { *getGlobalPtr(4265719) = 1; } if ((version > 41) && (version < 46)) { *getGlobalPtr(4266042) = 1; } if ((version > 45) && (version <48)) { *getGlobalPtr(4266905) = 1; } This is from the very first version this R global was introduced. It will run on any version of the game, and not crash, but actually do what it should do. Mind you, we found out that apparently this global now just despawn Arena War vehicles, it does not despawn previous vehicles. I believe that is a first. Oh, and this code is run in tick, all the time, as whenever someone loads a save for instance, R will set the global to 0 again, effectively despawning the vehicles. Run in tick, no conditions is my advice. Edited December 27, 2018 by sjaak327 Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2018 Share Posted December 27, 2018 (edited) 56 minutes ago, sjaak327 said: Oh, and this code is run in tick, all the time, as whenever someone loads a save for instance, R will set the global to 0 again, effectively despawning the vehicles. Run in tick, no conditions is my advice. That's actually an interesting one because as far as I can tell, with SHVDN scripts, loading a game resets the scripts. I only know that because I have to use it when I screw something up, like creating props or vehicles before adding the cleanup code in the Aborted event... or Blips, I'm a master at creating Blips before adding cleanup code. With that in mind, it would be interesting to keep a track of when the global resets to 0 from a SHVDN perspective. Thank you for the rest of the information, that is truly very much appreciated. I thought the hash translation was built into the script decompiler, so that's where I was going wrong with that. I tried renaming all the dat files to everything I could think of, but to no avail. I keep reading the scripts in the hope of finding some elusive info about player switching, so I think I will have a look through these new scripts tonight, see if I can find anything new. Edited December 27, 2018 by Guest Link to comment Share on other sites More sharing options...
sjaak327 Posted December 27, 2018 Share Posted December 27, 2018 1 hour ago, LeeC2202 said: That's actually an interesting one because as far as I can tell, with SHVDN scripts, loading a game resets the scripts. I only know that because I have to use it when I screw something up, like creating props or vehicles before adding the cleanup code in the Aborted event... or Blips, I'm a master at creating Blips before adding cleanup code. With that in mind, it would be interesting to keep a track of when the global resets to 0 from a SHVDN perspective. Thank you for the rest of the information, that is truly very much appreciated. I thought the hash translation was built into the script decompiler, so that's where I was going wrong with that. I tried renaming all the dat files to everything I could think of, but to no avail. I keep reading the scripts in the hope of finding some elusive info about player switching, so I think I will have a look through these new scripts tonight, see if I can find anything new. Yes, but I have a sneaky suspsion R calls it after a misson ends too, that's why my advice stands. I might be wrong, but this doesn't really come with a perfomance penalty, it's filed under "better save than sorry". Link to comment Share on other sites More sharing options...
Charles_Manson Posted January 8, 2019 Share Posted January 8, 2019 On 12/28/2018 at 2:45 AM, sjaak327 said: https://forum.jvangent.com/download/awar.rar I am sorry to hear about your wife. And you did not offend me in any way, shape or form. However, I do take issue with keeping secrets. I have Always shared my findings with anyone that asked. There are quite a few people in this community that do the same, but maybe that's just because I'm asking, but I tend to believe it doesn't really matter how's asking. Then there are the assholes that indeed want to try and keep secrets. In the case of the global we are discussing, let's look at the part of the code that does this: if (STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS()) { return 0; } if (Global_4266905) { return 0; } if (Global_4266906) { return 1; } if (((func_276() || func_743()) || func_744()) || HUD::_IS_LOADING_PROMPT_BEING_DISPLAYED()) { return 0; } if (func_148() != 999) { return 0; } if (NETWORK::_0x4237E822315D8BA9()) { This in shop_controller, which makes it fairly easy to find when the next patch comes along, it probably won't be 4266905 anymore, but I think the rest of the stuff around it, gives you a fair good deal of information how to find it next time. As to getting rid of the hashes whilst using zorg's decompiler, you would need a hash map translation, which people do post, then adjust x64natives.dat and get the new hashes with the names. I use excel to match the old hashes and new hashes, as my old x64natives.dat has the hashes from previous patch. In this instance, I did not even bother, someone gave me the scripts.rar I linked to earlier, as it takes a long time to decompile all of those on my system, and the version of zorg's decompiler craps out on some scripts (most notably the mod_shop script) which is vital to some information I need, to prevent that from happening, I forgot which parts needs to be commented out, but I just ran the thing in debug, and commented out the line that it excepted on In any case, my comment was just in the interest of preventing crashes and backward compatiblity. For your information, this is how I handle this global: eGameVersion version = getGameVersion(); if (version < 20) { *getGlobalPtr(2558120) = 1; } if ((version < 22 && version > 19)) { *getGlobalPtr(2562051) = 1; } if (version < 26 && version > 21) { *getGlobalPtr(2566708) = 1; } if ((version > 25) && (version < 28)) { *getGlobalPtr(2576573) = 1; } if ((version > 27) && (version < 30)) { *getGlobalPtr(2593910) = 1; } if ((version > 29) && (version < 34)) { *getGlobalPtr(2593970) = 1; } if ((version > 33) && (version < 36)) { *getGlobalPtr(2599337) = 1; } if ((version > 35) && (version < 38)) { *getGlobalPtr(2606794) = 1; } if ((version > 37) && (version <42)) { *getGlobalPtr(4265719) = 1; } if ((version > 41) && (version < 46)) { *getGlobalPtr(4266042) = 1; } if ((version > 45) && (version <48)) { *getGlobalPtr(4266905) = 1; } This is from the very first version this R global was introduced. It will run on any version of the game, and not crash, but actually do what it should do. Mind you, we found out that apparently this global now just despawn Arena War vehicles, it does not despawn previous vehicles. I believe that is a first. Oh, and this code is run in tick, all the time, as whenever someone loads a save for instance, R will set the global to 0 again, effectively despawning the vehicles. Run in tick, no conditions is my advice. Where can i find the file shop_controller ? i mean can you tell me the location of the file ? Link to comment Share on other sites More sharing options...
qiangqiang101 Posted February 1, 2019 Share Posted February 1, 2019 On 12/28/2018 at 5:15 AM, sjaak327 said: https://forum.jvangent.com/download/awar.rar I am sorry to hear about your wife. And you did not offend me in any way, shape or form. However, I do take issue with keeping secrets. I have Always shared my findings with anyone that asked. There are quite a few people in this community that do the same, but maybe that's just because I'm asking, but I tend to believe it doesn't really matter how's asking. Then there are the assholes that indeed want to try and keep secrets. In the case of the global we are discussing, let's look at the part of the code that does this: if (STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS()) { return 0; } if (Global_4266905) { return 0; } if (Global_4266906) { return 1; } if (((func_276() || func_743()) || func_744()) || HUD::_IS_LOADING_PROMPT_BEING_DISPLAYED()) { return 0; } if (func_148() != 999) { return 0; } if (NETWORK::_0x4237E822315D8BA9()) { This in shop_controller, which makes it fairly easy to find when the next patch comes along, it probably won't be 4266905 anymore, but I think the rest of the stuff around it, gives you a fair good deal of information how to find it next time. As to getting rid of the hashes whilst using zorg's decompiler, you would need a hash map translation, which people do post, then adjust x64natives.dat and get the new hashes with the names. I use excel to match the old hashes and new hashes, as my old x64natives.dat has the hashes from previous patch. In this instance, I did not even bother, someone gave me the scripts.rar I linked to earlier, as it takes a long time to decompile all of those on my system, and the version of zorg's decompiler craps out on some scripts (most notably the mod_shop script) which is vital to some information I need, to prevent that from happening, I forgot which parts needs to be commented out, but I just ran the thing in debug, and commented out the line that it excepted on In any case, my comment was just in the interest of preventing crashes and backward compatiblity. For your information, this is how I handle this global: eGameVersion version = getGameVersion(); if (version < 20) { *getGlobalPtr(2558120) = 1; } if ((version < 22 && version > 19)) { *getGlobalPtr(2562051) = 1; } if (version < 26 && version > 21) { *getGlobalPtr(2566708) = 1; } if ((version > 25) && (version < 28)) { *getGlobalPtr(2576573) = 1; } if ((version > 27) && (version < 30)) { *getGlobalPtr(2593910) = 1; } if ((version > 29) && (version < 34)) { *getGlobalPtr(2593970) = 1; } if ((version > 33) && (version < 36)) { *getGlobalPtr(2599337) = 1; } if ((version > 35) && (version < 38)) { *getGlobalPtr(2606794) = 1; } if ((version > 37) && (version <42)) { *getGlobalPtr(4265719) = 1; } if ((version > 41) && (version < 46)) { *getGlobalPtr(4266042) = 1; } if ((version > 45) && (version <48)) { *getGlobalPtr(4266905) = 1; } This is from the very first version this R global was introduced. It will run on any version of the game, and not crash, but actually do what it should do. Mind you, we found out that apparently this global now just despawn Arena War vehicles, it does not despawn previous vehicles. I believe that is a first. Oh, and this code is run in tick, all the time, as whenever someone loads a save for instance, R will set the global to 0 again, effectively despawning the vehicles. Run in tick, no conditions is my advice. oh, i didn't know it has to be on tick, my mod works without on tick but i didn't try yo load save games Link to comment Share on other sites More sharing options...
Charles_Manson Posted August 5, 2019 Share Posted August 5, 2019 On 12/27/2018 at 8:25 AM, Guest said: Mafins posted some info on 5Mods about setting a Global variable. I have made that info into a small script that sets the variable then unsubscribes the Tick event. I used this, spawned the Clique and then drove round the complete map and the car didn't despawn, so that was about 12 minutes worth of driving. I unloaded Simple Trainer while I tried this, so I had no other mods that could perform this function. Just copy this code into a file called mpdespawndisabler.cs or something you can recognise and drop the file into your scripts folder. The UI.Notify and UI.ShowSubtitle are just there to show what is happening. As I say, the Global variable was provided by Mafins, so I have no idea how reliable this method is, it's the first time I have ever used a Global variable from the game. Try it and see anyway, if it works you have the solution, instead of installing a 12MB trainer you don't want to use. using System; using GTA; namespace MPDespawnDisable { public class MPDespawnDisabler : Script { public MPDespawnDisabler() { Tick += onTick; Interval = 0; } private void onTick(object sender, EventArgs e) { if (Game.IsLoading) return; if (Game.Globals[4266905].GetInt() != 1) { Game.Globals[4266905].SetInt(1); UI.Notify("Setting Despawn Global"); } else { Tick -= onTick; UI.ShowSubtitle("Global is set", 1000); } } } } Hello , can i use your script for my mod ? i am making a dlc car only spawner . i will give credits ! i have the new global just want your permission to use this script ! Link to comment Share on other sites More sharing options...
ikt Posted August 7, 2019 Share Posted August 7, 2019 @Charles_Manson Might as well use this thing. iirc I mostly ripped it from EnableMPCars (with permission) and later Unknown updated it to post-b1604, so you should probably take it to those people for permission. (Or just use Addon Spawner, which is exactly what you want to achieve) Link to comment Share on other sites More sharing options...
Skorpro Posted December 22, 2019 Share Posted December 22, 2019 Hi guys, I have a question, which global & version I need to avoid "disappearing vehicles"? (The last one was 4267883) if ((version > 45) && (version < 48)) { *getGlobalPtr(4266905) = 1; } if (version > iVersion) { *getGlobalPtr(iGlobalPtr) = 1; // 4267883 (v1737 / 2019.07.29) } // PS: iVersion & iGlobalPtr are vars for INI... Thanks in advance Link to comment Share on other sites More sharing options...