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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

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

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

A_SN

Avoiding hospital respawn and death cam

Recommended Posts

GeorgeZhang

 

Bugs need fixing:

-The HUD, Pause Menu and Radar all goes away (sometimes) even though I call Function.Call(Hash.DISPLAY_HUD, true); Function.Call(Hash.DISPLAY_RADAR, true);

-The ragdoll native can't really present to us how the player died accurately. (Only velocity can be re-used).

-After the first revive(which is to stop the game from respawning), the player can be killed again so you will get double "wasted" message(one from game one from script).

 

The respawn_controller really can't be killed off completely that's what causing the above issues.(I found out respawn_controller thanks to Leftas's post in another topic)

 

Edit: I made a even better looking code. It fixes the last 2 problems mentioned above. Still no Radar and HUD fix tho. Thanks uNiverselEgacy for the time change.

 

 

void Respawn_Controller(){Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");Function.Call(Hash.IGNORE_NEXT_RESTART, true);Function.Call(Hash._DISABLE_AUTOMATIC_RESPAWN, true);Function.Call(Hash.SET_FADE_OUT_AFTER_DEATH, false);if (playerPed.IsDead){Function.Call(Hash.SET_FADE_IN_AFTER_DEATH_ARREST, true);Vector3 respawnLoc = AllySpawns[0];int s = Audio.PlaySoundFrontend("ScreenFlash", "MissionFailedSounds");int s1 = Audio.PlaySoundFrontend("Bed", "WastedSounds");while (!Audio.HasSoundFinished(s)) Wait(10);int s2 = Audio.PlaySoundFrontend("TextHit", "WastedSounds");Function.Call(Hash._START_SCREEN_EFFECT, "DeathFailOut", 10000, true);BigMessageThread.MessageInstance.ShowMissionPassedMessage("~r~wasted", 4000);Game.TimeScale = 0.2f;Wait(2000);Game.FadeScreenOut(5000);Wait(5000);Yield();Game.TimeScale = 1f;Function.Call(Hash._STOP_ALL_SCREEN_EFFECTS);Audio.StopSound(s);Audio.StopSound(s1);Audio.StopSound(s2);Audio.ReleaseSound(s);Audio.ReleaseSound(s1);Audio.ReleaseSound(s2);Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, playerPed);Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, respawnLoc.X, respawnLoc.Y, respawnLoc.Z, playerPed.Heading, false, false);playerPed.Health = playerPed.MaxHealth;playerPed.Task.ClearAllImmediately();playerPed.Weapons.Select((WeaponHash)Game.GenerateHash(StartingWeapon));Game.FadeScreenIn(3000);BigMessageThread.MessageInstance.ShowMissionPassedMessage("~b~resurrected", 1500);Wait(2000);Game.EnableAllControlsThisFrame(2);Function.Call(Hash.DISPLAY_HUD, true);//Doesn't work hereFunction.Call(Hash.DISPLAY_RADAR, true);//Doesn't work here, eitherplayerPed.FreezePosition = false;}}

 

 

 

Add

Function.Call(Hash._RESET_LOCALPLAYER_STATE);Function.Call(Hash.RESET_PLAYER_ARREST_STATE, player);

to reset you player :).

 

 

 

 

 

 

Hey guys!

 

I made some small additions to the code (most of it was mentioned here).

 

Before:

>You die

>Script detects death

>Make screen grainy, black and white with slomo

>Start wasted sounds

>Show 'wasted' text

>Fade out

>Remove black and white

>Stop wasted sounds

>Respawn

>Fade in

 

After:

>You die

>Script detects death

>Make screen grainy, black and white without slomo

>Start wasted sounds

>(Couldn't get BigMessageThread to work somehow, can anyone tell me what I need for this? :))

>Fade out (faster)

>Remove all peds in a specified radius (if you want to keep your peds, comment it out or remove it)

>Stop wasted sounds

>Remove all screen effects and (just to be sure) slomo

>Respawn

>Give player the ability to use his/her HUD and menus again (weapon wheel not working? :( Well that's weird, got it working again. Need to reproduce for a possible fix)

>Fade in

 

Just wanted to mention that the video lags for like the first 10 seconds :D

https://youtu.be/sXgHFjGF8Hw

 

 

Here is the code:

if (player.IsDead)                {                    Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");                    player = Game.Player.Character;                    Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, player);                    Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, player.Position.X, player.Position.Y, player.Position.Z, 0.0, 0.0, 0.0);                    Function.Call(Hash.IGNORE_NEXT_RESTART, true);                    Function.Call(Hash.SET_PED_TO_RAGDOLL, player, 10000, 10000, 0, 0, 0, 0);                    player.IsInvincible = true;                    int s = Audio.PlaySoundFrontend("ScreenFlash", "MissionFailedSounds");                    int s1 = Audio.PlaySoundFrontend("Bed", "WastedSounds");                    while (!Audio.HasSoundFinished(s)) Wait(100);                    int s2 = Audio.PlaySoundFrontend("TextHit", "WastedSounds");                    Function.Call(Hash._START_SCREEN_EFFECT, "DeathFailOut", 10000, true);                    Game.TimeScale = 1.0f;                    //BigMessageThread.MessageInstance.ShowMissionPassedMessage("~r~wasted", 5000);                    Game.FadeScreenOut(2000);                    Wait(2500);                    Function.Call(Hash._STOP_ALL_SCREEN_EFFECTS);                    foreach(Ped j in World.GetNearbyPeds(player, 64.0f))                    {                        j.Delete();                    }                    Game.TimeScale = 1.0f;                    Audio.StopSound(s);                    Audio.StopSound(s1);                    Audio.StopSound(s2);                    Audio.ReleaseSound(s);                    Audio.ReleaseSound(s1);                    Audio.ReleaseSound(s2);                    Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, player);                    Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, player.Position.X, player.Position.Y, player.Position.Z, 0.0, 0.0, 0.0);                    Function.Call(Hash.IGNORE_NEXT_RESTART, true);                    Function.Call(Hash._RESET_LOCALPLAYER_STATE);                    Function.Call(Hash.RESET_PLAYER_ARREST_STATE, player);                    player.IsInvincible = false;                    Game.FadeScreenIn(2000);                }

 

 

You need NativeUI to show big message. Otherwise you need to make yourself another class : script to do it.

 

 

Okay, I'll try to implement NativeUI, had problems with it.

The log said that it was missing the reference even though the reference was in VS and NativeUI.dll was in "/scripts".

Even did the "using NativeUI;" thing.

 

Holy sh*t it worked now it's perfect :)

 

NativeUI reference fix: go to your project settings and change the net framework to 4.5.2

Share this post


Link to post
Share on other sites
InfamousSabre

Lol i dont know if you guys are in a rush to figure this out or not, but after I release DirtNap V next week, I'll show you how to do this the right way. No network natives, no killing respawn_controller, no HUD issues.

Share this post


Link to post
Share on other sites
ShadowTV

 

Bugs need fixing:
-The HUD, Pause Menu and Radar all goes away (sometimes) even though I call Function.Call(Hash.DISPLAY_HUD, true); Function.Call(Hash.DISPLAY_RADAR, true);
-The ragdoll native can't really present to us how the player died accurately. (Only velocity can be re-used).
-After the first revive(which is to stop the game from respawning), the player can be killed again so you will get double "wasted" message(one from game one from script).

The respawn_controller really can't be killed off completely that's what causing the above issues.(I found out respawn_controller thanks to Leftas's post in another topic)

Edit: I made a even better looking code. It fixes the last 2 problems mentioned above. Still no Radar and HUD fix tho. Thanks uNiverselEgacy for the time change.

 

 

 

void Respawn_Controller(){Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");Function.Call(Hash.IGNORE_NEXT_RESTART, true);Function.Call(Hash._DISABLE_AUTOMATIC_RESPAWN, true);Function.Call(Hash.SET_FADE_OUT_AFTER_DEATH, false);if (playerPed.IsDead){Function.Call(Hash.SET_FADE_IN_AFTER_DEATH_ARREST, true);Vector3 respawnLoc = AllySpawns[0];int s = Audio.PlaySoundFrontend("ScreenFlash", "MissionFailedSounds");int s1 = Audio.PlaySoundFrontend("Bed", "WastedSounds");while (!Audio.HasSoundFinished(s)) Wait(10);int s2 = Audio.PlaySoundFrontend("TextHit", "WastedSounds");Function.Call(Hash._START_SCREEN_EFFECT, "DeathFailOut", 10000, true);BigMessageThread.MessageInstance.ShowMissionPassedMessage("~r~wasted", 4000);Game.TimeScale = 0.2f;Wait(2000);Game.FadeScreenOut(5000);Wait(5000);Yield();Game.TimeScale = 1f;Function.Call(Hash._STOP_ALL_SCREEN_EFFECTS);Audio.StopSound(s);Audio.StopSound(s1);Audio.StopSound(s2);Audio.ReleaseSound(s);Audio.ReleaseSound(s1);Audio.ReleaseSound(s2);Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, playerPed);Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, respawnLoc.X, respawnLoc.Y, respawnLoc.Z, playerPed.Heading, false, false);playerPed.Health = playerPed.MaxHealth;playerPed.Task.ClearAllImmediately();playerPed.Weapons.Select((WeaponHash)Game.GenerateHash(StartingWeapon));Game.FadeScreenIn(3000);BigMessageThread.MessageInstance.ShowMissionPassedMessage("~b~resurrected", 1500);Wait(2000);Game.EnableAllControlsThisFrame(2);Function.Call(Hash.DISPLAY_HUD, true);//Doesn't work hereFunction.Call(Hash.DISPLAY_RADAR, true);//Doesn't work here, eitherplayerPed.FreezePosition = false;}}

 

 

 

Add

Function.Call(Hash._RESET_LOCALPLAYER_STATE);Function.Call(Hash.RESET_PLAYER_ARREST_STATE, player);

to reset you player :).

 

 

 

 

 

 

Hey guys!

 

I made some small additions to the code (most of it was mentioned here).

 

Before:

>You die

>Script detects death

>Make screen grainy, black and white with slomo

>Start wasted sounds

>Show 'wasted' text

>Fade out

>Remove black and white

>Stop wasted sounds

>Respawn

>Fade in

 

After:

>You die

>Script detects death

>Make screen grainy, black and white without slomo

>Start wasted sounds

>(Couldn't get BigMessageThread to work somehow, can anyone tell me what I need for this? :))

>Fade out (faster)

>Remove all peds in a specified radius (if you want to keep your peds, comment it out or remove it)

>Stop wasted sounds

>Remove all screen effects and (just to be sure) slomo

>Respawn

>Give player the ability to use his/her HUD and menus again (weapon wheel not working? :( Well that's weird, got it working again. Need to reproduce for a possible fix)

>Fade in

 

Just wanted to mention that the video lags for like the first 10 seconds :D

https://youtu.be/sXgHFjGF8Hw

 

 

Here is the code:

if (player.IsDead)                {                    Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");                    player = Game.Player.Character;                    Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, player);                    Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, player.Position.X, player.Position.Y, player.Position.Z, 0.0, 0.0, 0.0);                    Function.Call(Hash.IGNORE_NEXT_RESTART, true);                    Function.Call(Hash.SET_PED_TO_RAGDOLL, player, 10000, 10000, 0, 0, 0, 0);                    player.IsInvincible = true;                    int s = Audio.PlaySoundFrontend("ScreenFlash", "MissionFailedSounds");                    int s1 = Audio.PlaySoundFrontend("Bed", "WastedSounds");                    while (!Audio.HasSoundFinished(s)) Wait(100);                    int s2 = Audio.PlaySoundFrontend("TextHit", "WastedSounds");                    Function.Call(Hash._START_SCREEN_EFFECT, "DeathFailOut", 10000, true);                    Game.TimeScale = 1.0f;                    //BigMessageThread.MessageInstance.ShowMissionPassedMessage("~r~wasted", 5000);                    Game.FadeScreenOut(2000);                    Wait(2500);                    Function.Call(Hash._STOP_ALL_SCREEN_EFFECTS);                    foreach(Ped j in World.GetNearbyPeds(player, 64.0f))                    {                        j.Delete();                    }                    Game.TimeScale = 1.0f;                    Audio.StopSound(s);                    Audio.StopSound(s1);                    Audio.StopSound(s2);                    Audio.ReleaseSound(s);                    Audio.ReleaseSound(s1);                    Audio.ReleaseSound(s2);                    Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, player);                    Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, player.Position.X, player.Position.Y, player.Position.Z, 0.0, 0.0, 0.0);                    Function.Call(Hash.IGNORE_NEXT_RESTART, true);                    Function.Call(Hash._RESET_LOCALPLAYER_STATE);                    Function.Call(Hash.RESET_PLAYER_ARREST_STATE, player);                    player.IsInvincible = false;                    Game.FadeScreenIn(2000);                }

 

 

You need NativeUI to show big message. Otherwise you need to make yourself another class : script to do it.

 

 

Okay, I'll try to implement NativeUI, had problems with it.

The log said that it was missing the reference even though the reference was in VS and NativeUI.dll was in "/scripts".

Even did the "using NativeUI;" thing.

 

Holy sh*t it worked now it's perfect :)

 

NativeUI reference fix: go to your project settings and change the net framework to 4.5.2

 

 

 

 

No problem :D

 

But I fixed my problem by just buildind the script :D

 

And thanks for your reference fix, I will definitely keep that in mind :)

 

Well, still having issues with the weapon wheel and even the radio...

Edited by ShadowTV

Share this post


Link to post
Share on other sites
ShadowTV

Well it seems like after some time the 'no weapon wheel' and 'no radio wheel' bug seems to fix itself...

Share this post


Link to post
Share on other sites
GeorgeZhang

Lol i dont know if you guys are in a rush to figure this out or not, but after I release DirtNap V next week, I'll show you how to do this the right way. No network natives, no killing respawn_controller, no HUD issues.

I would love to know the better way to handle it thank you!

And right now my code is doing excellent job, I'm just too happy about it lol

 

Edit: Ok I'll share this 100% working code with radar & hud all working. It's even more shortened.

        void Custom_Respawn()        {                Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");                Function.Call(Hash.IGNORE_NEXT_RESTART, true);                Function.Call(Hash._DISABLE_AUTOMATIC_RESPAWN, true);                if (playerPed.IsDead)                {                    Vector3 respawnLoc = AllySpawns[0];                                        while (!Game.IsScreenFadedOut) Wait(0);                    Function.Call(Hash.TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME, "respawn_controller");                                        Game.TimeScale = 1f;                    Function.Call(Hash._STOP_ALL_SCREEN_EFFECTS);                                        Function.Call(Hash.NETWORK_REQUEST_CONTROL_OF_ENTITY, playerPed);                    Function.Call(Hash.NETWORK_RESURRECT_LOCAL_PLAYER, respawnLoc.X, respawnLoc.Y, respawnLoc.Z, playerPed.Heading, false, false);                                       Wait(2000);                    Game.FadeScreenIn(3500);                    Function.Call(Hash._RESET_LOCALPLAYER_STATE);                    Function.Call(Hash.RESET_PLAYER_ARREST_STATE, player);                    Function.Call(Hash.DISPLAY_HUD, true);                    playerPed.FreezePosition = false;                }            }        }
Edited by GeorgeZhang

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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