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 Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    2. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    3. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    4. Bugs*

    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. Portable Games

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

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

    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
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

[HELP] MP Vehicles in SP


BigChungus
 Share

Recommended Posts

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

Use this trainer: https://www.gta5-mods.com/scripts/simple-trainer-for-gtav

Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

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

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

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 by Guest
Link to comment
Share on other sites

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 by sjaak327
Link to comment
Share on other sites

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. :blush: 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 by Guest
Link to comment
Share on other sites

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. :blush: 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

  • 2 weeks later...
Charles_Manson
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

  • 4 weeks later...
qiangqiang101
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

  • 6 months later...
Charles_Manson
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

@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

  • 4 months later...

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

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
 Share

  • 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.