June 25, 20187 yr So I've finished my Hit And Run Suspect callout, I'm trying to do a Broken Down Vehicle callout, and I want a text to appear when I get near the ped, and I want to be able to cycle through different texts. Like (press Y to talk to ped) and then the subtitle comes up, I press Y again, and it goes to the next subtitle. That's what I want
June 25, 20187 yr basically: private Ped player => Game.LocalPlayer.Character; private ECalloutState calloutState; private List<string> dialogWithCop = new List<string> { "~b~You~w~: Bla bla bla. (1/3)", "~b~Officer~w~: Bla bla bla. (2/3)", "~b~You~w~: Bla bla bla. (3/3)" }; private int dialogWithCopIndex; private void Main() { switch (calloutState) { case ECalloutState.EnRoute: if (Cop) { if (Cop.IsAlive) { if (player.DistanceTo2D(Cop) <= 15) { Game.DisplayHelp( player.IsInAnyVehicle(false) ? "Leave your vehicle and speak with the ~b~Officer" : "Speak with the ~b~Officer", 5000); Cop.TurnToFaceEntity(player); calloutState = ECalloutState.OnScene; } } } break; case ECalloutState.OnScene: if (Cop) { if (Cop.IsAlive) { if (player.IsOnFoot) { if (player.DistanceTo2D(Cop) <= 2) { Game.DisplayHelp("Press ~b~Y~w~ to speak with the ~b~Officer", 5000); Cop.PlayAmbientSpeech(Utils.Utils.Random.Next(1, 3) == 2 ? "GENERIC_HI" : "GENERIC_HOWS_IT_GOING"); calloutState = ECalloutState.NearCop; } } } } break; case ECalloutState.NearCop: if (Cop) { if (Cop.IsAlive) { if (player.IsOnFoot) { if (player.DistanceTo2D(Cop) <= 2) { if (Game.IsKeyDown(Keys.Y)) { Game.HideHelp(); if (dialogWithCopIndex < dialogWithCop.Count) { Game.DisplaySubtitle(dialogWithCop[dialogWithCopIndex]); dialogWithCopIndex++; } if (dialogWithCopIndex == dialogWithCop.Count) { //continue } } } } } } break; } } private enum ECalloutState { EnRoute, OnScene, NearCop } Edited June 25, 20187 yr by NoNameSet
June 25, 20187 yr Author Thanks a MIllion, so would I put that in the "public override void process()" Because I want to make it that I'm the officer talking to the victim with the broken down car
June 26, 20187 yr Author Ah that makes more sense. So with the private Vehicle myVehicle: Private Ped myPed: private Blip myBlip; *AND SO ON* The cop in the text you gave me, would be "myPed" for me, correct?
June 26, 20187 yr Obviously, who else are you going to assign it to? lol Edited June 26, 20187 yr by NoNameSet
June 26, 20187 yr Author Where do I put the { End(): } It's not working no matter what way I'm trying to do it
June 26, 20187 yr Author Also, ECalloutState is underlined red. How would I fix that? EDITED: FIXED THAT PROBLEM, I deleted ECalloutState at the end, so I had to put it bacj in. Just need help with where to put the { End() } Edited June 26, 20187 yr by SRS Bladez
June 26, 20187 yr Your error is obvious in the image above... you cant have a method outside of a void and you are using too many brakets.
June 26, 20187 yr Author Thanks haha, the first time I copied that in, the "public override void End() { base.End(); if (myBlip.Exists()) myBlip.Delete(); if (myPed.Exists()) myPed.Delete(); if (myVehicle.Exists()) myVehicle.Delete(); }" Was all underlined with red, but I realized it was because I deleted ECalloutState 😆, thanks for helping with my callouts as well. It means a lot
June 26, 20187 yr Author The TurnToFaceEntity(player); is underlined red. How can I fix this? I also can talk to the ped private Ped Player => Game.LocalPlayer.Character; private ECalloutState calloutState; private List<string> dialogWithmyPed = new List<string> { "~b~You~w~: Hello Sir, what seems to be the problem today? (1/3)", "~b~Victim~w~: G'day officer, my vehicle broke down, can you take a look and see if you can fix it please. (2/3)", "~b~You~w~: Of course Sir. (3/3)" }; private int dialogWithmyPedIndex; private void Main() { switch (calloutState) { case ECalloutState.EnRoute: if (myPed) { if (myPed.IsAlive) { if (Player.DistanceTo2D(myPed) <= 15) { Game.DisplayHelp( Player.IsInAnyVehicle(false) ? "Leave your vehicle and speak with the ~b~Victim" : "Speak with the ~b~Victim.", 5000); myPed.TurnToFaceEntity(Player); calloutState = ECalloutState.OnScene; } } } break; case ECalloutState.OnScene: if (myPed) { if (myPed.IsAlive) { if (Player.IsOnFoot) { if (Player.DistanceTo2D(myPed) <= 10) { Game.DisplayHelp("Press ~b~Y~w~ to speak with the ~b~Victim.", 5000); calloutState = ECalloutState.NearmyPed; } } } } break; case ECalloutState.NearmyPed: if (myPed) { if (myPed.IsAlive) { if (Player.IsOnFoot) { if (Player.DistanceTo2D(myPed) <= 3) { if (Game.IsKeyDown(System.Windows.Forms.Keys.Y)) { Game.HideHelp(); if (dialogWithmyPedIndex < dialogWithmyPed.Count) { Game.DisplaySubtitle(dialogWithmyPed[dialogWithmyPedIndex]); dialogWithmyPedIndex++; } if (dialogWithmyPedIndex == dialogWithmyPed.Count) { //continue } } } } } } break; } } private enum ECalloutState { EnRoute, OnScene, NearmyPed } Edited June 26, 20187 yr by SRS Bladez
June 26, 20187 yr public static void TurnToFaceEntity(this Ped ped, Entity entity, int duration = -1/*-1 = forever...*/) { NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(ped, entity, duration); } Edited June 26, 20187 yr by NoNameSet
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.